1 %> @file documentationGuidelines.m
2 %> @brief Documentation guidelines to extract documentation
using Doxygen
3 %======================================================================
4 %> @mainpage Documentation guidelines
6 %> @section intro Introduction
8 %> The @b doxygen software (http:
9 %> from your code to automatically generate documentation.
11 %> Doxygen builds automatically a documentation based on C++ components (classes,
12 %> functions, structs, variables,...)
using syntaxic analysis. Doxygen extends
this 13 %> documentation by extracting special comments.
15 %> @section matlabComments Extract code comments from Matlab files (.m files)
17 %> Matlab code is not supported nativly by Doxygen : a perl filter allowing the conversion
18 %> from .m to C++ has been developped, the @c m2cpp.pl script.
20 %> This filter extracts only :
21 %> - lines beginning with <b>%></b> :
22 %> these lines are converted into C++ comments, ie beginning by
23 %> - lines beginning with the @c
function keyword :
24 %> these lines are converted into C++ functions
25 %> - lines beginning with the @c classdef keyword :
26 %> these lines are converted into C++ classes
27 %> - lines beginning with the @c properties keyword :
28 %> these lines are converted into C++ properties
29 %> - lines beginning with the @c enumeration keyword :
30 %> these lines are converted into C++
enum 31 %> - lines beginning with the @c events keyword :
32 %> these lines are converted into C++
enum Events
33 %> @note
for enumeration definition :
this script only supports the following declaration :
40 %> This one is not yet supported :
43 %> first_enum, second_enum
46 %> The file classDocumentationExample.m provides an example of enumeration definition
47 %> with comments extracted by Doxygen.
51 %> See @ref installation
if you want more details about how to make
this script work.
53 %> @attention Each line belonging to the doxygen documentation must begin with <b>%></b> .
58 %>% Matlab comment ignored by doxygen
59 %>%> comment analyzed by doxygen
61 %> @attention Doxygen keyword have to begin by @b @,
for example @@b to bold the text (the use of \ instead of @ is not supported)
63 %>@section funcDecr Function description
64 %> The keyword @b @@
param and @b @@retval will be used to describe the input and
65 %> output parameters of a
function.
67 %> For
function description, the description should follow the following presentation :
70 %>% ======================================================================
71 %>%> @brief Brief description of the
function 73 %>%> More detailed description.
75 %>%> @
param arg1 First argument
76 %>%> @
param arg2 Second argument
78 %>%> @retval out1
return value
for the first output variable
79 %>%> @retval out2
return value
for the second output variable
80 %>% ======================================================================
81 %>[out1, out2] =
function( arg1, arg2)
88 %> @section classDecr Class description
90 %> For
class description, the following description can be used :
93 %>% ======================================================================
94 %>%> @brief Brief description of the
class 96 %>%> More detailed description of the
class 98 %>% ======================================================================
102 %> @page installation Installation details
104 %> This package contains two files :
105 %> - a perl script (@c m2cpp.pl) which is a filter that converts .m files into .cpp files that Doxygen can understand
106 %> - the @c Doxyfile file (configuration file used by Doxygen) that contains parameters needed by Doxygen to extract the documentation from .m files.
109 %> - You need to have the @b Doxygen software installed (version 1.5.9 or newer required (tested with version 1.7.1))
110 %> - You need to have @b perl installed (perl is shipped with Matlab, located usually in @c $matlabroot\\sys\\perl\\win32\\bin)
111 %> - extract the @c Doxyfile file from the @c doxygen.zip package and replace the
default Doxyfile provided by Doxygen
112 %> - extract the @c m2cpp.pl into a directory (
for example @c C:\\DoxygenMatlab)
113 %> - edit the Doxyfile file (or use the DoxyWizard tool provided by Doxygen) to modify a few settings :
114 %> - EXTENSION_MAPPING=.m=C++
115 %> - FILTER_PATTERN=*m=C:\\DoxygenMatlab\\m2cpp.pl
116 %> - PERL_PATH=\<path to your perl version\>
117 %> - INPUT=\<directory where your documented code is located\>
118 %> - OUTPUT_DIRECTORY=\<directory where you want to generate your documentation\>
119 %> - STRIP_FORM_PATH=\<directory where your documented code is located\>
121 %> @note For Windows users, in certain circumstances, the association
122 %> between .pl files and the perl executable is not well configured,
123 %> leading to
"Argument must contain filename -1 at C:\DoxygenMatlab\m2cpp.pl line 4" 124 %> when running doxygen. To work around
this issue, you should execute the following lines
125 %> in a Windows command prompt (
"cmd") :
127 %> assoc .pl=PerlScript
128 %> ftype PerlScript=C:\Program Files\MATLAB\R2010b\sys\perl\win32\bin\perl.exe %1 %*
130 %> (don
't forget to replace the path to the perl.exe file with yours in the line above) 135 %====================================================================== 136 %> @brief Brief description of the function 138 %> More detailed description. 140 %> @param arg1 First argument 141 %> @param arg2 Second argument 143 %> @retval out1 return value for the first output variable 144 %> @retval out2 return value for the second output variable 145 %====================================================================== 146 function [out1, out2] = test(arg1, arg2) Structure param contains data structures describing the physical parameters of the scattering center ...