Class KonceptPatternTableBlockMacro

java.lang.Object
org.asciidoctor.extension.BaseProcessor
org.asciidoctor.extension.MacroProcessor<org.asciidoctor.ast.StructuralNode>
org.asciidoctor.extension.BlockMacroProcessor
network.ike.docs.koncept.KonceptPatternTableBlockMacro
All Implemented Interfaces:
org.asciidoctor.extension.Processor

@Name("koncept-pattern-table") public class KonceptPatternTableBlockMacro extends org.asciidoctor.extension.BlockMacroProcessor
AsciidoctorJ block macro processor that renders a kind: pattern koncept's shape as a real, captioned AsciiDoc table — one Model Feature (the referenced component, then each declared field in order) per three-row group (IKE-Network/ike-issues#883).

Usage in AsciiDoc:

koncept-pattern-table::DescriptionPattern[]

The target is a koncepts.yml identifier (the same key a k: reference uses) of a kind: pattern koncept. The macro emits genuine AsciiDoc table source (.Caption + |===) and hands it to BaseProcessor.parseContent(StructuralNode, List) — the same splice-and-re-parse mechanism KonceptNarrativeBlockMacro uses — so Asciidoctor numbers the table ("Table 2.1"), prose can cross-reference it via <<koncept-pattern-table-DescriptionPattern>>, and the k: badges in its cells resolve through the normal inline-macro pipeline. The glossary's pattern-shape table renders the same design from the same KonceptDefinition.modelFeatures() source; only this macro's tables are numbered and cross-referenceable, which is why the two exist side by side.

Each Model Feature renders as three rows, with no separate row-label column:

  1. an italic label row spanning all three columns — Referenced component (with a generic explanatory phrase: the referenced component may be any component, not just a concept — SemanticRecord.referencedComponentNid has no type restriction) or Field N;
  2. a content row of Meaning | Purpose | Data type badges (the referenced component has no data type — that cell renders an em dash);
  3. an italic e.g. row spanning all three columns with the feature's real example value — a live value from an actual semantic of this pattern, badged when it resolves to a curated koncept, plain text otherwise — omitted when the extraction found no example semantic;
  4. an italic default row spanning all three columns with the feature's default value — the value from the pattern's default value semantic (IKE-Network/ike-issues#888), rendered exactly like the e.g. row — omitted when the pattern has no active default value semantic.
Fields display 1-indexed (Field 1 is fieldDefinitions().get(0)), matching SemanticVersionRecord.toString()'s existing display convention over 0-indexed storage; the referenced component is never numbered because it is not part of the fields array at either the schema or the instance level. The koncept-pattern-table, koncept-model-feature, koncept-feature-example, and koncept-feature-default roles are stylesheet hooks — the shared ike-doc-resources docinfo mutes and indents them; without that CSS the label, example, and default rows still read correctly as italic.

A target with no pattern shape (a plain concept, or an unknown identifier) renders a visible placeholder rather than silently vanishing, matching the koncept-narrative convention.

  • Field Summary

    Fields inherited from class org.asciidoctor.extension.MacroProcessor

    name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new block macro processor instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.asciidoctor.ast.StructuralNode
    process(org.asciidoctor.ast.StructuralNode parent, String target, Map<String,Object> attributes)
     

    Methods inherited from class org.asciidoctor.extension.MacroProcessor

    getName, options, setName

    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

    • KonceptPatternTableBlockMacro

      public KonceptPatternTableBlockMacro()
      Creates a new block macro processor instance.
  • Method Details

    • process

      public org.asciidoctor.ast.StructuralNode process(org.asciidoctor.ast.StructuralNode parent, String target, Map<String,Object> attributes)
      Specified by:
      process in class org.asciidoctor.extension.MacroProcessor<org.asciidoctor.ast.StructuralNode>