Changing Message Sequence Chart (MSC) Tool for Doxygen - charts

I'd like to know whether there is a way to change the default tool to generate message sequence charts (msc) of Doxygen. Actual default tool for Doxygen is the mscgen (http://www.mcternan.me.uk/mscgen/) and it's a good tool, but I'd like to use msc-gen (https://sites.google.com/site/mscgen2393/) that seems to be a more complete tool.
I've already tried to create a link at "MSCGEN_PATH = /usr/bin/" to the msc-gen (like ln -s /usr/bin/msc-gen ./mscgen) but command line of tools are different. There is a specific way to configure Doxygen to "learn" this new tool command line?

For the current msc-gen version (v4.0.0), your solution should work.
I just tried setting the MSCGEN_PATH to the msc-gen installation directory and it worked for me. msc-gen already brings a copy of its main executable with the name mscgen.exe to be called by doxygen.
This solution is also described in the second paragraph of:
http://msc-generator.sourceforge.net/help/4.0/
You may also like to have a look at Plant UML and its doxygen integration:
http://plantuml.com/index.html
http://plantuml.com/doxygen.html

Related

using Doxygen in read-the-docs

I have written the documentation for a medium sized C++ piece of software using Doxygen together with Markdown. I am quite happy with it, as after changing the xml layer I ended up with something like that:
http://docs.mitk.org/nightly/index.html
I would like to bring this documentation online, ideally using something like ReadtheDocs, where the documentation would be automatically built after a "git commit", and hosted to be browsed.
ReadtheDocs looks like the ideal site but uses Sphinx and reStructuredText as defaults. Doxygen can be used too, but AFAIK only through Breathe. Going through that route essentially means that I would need to re-structure all the documentation if I don't want to dump all the API documentation into a single page (http://librelist.com/browser//breathe/2011/8/6/fwd-guidance-for-usage-breathe-with-existing-doxygen-set-up-on-a-large-project/#cab3f36b1e4bb2294e2507acad71775f).
Paradoxically, Doxygen is installed in the read-the-docs server, but after struggling I could not find a workaround to skip its Sphinx or Mkdocs.
I've tried the following solution to use Doxygen on Read The Docs and it seems to work:
set up empty sphinx project (refer to official sphinx doc),
in sphinx conf.py add command to build doxygen documentation,
use conf.py html_extra_path config directive to overwrite generated doxygen documentation over generated sphinx documentation.
I've tested this with following source tree:
.../doc/Doxyfile
/build/html
/sphinx/conf.py
/sphinx/index.rst
/sphinx/...
Some explanation:
in my setup doxygen generates its documentation in "doc/build/html",
ReadTheDocs runs its commands in directory where it finds conf.py file.
What to do:
add following lines in conf.py to generate doxygen docs:
import subprocess
subprocess.call('cd .. ; doxygen', shell=True)
update conf.py html_extra_path directive to:
html_extra_path = ['../build/html']
In this configuration ReadTheDocs should properly generate and store Doxygen html documentation.
todo:
other documentation formats, for example: pdf.
This answer builds upon the great one already given by "kzeslaf". So follow the steps described by him first, before you continue here.
While his answer works as intended, I had the problem that ReadTheDocs (RTD) uses a rather old version of Doxygen (1.8.13 at the time of writing). This caused several issues for me like the one reported here. Additionally, if you set up Doxygen to treat warnings as errors, you might need to override this option on RTD due to version-related warnings.
I found a simple solution to upgrade the Doxygen version on RTD using conda.
Create an environment.yml file somewhere in your project (probably in the documentation directory). The content is as follows:
name: RTD
channels:
- conda-forge
- defaults
dependencies:
- python=3.8
- doxygen=<VERSION>
Replace <VERSION> with any version number that you like to use and that is available on conda-forge. Use conda search doxygen -c conda-forge to get a list of all available versions or simply check this site. You can also remove =<VERSION> and conda should install the latest one automatically.
Now you need to create an RTD config file if you haven't done this already. Add the following lines:
conda:
environment: <DIRECTORY>/environment.yml
Replace <DIRECTORY> with the actual location of the environment.yml file (relative to your project root, for example: docs/environment.yml). Now, if you followed all the steps in the answer of "kzelaf" and the ones I mentioned, RTD should successfully build your Doxygen documentation with the version you selected. You can check it in the lower right corner of the created pages. Alternatively, add subprocess.run(["doxygen", "-v"]) to your conf.py and check the RTD build logs.

Netbeans, phpdocumentor, and custom phpdoc.dist.xml by project

I am using Netbeans 8.0.2 and phpdocumentor 2.8.2 on a windows 7 platform.
I would like to use custom phpdoc.dist.xml config files by project so I can specify framework directories and etc. to exclude from the generated doc. I also want to keep my Netbeans PHPDOC plugin config as generic as possible, without specific output directories, ignore options, config path parameters, etc., so on, so that that the config will apply to all my projects.
The phpdoc.dist.xml file works great. The doc generated is exactly what I want.
The problem or feature, and it seems to be a phpdocumentor one as it also applies from plain command line, is that the phpdoc.bat command (without a specific config parm) has to be run from the same root directory as the phpdoc.dist.xml file, or it ignores it. No problem if I'm using command line as I can change into that directory first, but I would like to use Netbeans. I have searched on this extensively and cannot find an answer.
I considered whether to modify the phpdocumentor files to insert cd /D path/to/myproject/dir to change the directory using some Netbeans variable to represent myproject/dir, but I could not find the right place in the code or the variable to use. Plus, then I'm supporting a custom mod to phpdocumentor.
I did find these directions for a PHPStorm setup, where the author specified a PHPStorm variable for the --config command line option to point to his custom phpdoc.dist.xml.
--config="$ProjectFileDir$/phpdoc.dist.xml"
If I could do the same in Netbeans like maybe "${BASE_DIR}/phpdoc.dist.xml" it would be great, but so far I haven't hit on anything Netbeans will recognize/pay attention to in the PhpDoc script: box.
I have also tried writing a wrapper .bat file to capture my own command line variable %1 and do the directory change to that before calling phpdoc.bat, but Netbeans throws and error and says that's not a valid .bat file. I cannot find any phpdocumentor parameter to configure by specific Netbeans project but the output directory. And I would prefer not to be defining a bunch of projects on subdirectories in Netbeans, just to address phpdocumentor.
Now I am out of ideas. Can anyone point me to a solution?

error using doxygen and graphViz: problems opening map file

I'm using Doxygen-1.8.7, which i have downloaded from official website in dmg version. I'm using 10.9.3 MacOS. I have installed graphviz 2.38.0.0 via macports.
I use Doxygen GUI to configure it and run. Everything works great, if i choose "use build-in diagram generator". But when i use dot tool, i get this:
error: problems opening map file
/Users/pavelantonov/qtProjects/doxygen/result/11-06
1207/html/inherit_graph_21.map for inclusion in the docs!
I've tried to change SHORT_NAMES and FULL_PATH_NAMES as i find in solution from 2008, but it doesn't help.
GraphViz/bin is in paths.
There are no white spaces in *.dot names.
I got this message 'problem opening map file for inclusion in the docs', if doxygen is not able to find graphviz/dot in the path.
Try setting the path explicitly using DOT_PATH in the doxyfile.
As albert, already mentioned remove any whitespace in the path to the output path.
Another good idea is to completely remove your output directory, e.g. html, and regenerate your documentation.
It also seems that doxygen is for activating dot.exe space sensitive. Make sure your path is like this or at least without whitespaces:
D:/Graphviz2.38/bin
based on experience of Graphviz 2.38 on windows 10
The following method worked for me on Windows 10 with Doxygen 1.8.14.
Open cmd and type dot -c. Then, delete the doxygen output folder and regenerate it.
Make sure you have graphviz in your path. My graphviz is installed at C:\Program Files\Graphviz 2.44.1. So, there is no problem, even if spaces are there.

Run Doxygen only on select files / modules?

Recently I started writing some doxygen docs in an existing project which already has quite a lot of doxygen comments.
Since I'm learning a bit - I like to iterate with making edits and generating docs, since doc generation is quite slow - 3-5min. This becomes un-workable.
I managed by deleting most of the files in the source tree so doxy only found the ones I was editing but this is really a horrible solution and not something I'd want to do frequently.
Is there a way (command line arg or env variable for eg) - to limit which files/modules are used for generating docs - so rebuilding docs can be done much faster?
Yes, you can customize Doxygen's behavior from either the command-line or via environment variables. For example, if you only want to include one file (include/somefile.h), you could execute Doxygen like:
( cat Doxyfile ; echo "INPUT=include/somefile.h" ) | doxygen -
see the Doxygen FAQ's "Can I configure doxygen from the command line?" for more details on customizing behavior from the command line.
Alternatively, if you want to use environment variables, you could use specify something like the following in your configuration file:
INPUT = $(FILE)
Doxygen performs environment variable substitution on its configuration files, allowing you to specify which file(s) should be acted on using:
export FILE=include/somefile.h
doxygen Doxyfile
See Doxygen Configuration for details on using environment variables in configuration files.

How to generate phpDoc documentation for a specific folder in Netbeans IDE?

Due to the fact that we need to integrate the Zend Framework on our project root, and that generating that documentation will be useless and take long time, I would like to generate documentation for all files inside application folder only.
Does anyone know how I can generate documentation for a specific project folder, trough Netbeans 7.0 interface?
Update:
The best I've found so far was to:
Open the terminal window from netbeans, and type:
sudo phpdoc -d public_html/yoursite.dev/application/ -t public_html/yoursite.dev/docs/
Update 2
Let's suppose our Zend library is inside projectrootname/library/Zend we also can try, by going to: Tools > Options > Php > PhpDoc and place the following:
/usr/bin/phpdoc -i library/Zend/ -o HTML:frames:earthli
At least for me, that doesn't seem to work, because, when I try to generate the documentation, I get permission error issues displayed on the output window.
Thanks
The -d/--directory option [1] should be used to highlight the most high-level code directory that you want phpDocumentor to start reading from. If your Zend folder is at or above the level of your application directory, then just using --directory /path/to/application should help you document only your application code.
If your Zend folder is somewhere inside your application (e.g. in your app's ./lib folder), then you can use the -i/--ignore option [2] to tell phpDocumentor about any directories that it will see but should ignore, --ignore *zend*. Just be aware that formatting your ignore value can be tricky, so see the examples in the manual. Also, be aware that as phpDocumentor runs, you will see these ignored folders and files being listed in the output... phpDocumentor "ignores" them by not generating docs for those files. It does, however, still need to parse them, in case those objects are referenced in files that do get documented.
[1] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.directory
[2] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore