4 This page documents how Doxygen is set up in the |Gromacs| source tree,
5 as well as guidelines for adding new Doxygen comments. Examples are included,
6 as well as tips and tricks for avoiding Doxygen warnings. The guidelines focus
7 on C++ code and other new code that follows the new module layout.
8 Parts of the guidelines are still applicable to documenting older code (e.g.,
9 within ``gmxlib/`` or ``mdlib/``), in particular the guidelines about formatting
10 the Doxygen comments and the use of ``\internal``.
11 See :ref:`dev-doc-layout` for the overall structure of the documentation.
13 To get started quickly, you only need to read the first two sections to
14 understand the overall structure of the documentation, and take a look at the
15 examples at the end. The remaining sections provide the details for
16 understanding why the examples are the way they are, and for more complex
17 situations. They are meant more as a reference to look up solutions for
18 particular problems, rather than single-time reading. To understand or find
19 individual Doxygen commands, you should first look at Doxygen documentation
20 (http://www.stack.nl/~dimitri/doxygen/manual/index.html).
26 The |Gromacs| source tree is set up to produce three different levels of Doxygen
29 1. Public API documentation (suffix ``-user``), which documents functions and
30 classes exported from the library and intended for use outside the |Gromacs|
32 2. Library API documentation (suffix ``-lib``), which additionally includes
33 functions and classes that are designed to be used from other parts of
34 |Gromacs|, as well as some guidelines that are mostly of interest to
36 3. Full documentation (suffix ``-full``), which includes (nearly) all (documented)
37 functions and classes in the source tree.
39 Each subsequent level of documentation includes all the documentation from the
40 levels above it. The suffixes above refer to the suffixes of Doxygen input and
41 output files, as well as the name of the output directory. When all the
42 flavors have been built, the front pages of the documentation contain links to
43 the other flavors, and explain the differences in more detail.
45 As a general guideline, the public API documentation should be kept free of
46 anything that a user linking against an unmodified |Gromacs| does not see.
47 In other words, the public API documentation should mainly document the
48 contents of installed headers, and provide the necessary overview of using
49 those. Also, verbosity requirements for the public API documentation are
50 higher: ideally, readers of the documentation could immediately start using the
51 API based on the documentation, without any need to look at the implementation.
53 Similarly, the library API documentation should not contain things that other
54 modules in |Gromacs| can or should never call. In particular, anything declared
55 locally in source files should be only available in the full documentation.
56 Also, if something is documented, and is not identified to be in the library
57 API, then it should not be necessary to call that function from outside its
61 Building the documentation
62 --------------------------
64 If you simply want to see up-to-date documentation, you can go to
65 http://jenkins.gromacs.org/job/Documentation_Nightly_master/javadoc/html-lib/index.xhtml
66 to see the documentation for the current development version.
67 Jenkins also runs Doxygen for all changes pushed to Gerrit for
68 release-5-0 and master branches, and the
69 resulting documentation can be viewed from the link posted by Jenkins. The
70 Doxygen build is marked as unstable if it introduces any Doxygen warnings.
72 You may need to build the documentation locally if you want to check the
73 results after adding/modifying a significant amount of comments. This is
74 recommended in particular if you do not have much experience with Doxygen.
75 It is a good idea to build with all the different settings to see that the
76 result is what you want, and that you do not produce any warnings.
77 For local work, it is generally a good idea to set ``GMX_COMPACT_DOXYGEN=ON``
78 CMake option, which removes some large generated graphs from the documentation
79 and speeds up the process significantly.
81 All files related to Doxygen reside in the ``docs/doxygen/`` subdirectory in the source
82 and build trees. In a freshly checked out source tree, this directory contains
83 various ``Doxyfile-*.cmakein`` files. When you run CMake, corresponding files
84 ``Doxyfile-user``, ``Doxyfile-lib``, and ``Doxyfile-full`` are generated at the
85 corresponding location in the build tree. There is also a
86 ``Doxyfile-common.cmakein``, which is used to produce ``Doxyfile-common``.
87 This file contains settings that are shared between all the input files.
88 ``Doxyfile-compact`` provides the extra settings for ``GMX_COMPACT_DOXYGEN=ON``.
90 You can run Doxygen directly with one of the generated files (all output will
91 be produced under the current working directory), or build one of the
92 ``doxygen-user``, ``doxygen-lib``, and ``doxygen-full`` targets. The targets run
93 Doxygen in a quieter mode and only show the warnings if there were any, and put
94 the output under ``docs/html/doxygen/`` in the build tree, so that the Doxygen
95 build cooperates with the broader ``webpage`` target.
96 The ``doxygen-all`` target builds all three targets with less typing.
98 The generated documentation is put under ``html-user/``, ``html-lib/``, and/or
99 ``html-full/``. Open ``index.xhtml`` file from one of
100 these subdirectories to start browsing (for |Gromacs| developers, the
101 ``html-lib/`` is a reasonable starting point). Log files with all Doxygen
102 warnings are also produced as ``docs/doxygen/doxygen-*.log``, so you can inspect them after
105 You will need Doxygen |EXPECTED_DOXYGEN_VERSION| to build the current
106 documentation. Other versions may work, but likely also produce warnings.
107 Additionally, `graphviz <http://www.graphviz.org>`_ and
108 `mscgen <http://www.mcternan.me.uk/mscgen/>`_ are required for some graphs in
109 the documentation, and ``latex`` for formulas. Working versions are likely
110 available through most package managers. It is possible to build the
111 documentation without these tools, but you will see some errors and the related
112 figures will be missing from the documentation.
114 .. _dev-doxygen-guidelines:
116 General guidelines for Doxygen markup
117 -------------------------------------
119 Doxygen provides quite a few different alternative styles for documenting the
120 source code. There are subtleties in how Doxygen treats the different types of
121 comments, and this also depends somewhat on the Doxygen configuration. It is
122 possible to change the meaning of a comment by just changing the style of
123 comment it is enclosed in. To avoid such issues, and to avoid needing to
124 manage all the alternatives, a single style throughout the source tree is
125 preferable. When it comes to treatment of styles, |Gromacs| uses the default
126 Doxygen configuration with one exception: ``JAVADOC_AUTOBRIEF`` is set ``ON`` to
127 allow more convenient one-line brief descriptions in C code.
129 Majority of existing comments in |Gromacs| uses Qt-style comments (``/*!`` and
130 ``//!`` instead of ``/**`` and ``///``, ``\brief`` instead of ``@brief`` etc.),
131 so these should be used also for new documentation. There is a single
132 exception for brief comments in C code; see below.
134 Similarly, existing comments use ``/*!`` for multiline comments in both C and
135 C++ code, instead of using multiple ``//!`` lines for C++. The rationale is that
136 since the code will be a mixture of both languages for a long time, it is more
137 uniform to use similar style in both. Also, since files will likely transition
138 from C to C++ gradually, rewriting the comments because of different style
139 issues should not generally be necessary. Finally, multi-line ``//!`` comments
140 can work differently depending on Doxygen configuration, so it is better to
141 avoid that ambiguity.
143 When adding comments, ensure that a short brief description is always produced.
144 This is used in various listings, and should briefly explain the purpose of the
145 method without unnecessarily expanding those lists.
146 The basic guideline is to start all comment blocks with ``\brief`` (possibly
147 after some other Doxygen commands).
148 If you want to avoid the ``\brief`` for one-liners, you can use ``//!``, but the
149 description must fit on a single line; otherwise, it is not interpreted as a
150 brief comment. Note in particular that a simple ``/*!`` without a ``\brief``
151 does not produce a brief description.
152 Also note that ``\brief`` marks the whole following paragraph as a brief
153 description, so you should insert an empty line after the intended brief
156 In C code, ``//`` comments must be avoided because some compilers do not like
157 them. If you want to avoid the ``\brief`` for one-liners in C code, use
158 ``/**`` instead of ``//!``. If you do this, the brief description should not
159 contain unescaped periods except at the end. Because of this, you should
160 prefer ``//!`` in C++ code.
162 Put the documentation comments in the header file that contains the
163 declaration, if such a header exists.
164 Implementation-specific comments that do not influence how a method
165 is used can go into the source file, just before the method definition, with an
166 ``\internal`` tag in the beginning of the comment block. Doxygen-style comments
167 within functions are not generally usable.
169 At times, you may need to exclude some part of a header or a source file such
170 that Doxygen does not see it at all. In general, you should try to avoid this,
171 but it may be necessary to remove some functions that you do not want to appear
172 in the public API documentation, and which would generate warnings if left
173 undocumented, or to avoid Doxygen warnings from code it does not understand.
174 Prefer ``\cond`` and ``\endcond`` to do this. If ``\cond`` does not work for
175 you, you can also use ``#ifndef DOXYGEN``. If you exclude a class method in
176 a header, you also need to exclude it in the source code to avoid warnings.
182 The general guidelines on the style of Doxygen comments were given above.
183 This section introduces |Gromacs| specific constructs currently used in Doxygen
184 documentation, as well as how |Gromacs| uses Doxygen groups to organize the
187 Some consistency checks are done automatically using custom scripts.
188 See :doc:`gmxtree` for details.
190 Controlling documentation visibility
191 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 To control in which level of documentation a certain function appears, three
194 different mechanisms are used:
196 * Global Doxygen configuration. This is mainly used to include
197 declarations local to source files only in the full documentation.
198 You can find the details from the ``Doxyfile-*.cmakein`` files, and some of
199 them are also mentioned below on individual code constructs.
200 * The standard Doxygen command ``\internal`` marks the documentation to be only
201 extracted into the full documentation (``INTERNAL_DOCS`` is ``ON`` only for the
202 full documentation). This should be used as a first command in a comment
203 block to exclude all the documentation. It is possible to use ``\internal``
204 and ``\endinternal`` to exclude individual paragraphs, but ``\if internal``
205 is preferred (see below).
206 In addition, |Gromacs|-specific custom Doxygen command ``\libinternal`` is
207 provided, which should be used the same way to exclude the documentation from
208 the public API documentation. This command expands to either ``\internal``
209 or to a no-op, depending on the documentation level.
210 * Doxygen commands ``\if`` and ``\cond`` can be used with section names
211 ``libapi`` and ``internal`` to only include the documentation in library API and
212 the full documentation, respectively. ``libapi`` is also defined in the full
213 documentation. These are declared using ``ENABLED_SECTIONS`` in the Doxygen
216 Examples of locations where it is necessary to use these explicit commands are
217 given below in the sections on individual code constructs.
219 Modules as Doxygen groups
220 ^^^^^^^^^^^^^^^^^^^^^^^^^
222 As described in :ref:`dev-source-layout`, each subdirectory under ``src/gromacs/``
223 represents a *module*, i.e., a somewhat coherent collection of routines.
224 Doxygen cannot automatically generate a list of routines in a module; it only
225 extracts various alphabetical indexes that contain more or less all documented
226 functions and classes. To help reading the documentation, the routines for a
227 module should be visible in one place.
229 |Gromacs| uses Doxygen groups to achieve this: for each documented module, there
230 is a ``\defgroup`` definition for the module, and all the relevant classes and
231 functions need to be manually added to this group using ``\ingroup`` and
233 The group page also provides a natural place for overview documentation about
234 the module, and can be navigated to directly from the "Modules" tab in the
235 generated documentation.
237 Some notes about using ``\addtogroup`` are in order:
239 * ``\addtogroup`` only adds the elements that it directly contains into the
240 group. If it contains a namespace declaration, only the namespace is added
241 to the group, but none of the namespace contents are. For this reason,
242 ``\addtogroup`` should go within the innermost scope, around the members that
243 should actually be added.
244 * If the module should not appear in the public API documentation, its
245 definition (``\defgroup``) should be prefixed with a ``\libinternal``.
246 In this case, also all ``\addtogroup`` commands for this module should be
247 similarly prefixed. Otherwise, they create the group in the public API
248 documentation, but without any of the content from the ``\defgroup``
249 definition. This may also cause the contents of the ``\addtogroup`` section
250 to appear in the public API documentation, even if it otherwise would not.
252 Public API and library API groups
253 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
255 In addition to the module groups, two fixed groups are provided:
256 ``group_publicapi`` and ``group_libraryapi``. Classes and files can be added to
257 these groups using |Gromacs| specific custom ``\inpublicapi`` and
258 ``\inlibraryapi`` commands. The generated group documentation pages are not
259 very useful, but annotated classes and files show the API definition under the
260 name, making this information more easily accessible. These commands in
261 file-level comments are also used for some automatic intermodule dependency
262 validation (see below).
264 Note that functions, enumerations, and other entities that do not have a
265 separate page in the generated documentation can only belong to one group;
266 in such a case, the module group is preferred over the API group.
269 Documenting specific code constructs
270 ------------------------------------
272 This section describes the techical details and some tips and tricks for
273 documenting specific code constructs such that useful documentation is
274 produced. If you are wondering where to document a certain piece of
275 information, see the documentation structure section in :ref:`dev-doc-layout`.
276 The focus of the documentation should be on the overview content: Doxygen pages
277 and the module documentation. An experienced developer can relatively easily
278 read and understand individual functions, but the documentation should help
279 in getting the big picture.
284 The pages that are accessible through navigation from the front page are
285 written using Markdown and are located under ``docs/doxygen/``. Each page should be
286 placed in the page hierarchy by making it a subpage of another page, i.e., it
287 should be referenced once using ``\subpage``. ``mainpage.md`` is the root of the
290 There are two subdirectories, ``user/`` and ``lib/``, determining the highest
291 documentation level where the page appears. If you add pages to ``lib/``, ensure
292 that there are no references to the page from public API documentation.
293 ``\if libapi`` can be used to add references in content that is otherwise
295 Generally, the pages should be on a high enough level and provide overview
296 content that is useful enough such that it is not necessary to exclude them
297 from the library API documentation.
302 For each module, decide on a header file that is the most important one for
303 that module (if there is no self-evident header, it may be better to designate,
304 e.g., ``module-doc.h`` for this purpose, but this is currently not done for any
305 module). This header should contain the ``\defgroup`` definition for the
306 module. The name of the group should be :file:`module_{name}`, where *name*
307 is the name of the subdirectory that hosts the module.
309 The module should be added to an appropriate group (see ``docs/doxygen/misc.cpp`` for
310 definitions) using ``\ingroup`` to organize the "Modules" tab in the generated
313 One or more contact persons who know about the contents of the module should be
314 listed using ``\author`` commands. This provides a point of contact if one
320 Classes and structs in header files appear always in Doxygen documentation,
321 even if their enclosing file is not documented. So start the documentation
322 blocks of classes that are not part of the public API with ``\internal`` or
323 ``\libinternal``. Classes declared locally in source files or in unnamed
324 namespaces only appear in the full documentation.
326 If a whole class is not documented, this does not currently generate any
327 warning. The class is simply exluded from the documentation. But if a member
328 of a documented class is not documented, a warning is generated. Guidelines for
329 documenting free functions apply to methods of a class as well.
331 For base classes, the API classification (``\inpublicapi`` or
332 ``\inlibraryapi``) should be based on where the class is meant to be
333 subclassed. The visibility (``\internal`` or ``\libinternal``), in contrast,
334 should reflect the API classification of derived classes such that the base
335 class documentation is always generated together with the derived classes.
337 For classes that are meant to be subclassed and have protected members, the
338 protected members should only appear at the documentation level where the class
339 is meant to be subclassed. For example, if a class is meant to be subclassed
340 only within a module, the protected members should only appear in the
341 full documentation. This can be accomplished using ``\cond`` (note that you
342 will need to add the ``\cond`` command also to the source files to hide the
343 same methods from Doxygen, otherwise you will get confusing warnings).
345 Methods/functions/enums/macros
346 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
348 These items do not appear in the documentation unless their enclosing scope is
349 documented. For class members, the scope is the class; otherwise, it is the
350 namespace if one exists, or the file. An ``\addtogroup`` can also define a
351 scope if the group has higher visibility than the scope outside it.
352 So if a function is not within a namespace (mostly applicable to C code) and
353 has the same visibility as its enclosing file, it is not necessary to add a
354 ``\internal`` or ``\libinternal``.
356 Static functions are currently extracted for all documentation flavors to allow
357 headers to declare ``static inline`` functions (used in, for example, math code).
358 Functions in anonymous namespaces are only extracted into the full
359 documentation. Together with the above rules, this means that you should avoid
360 putting a ``static`` function within a documented namespace, even within source
361 files, or it may inadvertently appear in the public API documentation.
363 If you want to exclude an item from the documentation, you need to put in
364 inside a ``\cond`` block such that Doxygen does not see it.
365 Otherwise, a warning for an undocumented function is generated. You need to
366 enclose both the declaration and the definition with ``\cond``.
371 Each documented file should start with a documentation block (right after the
372 copyright notice) that documents the file. See the examples section for exact
373 formatting. Things to note:
375 * Please do not specify the file name explicitly after ``\file``. By default,
376 a file comment applies to the file it is contained in, and an explicit file
377 name only adds one more thing that can get out of date.
378 * ``\brief`` cannot appear on the same line as the ``\file``, but should be on
380 * ``\internal`` or ``\libinternal`` should indicate where the header is visible.
381 As a general guideline, all installed headers should appear in the public API
382 documentation, i.e., not contain these commands. If nothing else, then to
383 document that it does not contain any public API functions. Headers that
384 declare anything in the library API should be marked with ``\libinternal``,
385 and the rest with ``\internal``.
386 * All source files, as well as most test files, should be documented with
387 ``\internal``, since they do not provide anything to public or library API,
388 and this avoids unintentionally extracting things from the file into those
389 documentations. Shared test files used in tests from other modules should be
390 marked with ``\libinternal``.
391 * ``\inpublicapi`` or ``\inlibraryapi`` should be used to indicate where the
392 header is meant to be directly included.
393 * As with modules, one or more contact persons should be listed with ``\author``.
394 If you make significant modifications or additions to a file, consider adding
395 an ``\author`` line for yourself.
400 Directory documentation does not typically contain useful information beyond a
401 possible brief description, since they correspond very closely to modules, and
402 the modules themselves are documented. A brief description is still useful to
403 provide a high-level overview of the source tree on the generated "Files" page.
404 A reference to the module is typically sufficient as a brief description for a
405 directory. All directories are currently documented in
406 ``docs/doxygen/directories.cpp``.
417 Here is an example of documenting a C++ class and its containing header file.
418 Comments in the code and the actual documentation explain the used Doxygen
421 /*! \libinternal \file
423 * Declares gmx::MyClass.
425 * More details. The documentation is still extracted for the class even if
426 * this whole comment block is missing.
428 * \author Example Author <example@author.com>
430 * \ingroup module_mymodule
438 * Brief description for the class.
440 * More details. The \libinternal tag is required for classes, since they are
441 * extracted into the documentation even in the absence of documentation for
442 * the enclosing scope.
443 * The \libinternal tag is on a separate line because of a bug in Doxygen
444 * 1.8.5 (only affects \internal, but for clarity it is also worked around
448 * \ingroup module_mymodule
453 // Trivial constructors or destructors do not require documentation.
454 // But if a constructor takes parameters, it should be documented like
460 * Brief description for the method.
462 * \param[in] param1 Description of the first parameter.
463 * \param[in] param2 Description of the second parameter.
464 * \returns Description of the return value.
465 * \throws std::bad_alloc if out of memory.
467 * More details describing the method. It is not an error to put this
468 * above the parameter block, but most existing code has it here.
470 int myMethod(int param1, const char *param2) const;
472 //! Brief description for the accessor.
473 int simpleAccessor() const { return var_; }
475 * Alternative, more verbose way of specifying a brief description.
477 int anotherAccessor() const;
479 * Brief description for another accessor that is so long that it does
480 * not conveniently fit on a single line cannot be specified with //!.
482 int secondAccessor() const;
485 // Private members (whether methods or variables) are currently ignored
486 // by Doxygen, so they don't need to be documented. Documentation
487 // doesn't hurt, though.
496 Here is another example of documenting a C header file (so avoiding all
497 C++-style comments), and including free functions. It also demonstrates the use
498 of ``\addtogroup`` to add multiple functions into a module group without repeated
499 ``\ingroup`` tags. ::
503 * Declares a collection of functions for performing a certain task.
505 * More details can go here.
507 * \author Example Author <example@author.com>
509 * \ingroup module_mymodule
512 /*! \addtogroup module_mymodule */
516 * Brief description for the data structure.
523 /** Brief description for member. */
525 int second; /**< Brief description for the second member. */
527 * Brief description for the third member.
535 * Performs a simple operation.
537 * \param[in] value Input value.
538 * \returns Computed value.
540 * Detailed description.
541 * \inpublicapi cannot be used here, because Doxygen only allows a single
542 * group for functions, and module_mymodule is the preferred group.
544 int gmx_function(int value);
546 /* Any . in the brief description should be escaped as \. */
547 /** Brief description for this function. */
548 int gmx_simple_function();
552 Scoping and visibility rules
553 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
555 The rules where Doxygen expects something to be documented, and when are
556 commands like ``\internal`` needed, can be complex. The examples below
557 describe some of the pitfalls. ::
559 /*! \libinternal \file
563 * The examples below assume that the file is documented like this:
564 * with an \libinternal definition at the beginning, with an intent to not
565 * expose anything from the file in the public API. Things work similarly for
566 * the full documentation if you replace \libinternal with \internal
567 * everywhere in the example.
569 * \ingroup module_example
574 * Brief description for a free function.
576 * A free function is not extracted into the documentation unless the enclosing
577 * scope (in this case, the file) is. So a \libinternal is not necessary.
581 // Assume that the module_example group is defined in the public API.
583 //! \addtogroup module_example
588 * Brief description for a free function within \addtogroup.
590 * In this case, the enclosing scope is actually the module_example group,
591 * which is documented, so the function needs to be explicitly excluded.
592 * \\libinternal does not work, since it would produce warnings about an
593 * undocumented function, so the whole declaration is hidden from Doxygen.
600 // For modules that are only declared in the library API, \addtogroup
601 // cannot be used without an enclosing \cond. Otherwise, it will create
602 // a dummy module with the identifier as the name...
605 //! \addtogroup module_libmodule
611 * No \libinternal is necessary here because of the enclosing \cond.
618 // An alternative to the above is use this, if the enclosing scope is only
619 // documented in the library API:
621 //! \libinternal \addtogroup module_libmodule
624 //! Brief description.
629 /*! \libinternal \brief
630 * Brief description for a struct.
632 * Documented structs and classes from headers are always extracted into the
633 * documentation, so \libinternal is necessary to exclude it.
634 * Currently, undocumented structs/classes do not produce warnings, so \cond
639 int member1; //!< Each non-private member should be documented.
640 bool member2; //!< Otherwise, Doxygen will produce warnings.
643 // This namespace is documented in the public API.
649 * Brief description for a free function within a documented namespace.
651 * In this case, the enclosing scope is the documented namespace,
652 * so a \cond is necessary to avoid warnings.
658 * Class meant for subclassing only within the module, but the subclasses will
661 * This base class still provides public methods that are visible through the
662 * subclasses, so it should appear in the public documentation.
663 * But it is not marked with \inpublicapi.
671 * This method also appears in the documentation of each subclass in
672 * the public and library API docs.
677 // The \cond is necessary to exlude this documentation from the public
678 // API, since the public API does not support subclassing.
680 //! A method that only subclasses inside the module see.
681 void methodForSubclassToCall();
683 //! A method that needs to be implemented by subclasses.
684 virtual void virtualMethodToImplement() = 0;
693 Documenting a new module should place a comment like this in a central header
694 for the module, such that the "Modules" tab in the generated documentation can
695 be used to navigate to the module. ::
697 /*! \defgroup module_example "Example module (example)"
698 * \ingroup group_utilitymodules
700 * Brief description for the module.
702 * Detailed description of the module. Can link to a separate Doxygen page for
703 * overview, and/or describe the most important headers and/or classes in the
704 * module as part of this documentation.
706 * For modules not exposed publicly, \libinternal can be added at the
707 * beginning (before \defgroup).
709 * \author Author Name <author.name@email.com>
712 // In other code, use \addtogroup module_example and \ingroup module_example to
713 // add content (classes, functions, etc.) onto the module page.
718 The most common mistake, in particular in C code, is to forget to document the
719 file. This causes Doxygen to ignore most comments in the file, so it
720 does not validate the contents of the comments either, nor is it possible to
721 actually check how the generated documentation looks like.
723 The following examples show some other common mistakes (and some less common)
724 that do not produce correct documentation, as well as Doxygen "features"/bugs
725 that can be confusing.
727 * The struct itself is not documented; other comments within the declaration
732 // The comment tries to document both members at once, but it only
733 // applies to the first. The second produces warnings about missing
734 // documentation (if the enclosing struct was documented).
736 //! Angle parameters.
740 * This does not produce any brief documentation.
741 An explicit ``\brief`` is required, or ``//!`` (C++) or ``/** */`` (C)
744 /*! Brief comment. */
747 * This does not produce any documentation at all, since a ``!`` is missing at
757 * This puts the whole paragraph into the brief description.
758 A short description is preferable, separated by an empty line from the rest
762 * Brief description. The description continues with all kinds of details about
763 * what the function does and how it should be called.
767 * This may be a Doxygen bug, but this does not produce any brief description. ::
769 /** \internal Brief description. */
772 * If the first declaration below appears in a header, and the second in a
773 source file, then Doxygen does not associate them correctly and complains
774 about missing documentation for the latter. The solution is to explicitly
775 add a namespace prefix also in the source file, even though the compiler
776 does not require it. ::
779 //! Example function with a namespace-qualified parameter type.
780 int gmx_function(const gmx::SomeClass ¶m);
783 using gmx::SomeClass;
785 int gmx_function(const SomeClass ¶m);
787 * This puts the namespace into the mentioned module, instead of the contents
788 of the namespace. ``\addtogroup`` should go within the innermost scope. ::
790 //! \addtogroup module_example
796 //! Function intended to be part of module_example.
804 More examples you can find by looking at existing code in the source tree. In
805 particular new C++ code such as that in the ``src/gromacs/analysisdata/`` and
806 ``src/gromacs/options/`` subdirectories contains a large amount of code
807 documented mostly along these guidelines. Some comments in
808 ``src/gromacs/selection/`` (in particular, any C-like code) predate the
809 introduction of these guidelines, so those are not the best examples.
811 .. include:: /fragments/doxygen-links.rst