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
IR::Document Struct Reference

Intermediate representation for a documentation topic. More...

#include <document.h>

Collaboration diagram for IR::Document:

Public Member Functions

QJsonObject toJson () const
 Converts the Document to a QJsonObject for template rendering.

Public Attributes

NodeType nodeType { NodeType::NoType }
Genus genus { Genus::DontCare }
Status status { Status::Active }
Access access { Access::Public }
QString title
QString fullTitle
QString url
QString since
QString deprecatedSince
QString brief
QList< ContentBlockbody
QJsonObject contentJson
QList< SectionIRsummarySections
QList< SectionIRdetailSections
std::optional< QmlTypeInfoqmlTypeInfo
std::optional< CollectionInfocollectionInfo
std::optional< CppReferenceInfocppReferenceInfo
std::optional< NavigationInfonavigationInfo
QString membersPageUrl

Detailed Description

Intermediate representation for a documentation topic.

Document contains all information needed to render a single documentation page using templates. All links are pre-resolved, sections are pre-organized, and file paths are pre-computed. The template engine receives only this IR and performs no lookups or resolution itself.

The struct includes classification metadata (nodeType, genus, status, access) that allows templates to conditionally render content based on the type and visibility of the documented entity.

Definition at line 196 of file document.h.

Member Function Documentation

◆ toJson()

QJsonObject IR::Document::toJson ( ) const

Converts the Document to a QJsonObject for template rendering.

The JSON structure follows a convention where field names use camelCase and match template variable names. Classification fields (nodeType, genus, status, access) use a two-part structure with "id" (stable kebab-case identifier for conditionals) and "label" (human-readable display name).

The contentJson field is nested under a 'content' key to provide better structure and namespace separation in templates.

Returns a QJsonObject containing all IR data in a format suitable for passing to the Inja template engine via InjaBridge.

Definition at line 356 of file document.cpp.

Member Data Documentation

◆ access

Access IR::Document::access { Access::Public }

Definition at line 202 of file document.h.

Referenced by IR::Builder::buildPageIR().

◆ body

QList<ContentBlock> IR::Document::body

Definition at line 213 of file document.h.

◆ brief

QString IR::Document::brief

Definition at line 210 of file document.h.

◆ collectionInfo

std::optional<CollectionInfo> IR::Document::collectionInfo

Definition at line 224 of file document.h.

◆ contentJson

QJsonObject IR::Document::contentJson

Definition at line 214 of file document.h.

◆ cppReferenceInfo

std::optional<CppReferenceInfo> IR::Document::cppReferenceInfo

Definition at line 227 of file document.h.

◆ deprecatedSince

QString IR::Document::deprecatedSince

Definition at line 209 of file document.h.

◆ detailSections

QList<SectionIR> IR::Document::detailSections

Definition at line 218 of file document.h.

◆ fullTitle

QString IR::Document::fullTitle

Definition at line 206 of file document.h.

◆ genus

Genus IR::Document::genus { Genus::DontCare }

Definition at line 200 of file document.h.

Referenced by IR::Builder::buildPageIR().

◆ membersPageUrl

QString IR::Document::membersPageUrl

Definition at line 233 of file document.h.

◆ navigationInfo

std::optional<NavigationInfo> IR::Document::navigationInfo

Definition at line 230 of file document.h.

◆ nodeType

NodeType IR::Document::nodeType { NodeType::NoType }

Definition at line 199 of file document.h.

Referenced by IR::Builder::buildPageIR().

◆ qmlTypeInfo

std::optional<QmlTypeInfo> IR::Document::qmlTypeInfo

Definition at line 221 of file document.h.

◆ since

QString IR::Document::since

Definition at line 208 of file document.h.

◆ status

Status IR::Document::status { Status::Active }

Definition at line 201 of file document.h.

Referenced by IR::Builder::buildPageIR().

◆ summarySections

QList<SectionIR> IR::Document::summarySections

Definition at line 217 of file document.h.

◆ title

QString IR::Document::title

Definition at line 205 of file document.h.

◆ url

QString IR::Document::url

Definition at line 207 of file document.h.


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