python项目文档的自动生成
AutoMacDoc的Python项目详细描述
欢迎使用automacdoc
什么是automacdoc?
automacdoc是一个为python模块或组生成文档的工具 功能。它基于Python和MkDocs
为什么要做这个项目?
为python项目生成文档的最大工具是Sphinx。 不幸的是,sphinx(在我看来)很难设置,它支持restructuredtext。 没有一个好的项目可以轻松地生成带有降价的文档…直到现在!
如何安装?
使用pip pardi:pip install automacdoc
三个步骤让它发挥作用!
- 为类和函数编写漂亮的docstring。
- 创建一个init.py文件来导入所有要记录的函数。
- 生成文档网站
项目布局
mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
src/
__init__.py # File that list the functions and classes to documents
... # Other python files
推荐的文档字符串
deffun(arg1:int,arg2:str='Hello World!'):""" Description of your function **Parameters** > **arg1:** `int` -- Description of argument `arg1`. > **arg2:** `str` -- Description of argument `arg2`. **Returns** > `str` -- Description of returned object. """returnarg2+str(arg1)
生成文档
automacdoc /path/to/module path/to/folder
带有/path/to/project
文件的文件夹的路径,以及/path/to/project
将在其中创建docs
文件夹的项目的路径