Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
documentationGuidelines.m
Go to the documentation of this file.
1 %> @file documentationGuidelines.m
2 %> @brief Documentation guidelines to extract documentation using Doxygen
3 %======================================================================
4 %> @mainpage Documentation guidelines
5 %>
6 %> @section intro Introduction
7 %>
8 %> The @b doxygen software (http://www.doxygen.org) allows you to extract code comments
9 %> from your code to automatically generate documentation.
10 %>
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.
14 %>
15 %> @section matlabComments Extract code comments from Matlab files (.m files)
16 %>
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.
19 %>
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 :
34 %> @code
35 %> enumeration
36 %> first_enum
37 %> second_enum
38 %> end
39 %> @endcode
40 %> This one is not yet supported :
41 %> @code
42 %> enumeration
43 %> first_enum, second_enum
44 %> end
45 %> @endcode
46 %> The file classDocumentationExample.m provides an example of enumeration definition
47 %> with comments extracted by Doxygen.
48 %>
49 %> .
50 %>
51 %> See @ref installation if you want more details about how to make this script work.
52 %>
53 %> @attention Each line belonging to the doxygen documentation must begin with <b>%></b> .
54 %>
55 %> @par Example
56 %>
57 %>@code
58 %>% Matlab comment ignored by doxygen
59 %>%> comment analyzed by doxygen
60 %>@endcode
61 %> @attention Doxygen keyword have to begin by @b @, for example @@b to bold the text (the use of \ instead of @ is not supported)
62 %>
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.
66 %>
67 %> For function description, the description should follow the following presentation :
68 %>
69 %>@verbatim
70 %>% ======================================================================
71 %>%> @brief Brief description of the function
72 %>%>
73 %>%> More detailed description.
74 %>%>
75 %>%> @param arg1 First argument
76 %>%> @param arg2 Second argument
77 %>%>
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)
82 %> out1 = arg2;
83 %> out2 = arg1;
84 %>end
85 %>@endverbatim
86 %>
87 %>
88 %> @section classDecr Class description
89 %>
90 %> For class description, the following description can be used :
91 %>
92 %>@verbatim
93 %>% ======================================================================
94 %>%> @brief Brief description of the class
95 %>%>
96 %>%> More detailed description of the class
97 %>%>
98 %>% ======================================================================
99 %>@endverbatim
100 %>
101 %>
102 %> @page installation Installation details
103 %>
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.
107 %>
108 %> Installation :
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\>
120 %>
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") :
126 %> @code
127 %> assoc .pl=PerlScript
128 %> ftype PerlScript=C:\Program Files\MATLAB\R2010b\sys\perl\win32\bin\perl.exe %1 %*
129 %> @endcode
130 %> (don't forget to replace the path to the perl.exe file with yours in the line above)
131 %>
132 %>
133 %>
134 
135 %======================================================================
136 %> @brief Brief description of the function
137 %>
138 %> More detailed description.
139 %>
140 %> @param arg1 First argument
141 %> @param arg2 Second argument
142 %>
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)
147 end
Structure param contains data structures describing the physical parameters of the scattering center ...
Definition: structures.m:45