2
votes

I have a set of markdown pages that I use for documenting my code in a table setup and use @subpage to place those pages under the table page.

Table.md

Code Table
==========

| Name            | Description |
|-----------------|-------------|
| @subpage index0 |             |
| @subpage index1 |             |
| @subpage index2 |             |
| @subpage index3 |             |

Subpage0.md

000 - Table Element {#index0}
===================

Etc for the other pages

Then in the documentation output from doxygen the @subpage references would be replaced with the page text title, i.e. '000 - Table Element'. Also, the file link would be subpaged under the Code Table link in the navigation gutter.

My issue, is now i want to take these same files but add conditionals based on the code i am building. Here is how i changed one of the files.

@if BUILD_A
000 - Table Element {#index0}
===================
@elseif BUILD_B
000 - New Table Element {#index0}
===================
@endif

My doxygen preprocessing and enabled sections are all setup correctly and that it outputs the correct text i want, the issue is that the navigation gutter no longer subpages those pages that have this type of conditional setup and the actual pages don't use the link title for the page title but rather use the file name as the title.

Is markdown too limited currently with doxygen and I have to use dox pages or is setup not possible with what i want?

1
That's a good question (+1). I've also experienced a number of this sort of issue with a mix of doxygen and markdown, in particular with markdown and conditional-switched text not being seamlessly handled. Generally I've tried various ways of restructuring the few caes I've needed something like this, until something worked. I suspect this may be "markdown too limited with doxygen" but I await answers with interest. - Cheeseminer

1 Answers

0
votes

You might want to move the conditional around the subpaging inside the table:

| Name | Description |
|------|-------------|
| @if BUILD_A @subpage index0_A @elseif BUILD_B @subpage index0_B @endif | ... |
| ... | ... |

Downside of this approach: You'll need to have two separate files for the index0 page: Subpage0_A.md and Subpage0_B.md.

Yes, this is still ugly and not as nice as the optimal solution you are looking for.