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

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语法。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值