简体   繁体   English

Doxygen条件降价页面

[英]Doxygen Conditional Markdown Pages

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. 我有一组markdown页面,用于在表设置中记录代码,并使用@subpage将这些页面放在表页面下。

Table.md 表.md

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

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

Subpage0.md 子页面0.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, ie '000 - Table Element'. 然后在doxygen的文档输出中, @subpage引用将替换为页面文本标题,即'000-Table Element'。 Also, the file link would be subpaged under the Code Table link in the navigation gutter. 同样,文件链接将在导航装订线中的Code Table链接下分页。

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. 我的doxygen预处理和启用的部分都正确设置了,并且输出了我想要的正确文本,问题是导航装订线不再为那些具有这种条件设置类型的页面子页面,而实际页面不使用链接标题作为页面标题,而是使用文件名作为标题。

Is markdown too limited currently with doxygen and I have to use dox pages or is setup not possible with what i want? doxygen目前的markdown是否太受限制,我必须使用dox页面,或者我想要的设置无法实现吗?

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 . 这种方法的缺点: index0页面需要有两个单独的文件: Subpage0_A.mdSubpage0_B.md

Yes, this is still ugly and not as nice as the optimal solution you are looking for. 是的,这仍然很丑陋,不如您要寻找的最佳解决方案好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM