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_structured object (brief/detail/params/tparams/returns/throws), reST-ready, parsed from the raw Doxygen doc. v3 adds a per-entity origin field (“cpp” | “python”) on every top-level documentable entity (class/function/enum/typedef/ concept/macro), so a second extraction frontend (the static Python ast frontend) 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-entity symbol_id (the Clang USR for C++; py:<dotted> for Python) and a top-level edges array (memberOf / inheritsFrom / overrides) — the docs graph that reference resolution keys off. v5 adds a top-level variables array (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 fill variables too, from documented namespace-scope variables in docs mode, and gives a C++ variable entry type, type_canonical, type_template_args, is_constexpr/is_inline/is_const, and an initializer object — {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 reads name/doc sees no difference.