文本脚本包含管理器根据外壳指令从任何文本文件生成内容
tsincluder的Python项目详细描述
动机
我需要基于git内容生成一个变更日志我想控制 变更日志的结构,但我不想管理git 内容
### from 2016-01 to 2016-05 We implements feature activation ... * 2016-04-13 : Fabien Arcellier : feat: activate ... * 2016-04-10 : Fabien Arcellier : feat: add index ... * 2016-04-10 : Fabien Arcellier : feat: add search ... * ...
我需要自己管理内容的格式和位置,让git 从文件生成一些内容CHANGELOG.md.in
### from 2016-01 to 2016-05 We implements feature activation ... * @tsincluder git log --date=short --pretty=format:'%ad : %aN : %s' --abbrev-commit --since="1/1/2016" --until="4/31/2016" | grep feat
要生成CHANGELOG.md,请运行
tsincluder CHANGELOG.md.in > CHANGELOG.md
概要
tsincluder表示文本脚本包含管理器。tsincluder是 cli和library可以从python脚本调用 用hello world替换标记为@tsincluder echo hello world
它将标记前的内容保留为生成有效格式 如果Tscluder生成许多行,则在所有行上标记并添加它
最新版本
您可以找到最新版本…
git clone https://github.com/FabienArcellier/tsincluder.git
用法
运行tsincluder替换标记@tsinclude(包括文本脚本) 通过stdout上的命令生成的内容
python-mtsincluderfile.in
把它当作图书馆
fromtsincluderimportProcessorline=" * @tsincluder git log --date=short --pretty=format:'%ad : %aN : %s' --abbrev-commit --since="1/1/2016" --until="4/31/2016" | grep feat"processor=Processor()content=processor.process(line)print(content)
当tsincluder执行子进程命令时,脚本可以配置 工作目录和标记
fromtsincluderimportProcessorprocessor=Processor(working_directory="/tmp",markup="@other_markup")
安装
使用PyPi安装t群集
pip install tsincluder
从源安装t群集
python setup.py install
测试
使用make执行单元测试
make tests
贡献者
- 法比安·阿塞利尔
许可证
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.