本文整理汇总了Python中apigen.ApiDocWriter.write_api_docs方法的典型用法代码示例。如果您正苦于以下问题:Python ApiDocWriter.write_api_docs方法的具体用法?Python ApiDocWriter.write_api_docs怎么用?Python ApiDocWriter.write_api_docs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apigen.ApiDocWriter
的用法示例。
在下文中一共展示了ApiDocWriter.write_api_docs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writeapi
# 需要导入模块: from apigen import ApiDocWriter [as 别名]
# 或者: from apigen.ApiDocWriter import write_api_docs [as 别名]
def writeapi(package, outdir, source_version, other_defines=True):
# Check that the package is available. If not, the API documentation is not
# (re)generated and existing API documentation sources will be used.
try:
__import__(package)
except ImportError:
abort("Can not import " + package)
module = sys.modules[package]
# Check that the source version is equal to the installed
# version. If the versions mismatch the API documentation sources
# are not (re)generated. This avoids automatic generation of documentation
# for older or newer versions if such versions are installed on the system.
installed_version = V(module.__version__)
if source_version != installed_version:
abort("Installed version does not match source version")
docwriter = ApiDocWriter(package, rst_extension='.rst',
other_defines=other_defines)
docwriter.package_skip_patterns += [r'\.%s$' % package,
r'.*test.*$',
r'.*duecredit.*$',
r'.*due.*$',
r'\.version.*$']
docwriter.write_api_docs(outdir)
docwriter.write_index(outdir, 'index', relative_to=outdir)
print('%d files written' % len(docwriter.written_modules))
示例2: ApiDocWriter
# 需要导入模块: from apigen import ApiDocWriter [as 别名]
# 或者: from apigen.ApiDocWriter import write_api_docs [as 别名]
#!/usr/bin/env python
"""Script to auto-generate our API docs.
"""
# stdlib imports
import os
# local imports
from apigen import ApiDocWriter
#*****************************************************************************
if __name__ == '__main__':
package = 'pysvg'
outdir = os.path.join('api','generated')
docwriter = ApiDocWriter(package)
docwriter.package_skip_patterns += [r'\.fixes$',
r'\.externals$',
r'\.neurospin\.viz',
]
docwriter.write_api_docs(outdir)
docwriter.write_index(outdir, 'gen', relative_to='api')
print '%d files written' % len(docwriter.written_modules)