Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
TemplateGenerator Class Reference

Generates documentation using external templates and a pre-built IR. More...

#include <templategenerator.h>

Inheritance diagram for TemplateGenerator:
Collaboration diagram for TemplateGenerator:

Public Member Functions

 TemplateGenerator (FileResolver &fileResolver, QDocDatabase &qdb, const QString &format=QString())
 ~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

Detailed Description

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

See also
DocumentationTraverser, DocumentationHandler, OutputProducer, IR::Builder

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

See also
DocumentationTraverser, DocumentationHandler, OutputProducer

Definition at line 47 of file templategenerator.h.

Constructor & Destructor Documentation

◆ TemplateGenerator()

TemplateGenerator::TemplateGenerator ( FileResolver & fileResolver,
QDocDatabase & qdb,
const QString & format = QString() )
explicit

Definition at line 72 of file templategenerator.cpp.

References TemplateGenerator(), OutputProducerRegistry::instance(), and OutputProducerRegistry::registerProducer().

Referenced by TemplateGenerator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~TemplateGenerator()

TemplateGenerator::~TemplateGenerator ( )
override

Definition at line 81 of file templategenerator.cpp.

References OutputProducerRegistry::instance(), and OutputProducerRegistry::unregisterProducer().

Here is the call graph for this function:

Member Function Documentation

◆ beginDocument()

void TemplateGenerator::beginDocument ( const QString & fileName)
overridevirtual

Implements DocumentationHandler.

Definition at line 199 of file templategenerator.cpp.

◆ endDocument()

void TemplateGenerator::endDocument ( )
overridevirtual

Implements DocumentationHandler.

Definition at line 205 of file templategenerator.cpp.

◆ fileExtension()

QString TemplateGenerator::fileExtension ( ) const
nodiscard

Definition at line 335 of file templategenerator.cpp.

◆ fileName()

QString TemplateGenerator::fileName ( const Node * node) const
nodiscardoverridevirtual

Implements DocumentationHandler.

Definition at line 211 of file templategenerator.cpp.

References Node< _Tp >::isCollectionNode(), and Node< _Tp >::isTextPageNode().

Here is the call graph for this function:

◆ finalize()

void TemplateGenerator::finalize ( )
overridevirtual

Finalizes output production.

Called once per format at the end of the run.

Implements OutputProducer.

Definition at line 189 of file templategenerator.cpp.

◆ format()

QString TemplateGenerator::format ( ) const
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 194 of file templategenerator.cpp.

◆ generateCollectionNode()

void TemplateGenerator::generateCollectionNode ( CollectionNode * cn,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 233 of file templategenerator.cpp.

References IR::Builder::buildPageIR(), and NodeExtractor::extractPageMetadata().

Here is the call graph for this function:

◆ generateCppReferencePage()

void TemplateGenerator::generateCppReferencePage ( Aggregate * aggregate,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 281 of file templategenerator.cpp.

◆ generateGenericCollectionPage()

void TemplateGenerator::generateGenericCollectionPage ( CollectionNode * cn,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 249 of file templategenerator.cpp.

References IR::Builder::buildPageIR(), and NodeExtractor::extractPageMetadata().

Here is the call graph for this function:

◆ generatePageNode()

void TemplateGenerator::generatePageNode ( PageNode * pn,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 265 of file templategenerator.cpp.

References IR::Builder::buildPageIR(), and NodeExtractor::extractPageMetadata().

Here is the call graph for this function:

◆ generateProxyPage()

void TemplateGenerator::generateProxyPage ( Aggregate * aggregate,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 317 of file templategenerator.cpp.

◆ generateQmlTypePage()

void TemplateGenerator::generateQmlTypePage ( QmlTypeNode * qcn,
CodeMarker * marker )
overridevirtual

Implements DocumentationHandler.

Definition at line 294 of file templategenerator.cpp.

References IR::Builder::buildPageIR(), NodeExtractor::extractAllMembersIR(), and NodeExtractor::extractPageMetadata().

Here is the call graph for this function:

◆ mergeCollections()

void TemplateGenerator::mergeCollections ( CollectionNode * cn)
overridevirtual

Implements DocumentationHandler.

Definition at line 330 of file templategenerator.cpp.

References QDocDatabase::mergeCollections().

Here is the call graph for this function:

◆ prepare()

void TemplateGenerator::prepare ( )
overridevirtual

Prepares the producer for an output run.

Called once per format after configuration is loaded.

Implements OutputProducer.

Definition at line 86 of file templategenerator.cpp.

References Generator::autolinkErrors(), Config::createInclusionPolicy(), Generator::noLinkErrors(), and Generator::qmlTypeContext().

Here is the call graph for this function:

◆ produce()

void TemplateGenerator::produce ( )
overridevirtual

Produces documentation output.

Called after prepare() to create the actual documentation files.

Implements OutputProducer.

Definition at line 181 of file templategenerator.cpp.

References QDocDatabase::primaryTreeRoot(), and DocumentationTraverser::traverse().

Here is the call graph for this function:

◆ TemplateGeneratorTest

friend class TemplateGeneratorTest
friend

Definition at line 106 of file templategenerator.h.


The documentation for this class was generated from the following files: