A simple templating system where both template input and output can be managed in a single file.
%template-input-start:test% Some text and {%shell ... %} %template-input-end:test% %template-output-start:test% Anything inside this range will be replaced with above input and its shell code output %template-output-end:test%
See how this --help
is generated in ./README.md
.
$ inline-template --help
inline-template/0.0.1-pre.5
Usage:
$ inline-template [options] <file>
Expand inline template
Positional arguments:
file Input file
Options:
--dry Print instead of updating in-place
--cwd=... Working directory to execute shell code interpolation
Inspired by mdocs, the primary purpose is to automatically update readme files, which typically contain sample code and its output.