![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Generates documentation using external templates and a pre-built IR. More...
#include <templategenerator.h>
Public Types | |
| using | RenderFailureHandler = std::function<void(const QString &message)> |
Public Member Functions | |
| TemplateGenerator (FileResolver &fileResolver, QDocDatabase &qdb, const QString &formatformat, RenderFailureHandler reportFailure) | |
| Constructs a producer for format using fileResolver and qdb. | |
| ~TemplateGenerator () override | |
| void | prepare () override |
| Prepares the producer for an output run. | |
| void | produce () override |
| Produces documentation output. | |
| void | finalize () override |
| Finalizes output production. | |
| QString | format () const override |
| Returns the format identifier for this producer (e.g., "HTML", "DocBook", "template"). | |
| void | planLocations (const LocationPlanSet &publications) |
| void | beginDocument (const QString &fileName) override |
| void | endDocument () override |
| QString | fileName (const Node *node) const override |
| void | generateCollectionNode (CollectionNode *cn, CodeMarker *markermarker) override |
| void | generateGenericCollectionPage (CollectionNode *cn, CodeMarker *markermarker) override |
| void | generatePageNode (PageNode *pn, CodeMarker *markermarker) override |
| void | generateCppReferencePage (Aggregate *aggregate, CodeMarker *markermarker) override |
| void | generateQmlTypePage (QmlTypeNode *qcn, CodeMarker *markermarker) override |
| void | generateProxyPage (Aggregate *aggregate, CodeMarker *markermarker) override |
| void | mergeCollections (CollectionNode *cn) override |
| QString | fileExtension () const |
| Public Member Functions inherited from OutputProducer | |
| virtual | ~OutputProducer ()=default |
| Public Member Functions inherited from DocumentationHandler | |
| virtual | ~DocumentationHandler ()=default |
Friends | |
| class | TemplateGeneratorTest |
Generates documentation using external templates and a pre-built IR.
TemplateGenerator implements OutputProducer and DocumentationHandler to generate documentation without inheriting from Generator. It uses DocumentationTraverser for tree traversal and delegates content generation to templates via the IR system.
The generator follows a composition-based design: \list
TemplateGenerator implements OutputProducer and DocumentationHandler to generate documentation without inheriting from Generator. It uses DocumentationTraverser for tree traversal and delegates content generation to templates via the IR system.
The generator follows a composition-based design: \list
Definition at line 52 of file templategenerator.h.
| using TemplateGenerator::RenderFailureHandler = std::function<void(const QString &message)> |
Definition at line 55 of file templategenerator.h.
|
explicit |
Constructs a producer for format using fileResolver and qdb.
The required reportFailure callback reports a render diagnostic and records that the QDoc run must exit non-zero.
Definition at line 121 of file templategenerator.cpp.
References TemplateGenerator(), OutputProducerRegistry::instance(), and OutputProducerRegistry::registerProducer().
Referenced by TemplateGenerator().
|
override |
Definition at line 131 of file templategenerator.cpp.
References OutputProducerRegistry::instance(), and OutputProducerRegistry::unregisterProducer().
Implements DocumentationHandler.
Definition at line 301 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 308 of file templategenerator.cpp.
|
nodiscard |
Definition at line 462 of file templategenerator.cpp.
Implements DocumentationHandler.
Definition at line 328 of file templategenerator.cpp.
|
overridevirtual |
Finalizes output production.
Called once per format at the end of the run.
Implements OutputProducer.
Definition at line 291 of file templategenerator.cpp.
|
nodiscardoverridevirtual |
Returns the format identifier for this producer (e.g., "HTML", "DocBook", "template").
Used for format selection and matching. The identifier is case-sensitive and must match the value used in configuration files.
Implements OutputProducer.
Definition at line 296 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 333 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 378 of file templategenerator.cpp.
References IR::Builder::buildPageIR(), and NodeExtractor::extractAllMembersIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 348 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 363 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 444 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 411 of file templategenerator.cpp.
References IR::Builder::buildPageIR(), and NodeExtractor::extractAllMembersIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 457 of file templategenerator.cpp.
References QDocDatabase::mergeCollections().
| void TemplateGenerator::planLocations | ( | const LocationPlanSet & | publications | ) |
Definition at line 136 of file templategenerator.cpp.
|
overridevirtual |
Prepares the producer for an output run.
Called once per format after configuration is loaded.
Implements OutputProducer.
Definition at line 151 of file templategenerator.cpp.
References Generator::autolinkErrors(), Config::createInclusionPolicy(), Generator::noLinkErrors(), and Generator::qmlTypeContext().
|
overridevirtual |
Produces documentation output.
Called after prepare() to create the actual documentation files.
Implements OutputProducer.
Definition at line 283 of file templategenerator.cpp.
References QDocDatabase::primaryTreeRoot(), and DocumentationTraverser::traverse().
|
friend |
Definition at line 123 of file templategenerator.h.