Utility for creating and loading templates
makeit is available as an
AUR package. You can install it
with any AUR package manager. This is example installation with
yay:
yay -S makeit
You can also clone this repo and compile it yourself. But that shouldn't be a
problem, since only thing you need is cargo:
cargo build -r
After it's done compiling, you can start it in ./target/release/makeit
You can load already existing template. If you don't specify -d, template
will be loaded to current directory by default:
./makeit <template name> [-d load/template/to]
To create template you have to do this (note that if -d isn't specified,
template is create from current directory):
./makeit <template name> -c [-d create/template/from]
To see full usage and other options, visit makeit help or man-page:
./makeit -h
For parametrization of the templates I created custom expression language.
Expressions are enclosed in {{ and }}.
- Can be defined in
makeit.jsonfile of the template or supplied using command-line arguments - Name has to start with alphabetic character or underscore and is followed by any alphanumeric character or underscore
_PNAME: project name based on project directory_PDIR: project directory_OS: operatins system
- Enclosed in double quotes (")
- They support escape sequences:
\n: newline\r: carriage return\t: tabulator\\: backslash\": double quotes- Other sequences are expanded to character following backslash
- Variables and literals concatenation
- Combines them to single literal
- Syntax:
EXPR1 + EXPR2
- Compares two values for equality (
truewhen equals, elsefalse) - Syntax:
EXPR1 == EXPR2
- The null coalescing operator - provides default value for an expression,
which evaluates to
null - Syntax:
EXPR1 ?? EXPR2: returns value ofEXPR1of notnullelse value ofEXPR2
I used these libraries, which were really helpful:
- Author: Martan03
- GitHub repository: termint
- Author website: martan03.github.io