自动生成文档页面
gendocs的Python项目详细描述
这是一个python包,用于自动构建 使用sphinx记录给定的python包。 gendocs允许用户将其所有文档直接保存在 包作为页面直接从代码中的docstring生成!
连接
想看看例子吗?签出以下使用gendocs的项目之一:
- PVGeo:在vtk和paraview中可视化地球物理数据的python包
- ESPA Tools:一个python包,用于简单地将陆地卫星图像加载为numpy数组
开始
从pypi安装gendocs:
$ pip install gendocs
使用量
已经有一个需要自动文档的python包了?遵循以下步骤。
此生成器是为Sphinx(RST)文档而构建的。 要记录您的包,请设置sphinx和conf.py,然后添加以下内容 在你的conf.py顶部附近:
# Import the package to document:importwonderfulpackage# Automatically generate documentation pagesfromgendocsimportGeneratorGenerator().DocumentPackages(wonderfulpackage)
就这样!上面的代码块是完整记录包所需的全部工作。现在您可以构建Sphinx文档,所有文档页面都将自动生成
删除github上的编辑按钮
Be sure to remove the Edit on GitHub link from your project by following these steps.
创建自己的主页
Note that you can also set up a base index file in your project for the ^{tt8}$ to append if you’d like to include a brief overview of the package. We simply pass the filename of our README to the ^{tt9}$ method.
让人们知道
如果您的项目自动生成文档,请在您的项目中添加徽章以让人们知道!我们希望这些徽章能够激发人们的好奇心、参与度和社区对gendocs软件包的贡献
降价:
[![Documentation Built by gendocs](https://img.shields.io/badge/docs%20by-gendocs-blue.svg)](https://gendocs.readthedocs.io/en/latest/)
RST/狮身人面像:
.. image:: https://img.shields.io/badge/docs%20by-gendocs-blue.svg :target: https://gendocs.readthedocs.io/en/latest/ :alt: Documentation Built by gendocs
贡献
查看GitHub中的gendocs来贡献和改进自动文档!