Class KonceptGlossaryTreeprocessor
- All Implemented Interfaces:
org.asciidoctor.extension.Processor
koncept-glossary-all)
glossary mode (IKE-Network/ike-issues#877).
KonceptGlossaryProcessor — the pre-existing, referenced-only (default)
glossary — is a Postprocessor: it runs after
conversion, injecting the whole glossary as a raw HTML string appended to the
output. Asciidoctor's own table of contents is built from the parsed AST
during conversion, before a postprocessor ever runs, so that glossary
is structurally invisible to the TOC no matter how its content is grouped —
the root cause of an 88-page guide with a single TOC entry.
This treeprocessor runs during tree processing instead, so the Section
nodes it creates here are exactly what Asciidoctor's TOC-builder walks moments
later. Two shapes, both covering every known koncept (from
KonceptDefinitionSource.identifiers()):
- Default — one flat "Koncept Glossary" section, alphabetical by label: a traditional glossary appendix. The intended companion to a hand-authored manuscript (separate chapters) that carries the narrative structure a reader actually wants — this treeprocessor's job is just comprehensive lookup, not organization.
koncept-glossary-grouped(set alongsidekoncept-glossary-all) — the original grouped shape: one child section persectionfield (computed against the live knowledge base byKonceptExtractorin tinkar-core, not derived here), titled with its group's own koncept label when the group is a genuine taxonomy subtree, opening with that koncept's own definition as the section's narrative. Kept as an opt-in for whoever wants taxonomy-shaped browsing instead of (or alongside, via a separate render) the flat default.
No-ops unless koncept-glossary-all is set, and skips the pdf
(Prawn) and DocBook backends — the HTML5 family first; KonceptGlossaryProcessor
keeps rendering the referenced-only (default) glossary for every backend, and
keeps owning koncept-glossary-all for DocBook too (it never fully
supported "all" there either — buildGlossaryDocbook always used the
referenced-only registry — so this treeprocessor isn't ceding anything new).
Registered via SPI (KonceptExtensionRegistry) like FrontBackMatterTreeprocessor:
a plain AST-only treeprocessor is safe for every backend, including Prawn — the
backend guard below is a scope choice, not a crash-avoidance requirement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.asciidoctor.ast.Documentprocess(org.asciidoctor.ast.Document document) Methods inherited from class org.asciidoctor.extension.BaseProcessor
createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createBlock, createDocument, createList, createList, createList, createListItem, createListItem, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createPhraseNode, createSection, createSection, createSection, createSection, createSection, createTable, createTable, createTableCell, createTableCell, createTableCell, createTableCell, createTableColumn, createTableColumn, createTableRow, getConfig, log, newCursor, newCursor, newCursor, newReader, newReader, newReader, newReader, parseContent, setConfig, unwrap, updateConfig
-
Constructor Details
-
KonceptGlossaryTreeprocessor
public KonceptGlossaryTreeprocessor()Creates the treeprocessor.
-
-
Method Details
-
process
public org.asciidoctor.ast.Document process(org.asciidoctor.ast.Document document) - Specified by:
processin classorg.asciidoctor.extension.Treeprocessor
-