Module: YARD::Templates::Helpers::HtmlSyntaxHighlightHelper

Included in:
HtmlHelper
Defined in:
lib/yard/templates/helpers/html_syntax_highlight_helper.rb

Overview

Helper methods for syntax highlighting.

Instance Method Summary collapse

Instance Method Details

#html_syntax_highlight_ruby(source) ⇒ String

Highlights Ruby source

Parameters:

  • source (String)

    the Ruby source code

Returns:

  • (String)

    the highlighted Ruby source



9
10
11
12
13
14
15
# File 'lib/yard/templates/helpers/html_syntax_highlight_helper.rb', line 9

def html_syntax_highlight_ruby(source)
  if Parser::SourceParser.parser_type == :ruby
    html_syntax_highlight_ruby_ripper(source)
  else
    html_syntax_highlight_ruby_legacy(source)
  end
end