Skip to content

Commit 6e5bb78

Browse files
authored
Update doc guidelines (#1200)
1 parent fb6b19d commit 6e5bb78

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

for_developers/docs/guidelines.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,19 @@ Classes and methods can be documented both in the .cxx and .h files. For the lon
1111
of a class functionality and its methods we usually prefer the .cxx file.
1212

1313
## Class documentation
14-
The documentation for the class is in general located at the beginning of the .cxx file.
15-
The `\class` Doxygen command is mandatory otherwise Doxygen will not associate the comments
16-
to the proper class. The first sentence is a brief description of the class and will
17-
appear in all class listings. For an example see the TF2 class documentation:
14+
The class documentation is generally placed at the beginning of the .cxx file. The `\class`
15+
Doxygen command is mandatory; otherwise, Doxygen will not associate the comments with the
16+
correct class. The first sentence or the line starting with `\brief` provides a short
17+
description of the class, as it will appear in all class listings. The `\ingroup` directive
18+
specifies in which group of classes the class belongs. For an example, see
19+
[the documentation of the TF2 class](https://root.cern/doc/master/classTF2.html).
1820

1921
{% highlight C++ %}
2022
/** \class TF2
21-
A 2-Dim function with parameters
23+
\ingroup Functions
24+
\brief A 2-Dim function with parameters.
2225

2326
TF2 graphics function is via the TH1 drawing functions.
24-
Example of a function
25-
26-
TF2 *f2 = new TF2("f2","sin(x)*sin(y)/(x*y)",0,5,0,5);
27-
f2->Draw();
28-
29-
\image html tf2_function2.png
30-
See TF1 class for the list of functions formats
3127
*/
3228
{% endhighlight %}
3329

@@ -101,17 +97,17 @@ The usage of "//!" will still result in transiency of members but not in Doxygen
10197

10298
## Tutorials' documentation
10399

104-
ROOT tutorials are also included in the ROOT documentation. The tutorials'
105-
macros headers should look like:
100+
ROOT tutorials are also part of the ROOT documentation. The macro headers for C++ tutorials
101+
(see the note about Python tutorials) should follow this format:
106102

107103
{% highlight C++ %}
108104
/// \file
109105
/// \ingroup tutorial_hist
110106
/// \notebook
111-
/// Getting Contours From TH2D.
107+
/// \preview Getting Contours From TH2D.
112108
///
113109
/// #### Image produced by `.x ContourList.C`
114-
/// The contours' values are drawn next to each contour.
110+
/// The contours values are drawn next to each contour.
115111
/// \macro_image
116112
///
117113
/// #### Output produced by `.x ContourList.C`
@@ -121,18 +117,19 @@ macros headers should look like:
121117
/// #### `ContourList.C`
122118
/// \macro_code
123119
///
120+
/// \date November 2022
124121
/// \authors Josh de Bever, Olivier Couet
125122
{% endhighlight %}
126123

127-
This example shows that four new directives have been implemented:
124+
This example shows that five ROOT tutorials' specific directives are available:
128125

129126
1. `\macro_image`
130127
The images produced by this macro are shown. A caption can be added to document
131128
the pictures: `\macro_image This is a picture`. When the option `(nobatch)`
132129
is passed, the macro is executed without the batch option.
133130
Some tutorials generate pictures (png or pdf) with `Print` or `SaveAs`.
134131
Such pictures can be displayed with `\macro_image (picture_name.png[.pdf])`
135-
When the option (tcanvas_js) is used the image is displayed as JavaScript.
132+
When the option (tcanvas_js) is used [the image is displayed as JavaScript](https://root.cern/doc/master/arrows_8C.html).
136133
For ROOT 7 tutorials, when the option (rcanvas_js) is used the image is displayed as json file.
137134

138135
2. `\macro_code`
@@ -148,6 +145,14 @@ This example shows that four new directives have been implemented:
148145
This directive needs [jupyter to be properly installed](https://jupyter.org/install) when
149146
building the documentation of tutorials having this directive.
150147

148+
5. `\preview`
149+
To display the first image generated by the tutorial as an
150+
[icon in the list of tutorials](https://root.cern/doc/master/group__tutorial__graphics.html).
151+
151152

152-
Note that the doxygen directive `\authors` or `\author` must be the last one
153+
### Notes
154+
155+
- The doxygen directive `\authors` or `\author` *must be* the last one
153156
of the macro header.
157+
158+
- In python tutorials the comments for the header must be "`##`" ("`#`" will produce an empty page).

0 commit comments

Comments
 (0)