Class: Giblish::HtmlConverter

Inherits:
DocConverter show all
Defined in:
lib/giblish/docconverter.rb

Overview

Converts asciidoc files to html5 output.

Constant Summary

Constants inherited from DocConverter

DocConverter::COMMON_CONVERTER_OPTS, DocConverter::DEFAULT_ATTRIBUTES

Instance Attribute Summary

Attributes inherited from DocConverter

#converter_options, #paths

Instance Method Summary collapse

Methods inherited from DocConverter

#convert, #convert_str

Constructor Details

#initialize(paths, options) ⇒ HtmlConverter

Returns a new instance of HtmlConverter.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/giblish/docconverter.rb', line 136

def initialize(paths, options)
  super paths, options

  # handle needed assets for the styling (css et al)
  html_attrib = setup_web_assets options[:webRoot]

  # Setting 'data-uri' makes asciidoctor embed images in the resulting
  # html file
  html_attrib["data-uri"] = 1

  # tell asciidoctor to use the html5 backend
  backend_options = {backend: "html5", fileext: "html"}
  add_backend_options backend_options, html_attrib
end