class WikiMD::Renderer

Renderer for converting Markdown to HTML includes syntax highlighting from Rouge.

Public Class Methods

build() click to toggle source

Builds a new renderer with all the capabilities we need.

@return [Redcarpet::Markdown] a new Renderer.

# File lib/wikimd/renderer.rb, line 14
def self.build
  Redcarpet::Markdown.new self,
                          fenced_code_blocks: true,
                          no_intra_emphasis: true,
                          autolink: true,
                          strikethrough: true,
                          superscript: true,
                          highlight: true,
                          footnotes: true
end
css() click to toggle source

Generates CSS Rules required for syntax highlighting.

@return [String] CSS!

# File lib/wikimd/renderer.rb, line 28
def self.css
  Rouge::Themes::Github.render(scope: '.highlight')
end