开发者

ReStructuredText numbered headers

Is there a way in rst to have automatic header numbering ? That is something like:

#. Some Section
===============
...
#. Some Subsection
---------------开发者_运维百科---
...
#. Another Subsection
---------------------
...
#. Another Section
==================
...

that would be rendered as:

1. Some Section

...

1.1 Some Subsection

...

1.2 Another Subsection

...

2. Another Section

...


According to the docutils manual, you can use the sectnum directive: http://docutils.sourceforge.net/0.7/docs/ref/rst/directives.html#automatic-section-numbering

So you can add something like this in the very first line(s):

.. sectnum::

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜