Module: MDView

Defined in:
lib/mdview.rb,
lib/mdview/version.rb

Defined Under Namespace

Classes: RedPyg, Sinatra

Constant Summary collapse

ALIASES =

language aliases

{
  'coffee' => 'coffeescript',
}
MD =

renderer

Redcarpet::Markdown.new(
  RedPyg, no_intra_emphasis: true, fenced_code_blocks: true,
  autolink: true, lax_spacing: true
)
VERSION =
'0.3.1'
DATE =
'2013-10-25'

Class Method Summary collapse

Class Method Details

.cssObject

pygments css



36
37
38
# File 'lib/mdview.rb', line 36

def self.css
  Pygments.css '.highlight', style: 'autumn'
end

.lang(lang) ⇒ Object

language w/ aliases



41
42
43
# File 'lib/mdview.rb', line 41

def self.lang(lang)
  ALIASES.fetch(lang,lang) || 'text'
end

.md(s) ⇒ Object

render markdown



46
47
48
# File 'lib/mdview.rb', line 46

def self.md(s)
  MD.render s
end