Class FrontBackMatterTreeprocessor
- All Implemented Interfaces:
org.asciidoctor.extension.Processor
Under the book doctype an unnumbered [preface], [colophon],
[dedication], [abstract] or [acknowledgments] section,
and a [appendix], [glossary], [bibliography] or
[index] section, all render as a bare <div class="sect1"> —
indistinguishable in CSS from a numbered chapter. This treeprocessor adds the
role front-matter or back-matter, which the HTML5 backend
emits as an extra class (<div class="sect1 front-matter">), so the
loose-leaf overlay can exclude them from chapter numbering (keeping composite
folios aligned with the document's section numbers) and give them their own
folio scheme.
Registered via the SPI (KonceptExtensionRegistry) so the
asciidoctor-maven-plugin auto-discovers it for every
process-asciidoc render. Operates on the parsed AST only, so it is
backend-agnostic and safe for every backend, including Prawn PDF.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.asciidoctor.ast.Documentprocess(org.asciidoctor.ast.Document document) Add afront-matter/back-matterrole to level-1 special sections.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
-
FrontBackMatterTreeprocessor
public FrontBackMatterTreeprocessor()Creates the treeprocessor.
-
-
Method Details
-
process
public org.asciidoctor.ast.Document process(org.asciidoctor.ast.Document document) Add afront-matter/back-matterrole to level-1 special sections.- Specified by:
processin classorg.asciidoctor.extension.Treeprocessor- Parameters:
document- the parsed document- Returns:
- the same document, with roles added to special sections
-