Skip to content

Commit 51c5bf0

Browse files
committed
update pythonizations docs to use pythondoc
1 parent 325a457 commit 51c5bf0

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

for_developers/docs/pythonizations.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,15 @@ sidebar:
77
nav: "for_developers"
88
---
99

10-
Some ROOT classes have *pythonizations* that require additional documentation. These can be added as special boxes to the rendered Doxygen page of their corresponding C++ class. As an example, see the Python-specific [RDataFrame](https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python) docs. This documentation is written in the pythonization files corresponding to the original C++ class, which can be found in `<root_sources>/bindings/pyroot/pythonizations/python/ROOT/_pythonization`. Documentation is added as a module-level docstring, which should following the template below, replacing `{CLASS_NAME}` with the corresponding C++ class name, `{BLOCK_TITLE}` with the title of the documentation block (in most cases, "PyROOT" is used) and `{DOCUMENTATION_BODY}` with the documentation body, which supports the usual Doxygen tags and other formatting methods (see also the [documentation formatting tips]({{'for_developers/docs/useful_tips' | relative_url}})).
10+
Some ROOT classes have *pythonizations* that require additional documentation. These can be added as special boxes to the rendered Doxygen page of their corresponding C++ class. As an example, see the Python-specific [RDataFrame](https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python) docs. This documentation is written in the pythonization files corresponding to the original C++ class, which can be found in `<root_sources>/bindings/pyroot/pythonizations/python/ROOT/_pythonization`.
11+
Documentation is added as a module-level docstring, which should follow the template below. Replace `{CLASS_NAME}` with the corresponding C++ class name and `{DOCUMENTATION_BODY}` with the documentation body. The documentation body supports standard Doxygen tags and other formatting methods (see also the [documentation formatting tips]({{'for_developers/docs/useful_tips' | relative_url}})).
1112

1213
```
13-
r"""
14-
/**
15-
\class {CLASS_NAME}
16-
\brief \parblock \endparblock
17-
\htmlonly
18-
<div class="pyrootbox">
19-
\endhtmlonly
20-
\anchor python
21-
22-
## {BLOCK_TITLE}
23-
14+
r'''
15+
\pythondoc {CLASS_NAME}
2416
{DOCUMENTATION_BODY}
25-
26-
\htmlonly
27-
</div>
28-
\endhtmlonly
29-
*/
30-
"""
17+
\endpythondoc
18+
'''
3119
```
3220

33-
The `\anchor` tag adds a permalink to the PyROOT box on rendered documentation page, allowing for easy linking to the Python-specific documentation by appending `#python` to the URL of the doxygen page (i.e., [https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python](https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python)).
21+
The documentation added this way can be directly linked to by appending `#python` to the URL of the doxygen page (i.e., [https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python](https://root.cern/doc/master/classROOT_1_1RDataFrame.html#python)).

0 commit comments

Comments
 (0)