Help on how to use the tools coming with mtoc++
Make sure you have followed the mtoc++ installation instructions.
As mtoc++
itself is only a filter to plug into doxygen, there is little sense in calling the binaries directly.
Thus, mtoc++ comes with a series of tools that take over the documentation generation process for different interfaces.
Those tools can be found inside the <mtoc++-source-dir>/tools
folder.
doxygen
, mtocpp
, mtocpp_post
or latex
. It is your responsibility to ensure the availability of the binaries in whatever environment you want to create the documentation. The most obvious way is to place all binaries inside a directory contained in your local PATH variable (both unix/windows). We've had reported issues with MAC users, that dont have the environment set when launching MatLab from the Dock. See Troubleshooting mtoc++ for more information.The most convenient way of using mtoc++ within your matlab project is to use the MatlabDocMaker class coming with mtoc++. The MatlabDocMaker is a MatLab native class that can be directly used from within MatLab in order to create the project documentation.
Follow these simple steps in order to quickly get your first documentation:
<mtoc++-source-dir>/tools/config
folder into e.g. a subfolder of your MatLab projectSee the MatlabDocMaker class description for more details on how to use it.
Okay, so you're a crack and want to control everything. That's fine with us! In this case we also assume you're familiar with whatever your operating environment is and you have solid knowledge of what's going on. First, you could simply reverse-engineer what the MatlabDocMaker is doing (it automatically generates and inserts the correct scripts read by doxygen), otherwise, here are the basic steps required to get started with mtoc++ directly. In short, this happens by including mtoc++ as a filter for *.m files:
doxygen
configuration file:doxygen
parse Matlab filesmtocpp_post
passing the folder containing your HTML output as argumenttools/
directory and inserting proper values for all the placeholders we're using. Everything related to mtoc++ has been put to the very bottom of the file, most critically: EXTENSION_MAPPING
tells doxygen to regard
.m-Files as if they were C++
files, style-wise.INPUT
tells doxygen where to look for files.FILE_PATTERNS
lets doxygen also look for
.m-Files.FILTER_PATTERNS
is the most important line of the configuration. Here, you need to define scripts that should be called by doxygen before certain files are processed.As the configuration of doxygen/mtoc++ is independent from the actual tool used we will explain it separately. The involved files can again be found inside the /tools/config
folder.
Doxyfile.template
- Configuration options for doxygenmtocpp.conf
- Configuration options for the mtoc++ filterlatexextras.template
- Extending default LaTeX environment for doxygenclass_substitutes.c
- Fake classes for typical MatLab data types/tools/config
folder are a default configuration for Doxygen which we thought might be useful in a MatLab setting/project and contains some changes in order to make mtoc++ run together with doxygen. We've had lots of feedback and problem reports which actually had to do with settings purely regarding doxygen, so we strongly recommend having a look through Configuration options for doxygen and the references therein before contacting us. Thanks!The Doxyfile.template
file uses placeholders for specific folders etc. and contains any other configuration settings you want doxygen to use. This way, the configuration files can be included into the versioning system as local developers paths are stored outside the configuration file and are provided by the different tools coming with mtoc++.
See http://www.stack.nl/~dimitri/doxygen/config.html for more information on doxygen configuration.
The file mtocpp.conf
contains additional configuration for the mtoc++ parser.
mtocpp
binary for the manual config case). Otherwise, if you want to provide a config file to mtoc++, depending on your platform, you have to write a shell/batch script that is included as filter callback in doxygen's configuration file. Inside the script, the first argument is forwarded to mtocpp
and the second configuration file path is provided statically in the script.The following is a short list of options that can be specified in the configuration file for the mtoc++ filter. All options are declared by the syntax
and are optional, as the default values are hardcoded into mtoc++.
ALL
- File PatternsPRINT_FIELDS
- Flag indicating whether automatic struct fields or object member documentation is generated. Default true
.AUTO_ADD_FIELDS
- Flag indicating whether undocumented field names are added to documentation. Default false
.AUTO_ADD_PARAMETERS
- Flag indicating whether undocumented parameters and return values are added to documentation with documentation text equal to the parameter / return value name. Default false.AUTO_ADD_CLASS_PROPERTIES
- Flag indicating whether undocumented member variables are added to documentation with documentation text equal to the parameter / return value name. Default false.true
.true
.true
.false
. PRINT_RETURN_VALUE_NAME - Integer flag indicating whether return value names shall be printed in the function synopsis. If this flag is deactivated only the type names are written. The flag can be set to either 0, 1 or 2 and has default value 2
:Moreover, default descriptions/values for recurring entries like parameters or field names can be specified.
So for example,
would cause mtoc++ to add the description "param 1 description" to any parameter called param1
of a method/function inside the file myfile.m
.
See the file itself for more detailed configuration options and examples.
The latexextras.template
file is processed and included into the latex environment available to doxygen during the documentation creation. Insert here any commands or packages that you want latex to know for your documentation formulas.
The default packages that are included by the latexextras.template
are
The file class_substitutes.c
includes some class descriptions for typical MatLab data types like handle or logical, but also introduces custom types like colvec or rowvec that can be used with the @type tag for property, parameter or return value types.
Add new classes to this file or change existing ones as you need.