您的位置:首页 > 其它

Doxygen使用学习(二)------Doxygen的内部支持的markdown语法

2016-08-12 12:53 357 查看

Doxygen
的内部支持的
markdown
语法

段落

markdown
本身的语法没有段落一说,因此需要分段的地方多空一行,就可以表示段落,例如:(普通的
markdown
还支持段落尾空两格代表分段,但是
Doxygen
不支持!)

Here is text for one paragraph.

We continue with more text in another paragraph.


这样出来的效果就分段落了。

标题

跟普通的
markdown
一样,标题可以在下面插入
-
或者
=
来实现二级标题和一级标题,当然其数量只要大于两个,多少都行,例如:

This is a level 1 header
====================

This is a level 2 header
-------


另外,标题也可以使用
#
来得到,使用的
#
的数目是多少就代表多少级标题,例如:

# This is a level 1 header

### This is level 3 header #######


块引用

通过在代码注释的开头加入一个或多个
>
符号进行

> This is a block quote
> spanning multiple lines


列表

为了让注释显示列表,可以使用
-, +,*
,例如:

- Item 1

More text for this item.

- Item 2
+ nested list item.
+ another nested item.
- Item 3


列表项目可以跨越多段,同时列表也支持嵌套,也可以使用数字列表,例如:

1. First item.
2. Second item.


代码块

代码块可以通过开头空四个空格来实现,例如:

This a normal paragraph

This is a code block

We continue with a normal paragraph again.


也可以使用三个或以上`符号或者三个\~符号然后后面跟着代码的语言,例如:

~~~~~~~~~~~~~~{C++}

~~~~~~~~~{.py}

A class

class Dummy:

pass

~~~~~~~~~

或者

~~~~~~~~~~~{.c}

int func(int a,int b) { return a*b; }

~~~~~~~~~~~

或者

also a fenced code block


~~~~~~~~~~~~~~

强调

使用一个
*
或者
_
代表斜体强调,使用两个
*
或者
_
则代表加重强调,例如:

single asterisks*

_single underscores_

double asterisks**

__double underscores__


注意:与标准
markdown
不同,
doxygen
无法处理内部的
_
*
因此向
a_nice_identifier
这样的句子就无法使得
nice
变成斜体强调。此外,
_
*
的强调开始必须是一个字母数字字符,否则(比如汉字),必须在其开头加上一个空格、换行或者下面的字符
<{([,:;
。结尾也必须满足这个规则!同时,强调的跨度限制在单独的段落

代码段

代码段需要包含在字符”`”之间,比如:

Use the `printf()` function.


为了在内部使用字面上撇符号,需要使用两个上撇符号,例如:

To assign the output of command `ls` to `var` use ``var=`ls```.


链接

Doxygen
支持内部链接和引用链接

1 内部链接

内部链接由一个链接文本(用方括号括起来)和一个统一资源定位符(用小括号括起来)和一个可选的字符串(链接提示符)组成,例如:

[The link text](http://example.net/)
[The link text](http://example.net/ "Link title")
[The link text](/relative/path/to/index.html "Link title")
[The link text](somefile.html)


此外,还提供一种方法来访问文档中的内容,例如:

[The link text](@ref MyClass)


2 引用链接

除了使用统一资源定位符,还可以自己定义一个链接,然后在文本内部引用,定义方式如下:

[link name]: http://www.example.com "Optional title"


定义好后可以向下面这样使用链接:

[link text][link name]


如果链接文本和名字相同,则可以简写成:

[link name][]
甚至写成
[link name]


注意:链接匹配大小写不敏感,例如:

I get 10 times more traffic from [Google] than from
[Yahoo] or [MSN].

[google]: http://google.com/        "Google"
[yahoo]:  http://search.yahoo.com/  "Yahoo Search"
[msn]:    http://search.msn.com/    "MSN Search"


图片

图片链接和链接一样,不同之处是开头多了一个
!
,例如:

![Caption text](@ref image.png)
![img def]

[img def]: @ref image.png "Caption text"


表格

表格可以使用
|
符号产生,例如:

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell


| Right | Center | Left  |
| ----: | :----: | :---- |
| 10    | 10     | 10    |
| 1000  | 1000   | 1000  |


以上就是
Doxygen
支持的
markdown
语法。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  文档
相关文章推荐