![]() |
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 &format, 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 | beginDocument (const QString &fileName) override |
| void | endDocument () override |
| QString | fileName (const Node *node) const override |
| void | generateCollectionNode (CollectionNode *cn, CodeMarker *marker) override |
| void | generateGenericCollectionPage (CollectionNode *cn, CodeMarker *marker) override |
| void | generatePageNode (PageNode *pn, CodeMarker *marker) override |
| void | generateCppReferencePage (Aggregate *aggregate, CodeMarker *marker) override |
| void | generateQmlTypePage (QmlTypeNode *qcn, CodeMarker *marker) override |
| void | generateProxyPage (Aggregate *aggregate, CodeMarker *marker) 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 51 of file templategenerator.h.
| using TemplateGenerator::RenderFailureHandler = std::function<void(const QString &message)> |
Definition at line 54 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 287 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 294 of file templategenerator.cpp.
|
nodiscard |
Definition at line 465 of file templategenerator.cpp.
Implements DocumentationHandler.
Definition at line 314 of file templategenerator.cpp.
References Node< _Tp >::isCollectionNode(), and Node< _Tp >::isTextPageNode().
|
overridevirtual |
Finalizes output production.
Called once per format at the end of the run.
Implements OutputProducer.
Definition at line 277 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 282 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 336 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 381 of file templategenerator.cpp.
References IR::Builder::buildPageIR(), and NodeExtractor::extractAllMembersIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 351 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 366 of file templategenerator.cpp.
References IR::Builder::buildPageIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 447 of file templategenerator.cpp.
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 414 of file templategenerator.cpp.
References IR::Builder::buildPageIR(), and NodeExtractor::extractAllMembersIR().
|
overridevirtual |
Implements DocumentationHandler.
Definition at line 460 of file templategenerator.cpp.
References QDocDatabase::mergeCollections().
|
overridevirtual |
Prepares the producer for an output run.
Called once per format after configuration is loaded.
Implements OutputProducer.
Definition at line 136 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 269 of file templategenerator.cpp.
References QDocDatabase::primaryTreeRoot(), and DocumentationTraverser::traverse().
|
friend |
Definition at line 119 of file templategenerator.h.