Search code examples
documentationmarkdowndoxygendocumentation-generation

How do I specify a Markdown file as another tab in Doxygen?


Consider a project that has the following two files. Note that OtherTab.md lives in a subdirectory.

README.md

# This is the main page.

Main Page contents.

wiki/OtherTab.md

# This is another tab

Contents for another tab.

Now, I run Doxygen -g to generate a Doxyfile. I add the following lines to the Doxyfile.

USE_MDFILE_AS_MAINPAGE = README.md
INPUT                  = . wiki

I would like to add a tab called Wiki next to the Main Page tab, which points at the file wiki/OtherTab.md.

How might I accomplish this?

I have looked this question, and this documentation, but neither addresses the question of how to actually create a new tab in Doxygen and point it at the html generated by processing a particular Markdown file.

Additionally, I have attempted to use this answer to my previous question, but was not sure what to put in the url attribute of the tab tag.


Solution

  • Appear some amount of experimentation, it appears that there is a standard transformation that is applied to the names of Markdown files.

    Thus, the following steps will create a new tab pointing at the Markdown file.

    1. Generate a layout file with doxygen -l.
    2. In the Doxyfile set LAYOUT_FILE = DoxygenLayout.xml.
    3. In the DoxygenLayout.xml file, add the following tab.

      <tab type="user" visible="yes" url="md_wiki_OtherTab.html"  title="Wiki"/>
      

    The standard filename transformation is md_{path_to_markdown_without_extension}.html.