提取Ansible模块文档

ansible-doc-extractor的Python项目详细描述


此包包含Ansible集合文档提取器的代码。它 主要读者是希望发布的Ansible集合维护者 HTML格式的API文档,无需手动复制数据 存在于模块的元数据中。在

快速启动

文档提取器发布在PyPI上,我们可以使用 pip

$ pip install ansible-doc-extractor

如果上一个命令没有失败,我们就可以开始提取 文件:

^{pr2}$

这将从my.col集合中的模块提取文档,并 将生成的rst文件放入/tmp/output-folder。在

注意

始终从已安装的集合中提取文档。文档 片段加载器无法组合文档的各个部分 否则。在

自定义模板

ansible文档提取器通过--template支持自定义Jinja2模板文件。以下变量 发送到模板:

Variable nameTypeDescriptionModule’s documentation key
short_descriptionstrShort description of a module.short_description
descriptionstr / listLonger description of a module, type depends on the module’s description type.description
requirementslistRequirements needed on the host that executes this module.requirements
optionsdictAll module options, often called parameters or arguments.options
noteslistModule’s additional notes.notes
seealsolistDetails of any important information that doesn’t fit in one of the above sections.seealso
deprecatedstrMarks modules that will be removed in future releasesdeprecated
authorstr / listAuthor of the module, type can vary depending on how many authors module has.author
metadatadictThis section provides information about the moduleRefers to ANSIBLE_METADATA block in the module.
examplesstrCode examplesRefers to EXAMPLES block in the module.
returndocsdictThis section documents the information the module returns.Refers to RETURN block in the module.

您可以始终引用default Jinja2 template。在

开发设置

如果我们 已安装pipenv

$ pipenv update

要测试提取器,我们可以运行:

$ pipenv run ansible-doc-extractor

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将字符串转换为自定义对象   java如何从socket方法获取数据?   Java中的soap读取回车和新行   java在单击时替换图像   java推荐的使用RXJava执行异步任务的方法   java MySql连接器JDBC驱动程序不支持连接池吗?   java将活动堆栈清理到顶部   java计数用户输入的数量   java从webservice下载大文件导致应用程序性能问题   JavaLocalDate。EPOCH不可用   java如何在使用Selenium等待一定时间后,在页面无法加载(get(url))时自动刷新页面   java Calendar setLenient方法不允许检查年份字段的健全性   java Eclipse和intelliJ 安卓 SDK问题   java为什么我可以在没有super关键字的情况下调用父方法?   java iText的PDF格式不好