Doxygen - 用于复制的通用块

时间:2018-02-18 01:37:24

标签: doxygen

doxygen(版本1.8.14)中是否有任何方法可以创建一个可以在代码文档/降价页面/等中重复的通用文本块。

我并不是指使用@copydoc复制某些类型的文本...这仅适用于“(类,文件或组)成员,类,命名空间,组,页面或文件“(根据documentation)。我有许多小文本片段,我想复制而无需直接复制/粘贴或创建页面(如果每个必须是他们自己的页面,我会有数百个“相关页面”)。

感谢任何帮助!

编辑例如: 我有需要的文本,我希望在表格和代码中复制和交叉引用。

我目前有:

定义(Markdown;如果可能的话,我想在单个文件中定义如下所示; @snippet似乎只适用于每个文本块的不同文件):

@section req_1 Requirement 1
My text.

@section req_2 Requirement 2
My other text.

Code Cross-ref(C header):

@details Linked requirement(s): @link req_1 Requirement 1. @endlink
void functionForReq1(void);

表交叉参考(降价); 在这里,我想直接粘贴需求文本,而不是使用复制/粘贴(“我的文本。”部分)复制它:

| Requirement ID           | Text     | Cross-Reference     |
| -----------------------: | :------- | :------------------ |
| @link req_1 [1] @endlink | My text. | ::functionForReq1() |

1 个答案:

答案 0 :(得分:0)

使用包含多个片段的片段文件和命令\ snippetdoc应该可以解决问题。

主文件(aa.md):

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /app_tests/

# Set an S for HTTPS protocol
# helps for rewrites with protocol specific URL
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.+)$ - [ENV=SFORSSL:%2]

# remove trailing slashes if it's not a directory
# you will need this, because if a trailing slash is added wrongly
# the condition for the next group of rules will fail
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ http%{ENV:SFORSSL}://%{HTTP_HOST}/$1 [R=301,QSA,L]

# internally rewrite to .php if a file exists
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.+) $1.php [QSA,L]
</IfModule>

包含代码段的文件(示例/ snippets.md):

Some md?
========

Some initial text

\snippetdoc snippets.md snip1

\n
Some more text

\snippetdoc snippets.md snip2

Doxyfile中的更改:

[snip1]
First snippet
<table>
<tr><th> Requirement ID           </th><th> Text     </th><th> Cross-Reference     </th></tr>
<tr><td> @link req_1 [1] @endlink </td><td> My text. </td><td> ::functionForReq1() </td><tr>
</table>
[snip1]

[snip2]
Second snippet
[snip2]