Class: Docbook::Output::PipelineSteps::GenerateToc

Inherits:
Object
  • Object
show all
Defined in:
lib/docbook/output/pipeline_steps/generate_toc.rb

Overview

Step 2: Generate table of contents from parsed document.

Instance Method Summary collapse

Instance Method Details

#call(guide, context) ⇒ Object



8
9
10
11
12
13
# File 'lib/docbook/output/pipeline_steps/generate_toc.rb', line 8

def call(guide, context)
  toc_tree = Services::TocGenerator.new(context.parsed).generate
  toc_sections = toc_tree.map { |node| toc_node_to_hash(node) }
  guide["toc_sections_raw"] = toc_sections
  guide
end