Class: Coradoc::Html::Static

Inherits:
ConverterBase show all
Defined in:
lib/coradoc/html/static.rb

Overview

Static HTML converter

Converts CoreModel documents to static HTML5 output using the unified Liquid template pipeline.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary

Attributes inherited from ConverterBase

#config, #document

Instance Method Summary collapse

Methods inherited from ConverterBase

convert, #initialize, #to_file, to_file

Constructor Details

This class inherits a constructor from Coradoc::Html::ConverterBase

Instance Method Details

#convertObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/coradoc/html/static.rb', line 31

def convert
  renderer = Renderer.new(template_dirs: @config.template_dirs)

  if @config.embedded
    renderer.render(@document)
  else
    renderer.render_html5(
      @document,
      layout: :static,
      lang: @config.lang,
      author: @config.meta_tags[:author],
      description: @config.meta_tags[:description],
      custom_css: @config.custom_css,
      toc: @config.include_toc,
      section_numbers: @config.section_numbering,
      section_number_levels: @config.section_numbering_levels,
      toc_levels: @config.toc_levels
    )
  end
end