Module: Jekyll::AsciiDoc::Filters

Defined in:
lib/jekyll-asciidoc/filters.rb

Instance Method Summary collapse

Instance Method Details

#asciidocify(input, doctype = nil) ⇒ Object

A Liquid filter for converting an AsciiDoc string to HTML.

input - The AsciiDoc String to convert. doctype - The target AsciiDoc doctype (optional, default: nil).

Returns the HTML formatted String.



10
11
12
13
# File 'lib/jekyll-asciidoc/filters.rb', line 10

def asciidocify input, doctype = nil
  (@context.registers[:cached_asciidoc_converter] ||= (Utils.get_converter @context.registers[:site]))
    .convert(doctype ? %(:doctype: #{doctype}#{Utils::NewLine}#{input}) : (input || ''))
end