24

I know that it is possible to use markdown inside comments and doxygen can understand it. But I need to know if it is possible to generate the documentation in markdown format?

I need these documentation to be generated from C++ files.

Sudar
  • 18,954
  • 30
  • 85
  • 131
  • 1
    I guess using the raw XML output you can probably write your own markdown conversion module. But I'm pretty sure (even if not 100%) direct markdown output is not possible, yet. – Christian Rau Oct 26 '12 at 06:47

3 Answers3

9

I know this question is old but there seems to be a new tool available: https://www.npmjs.com/package/doxygen2md

bonanza
  • 280
  • 3
  • 11
  • Thanks. This looks like a good way to solve the issue that I was having. – Sudar Oct 02 '16 at 00:42
  • 1
    [moxygen](https://github.com/sourcey/moxygen/) is quite similar to this as well. – Amir Mar 13 '19 at 01:21
  • Unfortunately both are earlystage projects – Pierrot Jan 07 '21 at 12:53
  • Nothing against the answer and comments, thanks for the links! However, IMHO and YMMV, but don't waste time with either `moxygen` or `doxygen2md` options, they're both "nice try" but failures (figuratively and mostly literally). Maybe for some very very simple code, with no namespaces... or private members... The former, while newer and with more features, doesn't even bother crediting the latter as the obvious origin, except in the license and copyright notices. Check the Issues list first if you're going to try it. – Maxim Paperno Jun 18 '22 at 18:36
5

I don't know of anything that will do it directly, but doxygen has the ability to output an XML document using the XML generator.

There are various projects out there that can then consume said XML data to transform it, one of the simplest ones that I am aware of is Breathe which is used to convert the XML documents to something that Sphinx can use to output documentation using doxygen as a pre-processor so to say.

The code for Breathe may be simple enough to use as a starting point to then generate Markdown files instead of the ReStructuredText files that Sphinx requires. I haven't looked at the code for Breathe, but I have used it for some major projects.

albert
  • 8,285
  • 3
  • 19
  • 32
X-Istence
  • 16,324
  • 6
  • 57
  • 74
  • Breathe inserts content directly into the Sphinx/docutils tree structure as the Sphinx files are parsed. Intermediate ReStructuredText files are never created in the process. – Charles Ward Jul 05 '17 at 20:03
1

Generate XML with doxygen http://www.doxygen.nl/manual/customize.html#xmlgenerator.

Use PanDoc http://pandoc.org/ to convert XML to Markdown.

albert
  • 8,285
  • 3
  • 19
  • 32
mkuse
  • 2,250
  • 4
  • 32
  • 61