Module: Prawn::Dev::YardMarkup::CodeHighlight

Defined in:
lib/prawn/dev/yard_markup/code_highlight.rb

Instance Method Summary collapse

Instance Method Details

#html_syntax_highlight_ruby(source) ⇒ Object Also known as: html_markup_ruby



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/prawn/dev/yard_markup/code_highlight.rb', line 10

def html_syntax_highlight_ruby(source)
  converter =
    Kramdown::Converter::Html.__send__(
      :new,
      nil,
      Prawn::Dev::YardMarkup::Document.new('').default_options,
    )

  el = Kramdown::Element.new(:codeblock, source, { lang: 'ruby' })
  converter.convert(el, 0)
end

#parse_codeblocks(html) ⇒ Object

Do nothing



24
25
26
# File 'lib/prawn/dev/yard_markup/code_highlight.rb', line 24

def parse_codeblocks(html)
  html
end