40 #ifndef best_practices_doxygen_h
41 #define best_practices_doxygen_h
131 @subsection best_practices_doxygen_minimum_enum Enum Minimum Amount to Document
132 Most enums just need an \@brief and if the options are not self explanatory a using ///< seems
133 to be the easiest way to document them. You don't need \@enum unless you are placing the dox
134 far away from the enum. Here is an example:
153 MN, ///< Magnetic North
154 MS, ///< Magnetic South
155 MW, ///< Magnetic West
156 ME, ///< Magnetic East
165 enum CompassDirection
167 MagneticNorth, ///< Magnetic North
168 MagneticSouth, ///< Magnetic South
169 MagneticWest, ///< Magnetic West
170 MagneticEast, ///< Magnetic East
172 North, ///< Geographic North
173 South, ///< Geographic South
174 West, ///< Geographic West
175 East ///< Geographic East
180 @subsection best_practices_doxygen_minimum_class Class Minimum Amount to Document
181 Most classes should have an \@brief providing a simple overview, an \@details providing
182 additional rationle and perhaps a few examples in \@code/\@endcode or \@verbatim/\@endverbatim
183 sections if their use is complicated. Use \@code when you want systax highlighting and a
184 monospace font, use \@verbatim when you don't need syntax hightlighting. Since every method
185 should be well named and well documented hopefully class documentation can be small.
188 Try to document classes in the header file just ahead of the class keyword and \@class will not
207 @subsection best_practices_doxygen_minimum_file File Minimum Amount to Document
208 All Files get an \@file and an \@brief describing a little more than the name of the file could
209 desribe. This mostly provides a link in doxygen that might not otherwise have been generated.
210 The \@file command accepts a filename, leave it out. If specified doxygen will interpret that
211 block as documentation for some other file which might not existor otherwise break when the file
221 @section best_practices_doxygen_copydoc D3 \@copydoc Should Follow inheritance
222 The \@copydoc directive should primarily be used by following up inheritance heiarchies. When
223 used to in other ways it can creates logical dependencines in the documentation that do not
224 match the code which increases future maintanence effort. Consider the follow inheritance tree
227 @dot Sample inheritance tree
235 Animal -> Mammal -> Cat;
237 Animal -> Reptile -> Lizard;
242 Because the Lizard and the Cat have little to do with each other in code they will change in
243 different in the future. Even if they each have an int LegCount() const member function that
244 return 4, they should not copy documentation from eachother. Someone updating the lizard to have
245 6 legs is unlikely to be concerned the Cat class.
248 A more reasonable solution is to have Lizard copy documentation from Reptile and Cat from
249 Mammal. This makes it easy for someone changing code and documentation to know what other
250 documentation should be updated. Following a rule like this also implies that someone changing
251 a class has some responsibility to verify the documentation in each derived class.
258 int Lizard::LegCount() const;
261 int Cat::LegCount() const;
268 int Mammal::LegCount() const;
271 int Cat::LegCount() const;
275 @section best_practices_doxygen_identifier D4 Identifier Commands
276 \@enum, \@typedef, \@class, and other specifiers of things to be documented should be used
277 when documenting things out of line. If the documentation comments precede what you are
278 documenting then these can be omitted. This makes documentation shorter and easier to maintain.
281 Some of our older and more stale dox have some of these dangling from when we did not know
284 @section best_practices_doxygen_ref D5 References
285 Use \@ref often. Anytime you define a class, page, function, section or any other code or
286 documentation structure you can refer to it with \@ref. If you simple put \@ref followed by the
287 class, function, section or page name you will get a link with the text of the name text from
288 the refferred item. If you want different text include link text in quotes. See some examples:
292 @ref Mezzanine::Vector3 and @ref best_practices_doxygen
296 @ref Mezzanine::Vector3 and @ref best_practices_doxygen
300 To provide custom text like this:
302 @ref Mezzanine::Vector3 "X/Y/Z Thingy" and
303 @ref best_practices_doxygen "Lexicographer's hate him"
307 @ref Mezzanine::Vector3 "X/Y/Z Thingy" and
308 @ref best_practices_doxygen "Lexicographer's hate him"