English 中文(简体)
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

问题回答

暂无回答




相关问题
Sphinx, reStructuredText show/hide code snippets

I ve been documenting a software package using Sphinx and reStructuredText. Within my documents, there are some long code snippets. I want to be able to have them hidden as default, with a little "...

ReStructuredText numbered headers

Is there a way in rst to have automatic header numbering ? That is something like: #. Some Section =============== ... #. Some Subsection ------------------ ... #. Another Subsection -----------------...

What is a simple webpage compiler for restructured text?

Instead of a blog/cms, I d like to have a static html-based site with a few (rarely updated) pages. I figure the simplest way to update them is to keep the sources in a format like ReST, and compile ...

What markup language to store in a DB?

Related: How to store lightweight formatting (Textile, Markdown) in database? I want to store comment formatting in some markup language in our DB. However, we want to allow multiple formatting ...

External documentation for PHP, no DocBook

I need a documentation system for a PHP project and I wanted it to be able to integrate external documentation (use cases, project scope etc.) with the documentation generated from code comments. It ...

热门标签