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
DocumentIR Struct Reference

Intermediate representation for a documentation topic. More...

#include <documentir.h>

Collaboration diagram for DocumentIR:

Public Member Functions

QJsonObject toJson () const
 Converts the DocumentIR 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 brief
QJsonObject contentJson

Detailed Description

Intermediate representation for a documentation topic.

DocumentIR 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 19 of file documentir.h.

Member Function Documentation

◆ toJson()

QJsonObject DocumentIR::toJson ( ) const

Converts the DocumentIR 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 126 of file documentir.cpp.

Member Data Documentation

◆ access

Access DocumentIR::access { Access::Public }

Definition at line 25 of file documentir.h.

◆ brief

QString DocumentIR::brief

Definition at line 31 of file documentir.h.

◆ contentJson

QJsonObject DocumentIR::contentJson

Definition at line 34 of file documentir.h.

◆ fullTitle

QString DocumentIR::fullTitle

Definition at line 29 of file documentir.h.

◆ genus

Genus DocumentIR::genus { Genus::DontCare }

Definition at line 23 of file documentir.h.

◆ nodeType

NodeType DocumentIR::nodeType { NodeType::NoType }

Definition at line 22 of file documentir.h.

◆ status

Status DocumentIR::status { Status::Active }

Definition at line 24 of file documentir.h.

◆ title

QString DocumentIR::title

Definition at line 28 of file documentir.h.

◆ url

QString DocumentIR::url

Definition at line 30 of file documentir.h.


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