Refresh

This website rubydoc.info/gems/yard/0.9.35/YARD/Templates/Helpers/HtmlSyntaxHighlightHelper is currently offline. Cloudflare's Always Online™ shows a snapshot of this web page from the Internet Archive's Wayback Machine. To check for the live version, click Refresh.

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

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

Overview

Helper methods for syntax highlighting.

Instance Method Summary collapse

Methods included from ModuleHelper

#prune_method_listing

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



12
13
14
15
16
17
18
# File 'lib/yard/templates/helpers/html_syntax_highlight_helper.rb', line 12

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