7 % - \c mtocpp, \c mtocpp_post on the search/environment paths
8 % - \c m4: A macro parser [Unix only]
10 % @author Daniel Wirtz @date 2011-10-13
12 % @change{1,2,dw,2011-11-08} Improved the createUnix method by displaying the warnings and writing the output to
13 % a log file afterwards. Not
using cprintf anymore as
this is 3rd party software.
15 % @change{1,2,dw,2011-11-07} Fixed a recursion bug caused by copy and paste. Now the preferences
16 % are stored on an per-application basis.
19 % order to export it into the mtoc++ distribution later.
21 % @
new{1,2,dw,2011-10-13} Added
this class and moved documentation related
22 % stuff here from the KerMor
class.
24 % This
class is part of the mtoc++ tool
29 function name = getProjectName
30 % Returns the project name.
32 % @note Changing the return value of this method will require
34 % key also depends on it.
37 % name: The project name
41 function version = getProjectVersion
42 % Returns the current version of the project.
44 % @note The built-in @@new and @@change tags from the
45 % Doxyfile.m4 support two-level versioning a la X.X.
48 % version: The project version
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54 %% End of user defined methods.
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 methods(Static, Sealed)
58 % The KerMor documentation directory, i.e. where createDocs places
59 % the generated documentation.
61 % Can be set during Documentation.setup
64 function dir = getOutputDirectory
65 % Returns the directory where the applications source files
69 % dir: The output directory @type
char
76 function dir = getSourceDirectory
77 % Returns the directory where the applications source files
81 % dir: The project source directory @type
char
88 function dir = getConfigDirectory
89 % Returns the directory where the applications documentation
90 % configuration files reside
92 % This folder must contain at least the files "mtoc.conf" and
96 % dir: The documentation configuration directory @type
char
103 function bin = getDoxygenBin
104 % Allows access to a custom
doxygen binary.
107 % bin: The fully qualified path to a custom
doxygen executable @type
char
110 % If no preference is set, expect the
doxygen binary to be
111 % included in the local path.
113 bin = 'LD_LIBRARY_PATH=
doxygen';
121 % Opens the generated documentation.
125 function create(open)
126 % Creates the Doxygen documentation
129 % open: Set to true if the documentation should be opened after
130 % successful compilation @type
bool @default false
136 % Save current working dir and change into the KerMor home
137 % directory; only from there all classes and packages are
141 %% Operation-system dependent actions
149 %% Open index.html if wanted
157 % necessary paths in order for the documentation creation to
161 error('Please set/write the code for the getProjectName and getProjectVersion methods first!');
172 str = sprintf('Do you want to %s %s as your projects source directory?\n(Y)es/(N)o?: ',word,srcdir);
173 ds = lower(input(str,'s'));
175 d = uigetdir(srcdir,'Please select the projects source directory');
177 error('No source directory specified. Aborting setup.');
187 confdir = fullfile(srcdir,'documentation');
190 str = sprintf('Do you want to %s %s as your documentation configuration files directory?\n(Y)es/(N)o?: ',word,confdir);
191 ds = lower(input(str,'s'));
193 d = uigetdir(confdir,'Please select the documentation configuration directory');
195 error('No documentation configuration directory specified. Aborting setup.');
208 str = sprintf('Do you want to %s %s as your documentation output directory?\n(Y)es/(N)o?: ',word,outdir);
209 ds = lower(input(str,'s'));
211 d = uigetdir(outdir,'Please select the documentation output directory');
213 error('No documentation output directory specified. Aborting setup.');
221 word = sprintf('Do you want to choose a different doxygen binary than %s?\n(Y)es/(N)o?: ',doxybin);
223 [st, doxybin] = system('which doxybin');
225 word = sprintf('Doxygen found at %s. Do you want to specify a custom doxygen binary?\n(Y)es/(N)o?: ',doxybin);
227 word = sprintf('No doxygen executable found. Please type "y" to manually select a doxygen binary. ');
230 ds = lower(input(word,'s'));
232 d = uigetfile(pwd,'Please select a doxygen binary');
234 error('No doxygen binary specified. Aborting setup.');
240 fprintf('<<<<
MatlabDocMaker setup successful. >>>>\nYou can now create your projects documentation by running
MatlabDocMaker.create\n');
244 methods(Static, Access=private)
246 function value = getProjPrefTag
248 value = ['MTOCPP_' str(regexp(str,'[a-zA-z]'))];
252 % Creates the KerMor documentation on UNIX platforms.
255 % Create "configured" binary
256 cbin = fullfile(cdir,'mtocpp_filter.sh');
258 fprintf(f,'
#!/bin/bash\nmtocpp $1 %s',fullfile(cdir,'mtocpp.conf'));
260 unix([
'chmod +x ' cbin]);
262 % Process macros in the Doxyfile.m4 file
using m4
263 system(sprintf(
'm4 -D _OutputDir_="%s" -D _SourceDir_="%s" -D _ConfDir_="%s" -D _ProjectName_="%s" -D _ProjectVersion_="%s" "%s/Doxyfile.m4" > "%s/Doxyfile"',...
267 tex = fullfile(cdir,
'latexextras.m4');
268 if exist(tex,
'file') == 2
269 % # Parse the kermorlatex include style file
270 system(sprintf(
'm4 -D _ConfDir_="%s" "%s" > "%s/latexextras.sty"',...
274 system(sprintf(
'touch %s/latexextras.sty',cdir));
279 fprintf(
'Running doxygen (%s) with mtoc++ filter...\n',b);
280 [dummy,warn] = system(sprintf(
'%s %s/Doxyfile 1>/dev/null',b, cdir));
283 fprintf(
'Running mtoc++ postprocessor...\n');
288 delete(fullfile(cdir,
'latexextras.sty'));
289 delete(fullfile(cdir,
'Doxyfile'));
292 fprintf([
'Warnings generated during documentation creation:\n' strrep(warn,
'\',
'\\')
'\n']);
293 % Write to log file later
295 f = fopen(log,
'w'); fprintf(f,
'%s',warn); fclose(f);
296 fprintf(
'Log file at %s.\nMatlabDocMaker finished.\n',log);
299 function createWindows
300 % Creates the documentation on a windows platform.
302 % Currently not implemented.
303 error(
'Creating documentation on Windows is not yet implemented.');
Tools for post-processing data, i.e. data extraction and visual enhancements for publication.
static function name = getProjectName()
Returns the project name.
static function char dir = getSourceDirectory()
Returns the directory where the applications source files reside.
static function version = getProjectVersion()
Returns the current version of the project.
MatlabDocMaker: Class for information & tasks concerning the UQ-RB-Test documentation.
static function char dir = getOutputDirectory()
Returns the directory where the applications source files reside.
Test reduced basis implementation.
static function char bin = getDoxygenBin()
Allows access to a custom doxygen binary.
function rv = doxygen(param1, param2)
Here comes a short description text.