class Neo4j::AsciidoctorExtensions::RevealJsLinearNavigationTreeProcessor
A tree process that “flatten” a reveal.js presentation to use a linear navigation. By default, the reveal.js converter will use a vertical navigation for the second levels of section titles (and below). This extension will effectively prevent that by using only first level section titles.
Public Instance Methods
process(document)
click to toggle source
# File lib/neo4j/asciidoctor/extensions/revealjs_linear_navigation/extension.rb, line 17 def process(document) if document.backend == 'revealjs' document.find_by(context: :section) { |section| section.level > 1 }.reverse_each do |section| section.parent.blocks.delete(section) parent_section = section.parent parent_section = parent_section.parent while parent_section.parent && parent_section.parent.context == :section section.level = 1 document.blocks.insert(parent_section.index + 1, section) end end document end