Class KonceptGlossaryTreeprocessor

java.lang.Object
org.asciidoctor.extension.BaseProcessor
org.asciidoctor.extension.Treeprocessor
network.ike.docs.koncept.KonceptGlossaryTreeprocessor
All Implemented Interfaces:
org.asciidoctor.extension.Processor

public final class KonceptGlossaryTreeprocessor extends org.asciidoctor.extension.Treeprocessor
Builds a real, TOC-visible AST section for the comprehensive (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 alongside koncept-glossary-all) — the original grouped shape: one child section per section field (computed against the live knowledge base by KonceptExtractor in 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
    Constructor
    Description
    Creates the treeprocessor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.asciidoctor.ast.Document
    process(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

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • KonceptGlossaryTreeprocessor

      public KonceptGlossaryTreeprocessor()
      Creates the treeprocessor.
  • Method Details

    • process

      public org.asciidoctor.ast.Document process(org.asciidoctor.ast.Document document)
      Specified by:
      process in class org.asciidoctor.extension.Treeprocessor