![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Converts Atom chains to QList<IR::ContentBlock> trees. More...
#include <contentbuilder.h>
Public Member Functions | |
| ContentBuilder (BriefHandling briefHandling=BriefHandling::Skip, int headingOffset=0, DiagnosticHandler diagnosticHandler={}) | |
| Constructs a ContentBuilder. | |
| QList< ContentBlock > | build (const Atom *firstAtom) |
| Walks the atom chain starting at firstAtom and returns a list of ContentBlock trees representing the structured documentation body. | |
Converts Atom chains to QList<IR::ContentBlock> trees.
ContentBuilder walks a linked list of Atom nodes (QDoc's internal documentation representation) and produces a structured tree of ContentBlock and InlineContent values suitable for template rendering.
Handled atom types: \list
Format-conditional atoms (FormatIf, FormatElse, FormatEndif) are skipped unconditionally. The template generator builds a format-agnostic IR that serves all output formats from a single build pass.
The optional BriefHandling parameter controls whether brief content (between BriefLeft and BriefRight atoms) is included in the output. The default is BriefHandling::Skip, which suppresses brief content. BriefHandling::Include causes brief content to be emitted as a Paragraph block.
ContentBuilder depends only on Atom (for reading the chain) and IR types (for producing output).
Definition at line 39 of file contentbuilder.h.
|
explicit |
Constructs a ContentBuilder.
The briefHandling parameter controls whether content between BriefLeft and BriefRight atoms is emitted as a Paragraph block (BriefHandling::Include) or suppressed (BriefHandling::Skip).
The headingOffset parameter shifts section heading levels to account for the page structure. QDoc's \section1 maps to level 1, but pages already use {
{} for major sections. The legacy generators apply an offset derived from the node type; callers pass that same offset here so the IR produces correct heading levels without depending on Node. Definition at line 109 of file contentbuilder.cpp.
References ContentBuilder().
Referenced by ContentBuilder().
| QList< ContentBlock > IR::ContentBuilder::build | ( | const Atom * | firstAtom | ) |
Walks the atom chain starting at firstAtom and returns a list of ContentBlock trees representing the structured documentation body.
Returns an empty list if firstAtom is \nullptr.
The builder is reset before processing, so a single ContentBuilder instance can be reused for multiple build() calls.
Definition at line 144 of file contentbuilder.cpp.