Module: Jekyll::AsciiDoc::Filters
- Defined in:
- lib/jekyll-asciidoc/filters.rb
Instance Method Summary collapse
-
#asciidocify(input, doctype = nil) ⇒ String
A Liquid filter for converting an AsciiDoc string to HTML using Converter#convert.
-
#tocify_asciidoc(document, levels = nil) ⇒ String
A Liquid filter for generating an HTML table of contents from a parsed AsciiDoc document.
Instance Method Details
#asciidocify(input, doctype = nil) ⇒ String
A Liquid filter for converting an AsciiDoc string to HTML using Converter#convert.
13 14 15 16 |
# File 'lib/jekyll-asciidoc/filters.rb', line 13 def asciidocify input, doctype = nil (@context.registers[:cached_asciidoc_converter] ||= (Converter.get_instance @context.registers[:site])) .convert(doctype ? %(:doctype: #{doctype}#{Utils::NewLine}#{input}) : (input || '')) end |
#tocify_asciidoc(document, levels = nil) ⇒ String
A Liquid filter for generating an HTML table of contents from a parsed AsciiDoc document.
contents. attribute.
29 30 31 32 |
# File 'lib/jekyll-asciidoc/filters.rb', line 29 def tocify_asciidoc document, levels = nil ::Asciidoctor::Document === document ? (document.converter.convert document, 'outline', toclevels: (levels.nil_or_empty? ? nil : levels.to_i)) : nil end |