markdowndoxygen

How to generate markdown documentation from c++ project?


I am trying to create a documentation for a complex c++ project.

To do so, i started using Doxygen, which is appropriate for my usage because i just have to comment the headers of my project to get a full documentation in HTML. This documentation in is perfectly working and has a good style.

But here is my problem I want to get this documentation in a Markdown file to be able to push it on Gitlab.

I tried to use moxygen to convert the xml files to a md file. It works but not as properly as I want: the anchors generated automatically by moxygen are not working. The presentation is also a problem for example it puts the definition list on the top of the file which is very long and not the most useful in the documentation.

I would like to know then if there is a way to document my code as simply as using Doxygen but getting a proper markdown file ( anchors working and better template) .

I know the markdown syntax is simple but i can't write the whole markdown by myself because the project is big and is going to be updated often so i need a generic method to get documentation in markdown from a C++ project.


Solution

  • I ran into a similar problem some time ago, and it was not easy to solve. Basically what I did is to convert the documentation to LaTeX, and from there, to markdown. Check this to the LaTeX->Markdown passage (other tools existe as well).

    You can automate the process using make/latexmke to some point, but I personally have not been able to make the process easy and I still need to step in sometimes. Also note that you might need to use other tools, like flex, to make your LaTeX document into one big tex file. Some conversion programs do not accept split tex files.

    This is not perfect, but it might give you another angle at this. Hope it helps.