【发布时间】:2013-08-09 11:54:57
【问题描述】:
对于使用 reStructuredText 编写并使用 Sphinx 呈现为 HTML 的编程语言文档项目,我想将我的函数分组为逻辑组,例如:String(所有字符串函数)、Web(所有与 Web 相关的函数)、List(任何处理列表)等等。现在,由于函数可以是多个组的成员,我想以某种方式添加标签,就像您在博客文章中一样。
如果有一个 Sphinx 扩展(或例如使用域的方式)来添加标签,然后为每个标签生成一个引用所有这些功能的页面,所有标签的概述和交叉引用,那就太好了每个功能页面的底部。这是否可行,如果可行,如何实现?
例子:
substring
=========
**substring (**\ *<string,number>* **text,** *number* **start,** *number* **end*)**
Description
-----------
Returns the substring of string ``text``
between integer positions ``start`` and position ``end``.
The first character in the string is numbered 0.
The last character returned by ``substring`` is the character before position ``end``.
Optionally ``end`` can be left out, which means
the returned string will end at the last position of ``text``.
Example
-------
Executing the following code:
::
log(substring("Welcome to our site!", 0, 7));
log(substring("Welcome to our site!", 0));
will print:
::
Welcome
Welcome to our site!
Tags
----
String
【问题讨论】:
标签: python python-sphinx restructuredtext