class Solargraph::Page::Binder

def htmlify text

Returns:
  • (String) -

Parameters:
  • text (String) --
def htmlify text
  Kramdown::Document.new(
    text.to_s.lines.map{|l| l.gsub(/^  /, "\t")}.join,
    input: 'GFM',
    entity_output: :symbolic,
    syntax_highlighter_opts: {
      block: {
        line_numbers: false
      },
      default_lang: :ruby
    },
  ).to_html
end

def initialize locals, render_method

Parameters:
  • render_method (Proc) --
  • locals (Hash) --
def initialize locals, render_method
  super(locals)
  define_singleton_method :render do |template, layout: false, locals: {}|
    render_method.call(template, layout: layout, locals: locals)
  end
  define_singleton_method :erb do |template, layout: false, locals: {}|
    render_method.call(template, layout: layout, locals: locals)
  end
end

def ruby_to_html code

Returns:
  • (String) -

Parameters:
  • code (String) --
def ruby_to_html code
  code
end