3
votes

I have Graphviz file "foo.dot" holding the diagram I'd like to render inside a markdown "bar.md" with doxygen.

Knowing that:

  • Doxygen support markdown (I address the case of a separated markdown .md file);
  • Doxygen support Graphviz .dot files with the instruction in the source (.cpp or else).

Is it possible to do the same in a markdown rendered by doxygen (without resorting to distant service like gravizo for exemple)?

I'd like to do this to benefit from the assets of .dot diagrams and markdown together with doxygen.

2
Where have you seen that doxygen supports .dot files? To the best of my knowledge doxygen does not support .dot files directly, it supports images and inside doxygen .dot files are generated and converted to images, so you should convert your .dot file to an image and include this in the markdown code.albert
I was thinking of the command \dotfile myDiagram.dot link , and in this case, doxygen is able to call Graphviz (which is in the PATH) to convert the .dot to an image. I was hopping that in markdown file read by doxygen we could do the same with a similar command... If not possible, indeed, I will a to convert it by my self.Rafael Catrou
Oops, I forgot completely about this command and its friends, can't you use \dotfile inside your .md file I think it should do the conversion,albert
Ok I'll do the conversion then. Thanks ;)Rafael Catrou
I don't think you have to do the conversion of the .dot file when using \dotfilealbert

2 Answers

4
votes

I think you have to set

HAVE_DOT = YES

in your doxygen configuration file. See comment from standard doxyfile:

# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
# Bell Labs. The other options in this section have no effect if this option is
# set to NO
# The default value is: NO.

HAVE_DOT               = NO

Furthermore you might also have a look at the DOTFILE_DIRS value:

# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the \dotfile
# command).
# This tag requires that the tag HAVE_DOT is set to YES.

DOTFILE_DIRS           = 

If you set these values correctly, I think your posted \dotfile myDiagram.dot command should work.

1
votes

This also supports files of type *.gv, which are basically the same as *.dot files (no difference in contents) but may be easier to handle if you have MS Word installed and the *.dot file type is associated with Word template files.