8 releases (5 stable)
1.1.0 | Sep 5, 2024 |
---|---|
1.0.3 | Nov 30, 2023 |
0.2.1 | Mar 25, 2023 |
0.1.0 | Mar 24, 2023 |
#299 in Command line utilities
13KB
159 lines
CLTemplate
Small commandline tool to create and use templates quickly
Installation
Simply run cargo install cltemplate
to install the tool.
Using Templates
To use a template, do the following:
- CD into the folder of the template (your terminal should be running at
path/to/template
) - Run
template path/to/output
and check the directory you provided
Optionally, you can use the --template-path
param (-t
for short) instead of CDing to the the template folder
Writing Templates
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 intemplate.txt
will remain unchanged. -
Share your template and usage instructions via your preferred method.
License
This tool is licensed under the MIT
license.
Roadmap
-
Initial prototype -
Complete rework -
Asynchronous file IO -
Indicatif task indicators - Optionally providing template args in cli
- Dynamic filepaths
- Use TOML structure for manifest (for input types, etc.)
Dependencies
~12–22MB
~293K SLoC