一个用于记录yaml文件的简单工具
yaml2rst的Python项目详细描述
Author: | Hartmut Goebel <h.goebel@crazy-compilers.com> |
---|---|
Copyright: | 2015-2019 by Hartmut Goebel |
Licence: | GNU General Public Licence v3 or later (GPLv3+) |
此工具允许您将文档直接写入yaml文件 评论。然后这些注释将转换为文本和yaml代码 进入文字块。
这是一种有文化的编程,除了你没有 将代码写入文本,但将文本写入代码。这个区别 允许直接处理yaml文件,而无需任何预处理。
用法:
yaml2rst [-h] [--strip-regex regex] infile outfile positional arguments: infile YAML-file to read (`-` for stdin) outfile rst-file to write (`-` for stdout) optional arguments: -h, --help show this help message and exit --strip-regex regex Regex which will remove everything it matches. Can be used to remove fold markers from headings for example. Example to strip out [[[,]]] fold markers: '\s*(:?\[{3}|\]{3})\d?$'. Check the README for more details.
工作原理
此脚本接受以#开头的所有行(和行 只包含一个#)作为文本行。其他一切都会 作为“代码”处理。文本行将删除#。 而“代码”将预先设置空格。
另外,在“代码”块的开头和结尾,行是 根据RestructuredText的要求添加。也在 “code”-块,如果需要,添加::。
--strip-regex可用于从文本行中删除匹配的字符 需要的时候。请参阅有关 Folding marks support了解详细信息。
示例
您可以在 示例目录。您也可以在线查看生成的html https://rawgit.com/debops/yaml2rst/develop/examples/main.html。
维护人员
Yaml2rst最初于2015年开发,由Hartmut维护 戈贝尔。2019年,该项目转移至 开发了yaml2rst。