DocsJson¶
Note
Generated from the C++ headers by apiary --emit-cpp-docs-json.
-
std::string emit_docs_json(const Module &module_, const std::string &module_name)¶
Serialize
module_to a pretty-printed JSON string per the schema above.- Parameters:
module – The binding IR module to serialize.
module_name – Recorded as the document’s “module” field (the Python import name, e.g. “einsums”).
- Returns:
The pretty-printed docs-JSON document as a string.
-
inline constexpr int k_docs_json_schema_version¶
Current docs-JSON schema version.
Bump on any incompatible change to the emitted shape so downstream renderers can guard. v2 adds a per-entity
doc_structuredobject (brief/detail/params/tparams/returns/throws), reST-ready, parsed from the raw Doxygendoc. v3 adds a per-entityoriginfield (“cpp” | “python”) on every top-level documentable entity (class/function/enum/typedef/ concept/macro), so a second extraction frontend (the static Pythonastfrontend) can emit fragments in this same schema and a merge stage can resolve cross-origin collisions. The schema is identical for per-frontend fragments and the merged document — merging is idempotent. v4 adds a stable per-entitysymbol_id(the Clang USR for C++;py:<dotted>for Python) and a top-leveledgesarray (memberOf / inheritsFrom / overrides) — the docs graph that reference resolution keys off. v5 adds a top-levelvariablesarray (module-level data —py:data); the C++ frontend emitted it empty, the static Python frontend fills it from module-level constants. v6 has the C++ frontend fillvariablestoo, from documented namespace-scope variables in docs mode, and gives a C++ variable entrytype,type_canonical,type_template_args,is_constexpr/is_inline/is_const, and aninitializerobject —{kind: "call", callee, template_args, args}with each argument carrying its source text, its parameter name, and its folded constant value when it has one. That makes a declarative header (a table of option descriptors, say) readable by a generator without a second C++ parser. Additive: a Python-frontend variable entry is unchanged, and a renderer that only readsname/docsees no difference.