我试着用sphinx来记录我的主程序。我不知道如何使用autodoc
功能来利用literalinclude
的功能,包括start-after
和end-before
。有人知道如何使用autodoc吗?我只能用它来记录一个类或一个类模块。你知道吗
主.py[待记录]
#Label_BasicLibraries_Start
IGNORE:
This libraries are imported basic libraries.
IGNORE:
import time
import json
import urllib.parse
import random
from functools import reduce
import os.path
#Label_BasicLibraries_End
这是我目前使用的代码:
Title Example
=======================================================
This is beautiful code.
.. literalinclude:: Main.py
:language: python
:start-after: #Label_BasicLibraries_Start
:end-before: #Label_BasicLibraries_End
:linenos:
我可以用两种方法过滤整个程序。有没有办法排除从固定标记开始或在其他标记之间的特定行?像this example中的docstring?你知道吗
非常感谢你的帮助!你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐