Documenting amongoc#
Warning
This page is for amongoc developers and the documented components and
behavior are not part of any public API guarantees.
External cppreference Links#
We use a custom-generated Sphinx inventory for objects documented on
cppreference, because at time of writing, cppreference does not have a
Sphinx inventory of its own. This inventory is generated with code in
docs/conf.py on-the-fly when documentation is buidt. Linking to external
items requires that they are present in the custom inventory. If a link fails to
generate, ensure it is present in the custom inventory.
For objects that live in the C++ std namespace, use a std__ prefix
instead of the std:: namespace. This works around a limitation in the Sphinx
C++ domain that refuses to generate hyperlinks for the std namespace. The
generated link text will use the std:: prefix as long as the link’s display
name is set correctly in the generated inventory:
.. cpp:function:: std__nullptr_t my_func(std__size_t sz)
Supplements#
- .. header-file:: <filepath>#
Documents a header file at
filepath.Note
Don’t treat this like
.. classand add the API components within the body of the directive, as that will lead to excessive indentation in the resulting document.Instead, use a back-reference on the API components by adding a
:header:documentation field.
- .. doc-attr:: <attr>#
Documents a documentation-only attribute. (e.g.
[[transfer]],[[storage]])
- :header-file:#
This inline text role generates a link to a header file documented using the
header-filedirective.