Crates.io | cltemplate |
lib.rs | cltemplate |
version | 1.1.0 |
source | src |
created_at | 2023-03-24 00:23:42.128282 |
updated_at | 2024-09-05 21:10:08.923894 |
description | A simple CLI tool for creating and using templates |
homepage | https://github.com/inflectrix/cltemplate |
repository | https://github.com/inflectrix/cltemplate |
max_upload_size | |
id | 818890 |
size | 40,788 |
Small commandline tool to create and use templates quickly
Simply run cargo install cltemplate
to install the tool.
To use a template, do the following:
path/to/template
)template path/to/output
and check the directory you providedOptionally, you can use the --template-path
param (-t
for short) instead of CDing to the the template folder
To write a template that others can use with this tool, you must:
Create a folder for the template
In the root directory of the folder, create a template.txt
file. In this file, there should be the name of each replaceable item, separated by newlines (ex:
foo
bar
buz
qux
quux
corge
grault
garply
waldo
fred
plugh
xyzzy
thud
)
Fill in the rest of the folder with the files provided in the template. Anything defined in template.txt
that has {% %}
around it (ex: {% foo %}
) will be replaced by whatever the user inputs. Anything surrounded by {% %}
that is not included in template.txt
will remain unchanged.
Share your template and usage instructions via your preferred method.
This tool is licensed under the MIT
license.