Search code examples
markdowndoxygengraphviz

Doxygen Markdown : How to include and render a .dot GraphViz file


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.


Solution

  • 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.