Class: AsciiDocConverter::AsciiDoc
- Inherits:
-
Bridgetown::Converter
- Object
- Bridgetown::Converter
- AsciiDocConverter::AsciiDoc
- Defined in:
- lib/asciidoc_converter/asciidoc.rb
Instance Method Summary collapse
-
#convert(content, convertible = nil) ⇒ Object
The conversion pipeline handoff.
-
#matches(ext, _convertible = nil) ⇒ Object
Tell Bridgetown to process these source extensions.
-
#output_ext(ext) ⇒ Object
Output everything into static HTML files.
Instance Method Details
#convert(content, convertible = nil) ⇒ Object
The conversion pipeline handoff
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/asciidoc_converter/asciidoc.rb', line 19 def convert(content, convertible = nil) # Setup modern rendering options matching your workspace style = { safe: :safe, attributes: { "icons" => "font", "sectanchors" => true, "source-highlighter" => "rouge", # Integrates with Bridgetown's default highlighters "imagesdir" => "/images@" # trailing @ makes this a soft default, overridable by an in-document :imagesdir: } } # Render the AsciiDoc content string to safe HTML5 Asciidoctor.convert(content, ) end |
#matches(ext, _convertible = nil) ⇒ Object
Tell Bridgetown to process these source extensions
9 10 11 |
# File 'lib/asciidoc_converter/asciidoc.rb', line 9 def matches(ext, _convertible = nil) ext =~ /^\.(adoc|asciidoc)$/i end |
#output_ext(ext) ⇒ Object
Output everything into static HTML files
14 15 16 |
# File 'lib/asciidoc_converter/asciidoc.rb', line 14 def output_ext(ext) ".html" end |