Skip to main content

Templetize is a script to convert a file or a directory (recursively) to a template for codegen. It is bundled with a simple code generator module to expand these templates.

Project description

Templetize is a script to convert a file or a directory (recursively) to a template for codegen and writes it to stdout.

Codegen uses a single jinja2 template from a given file or string and the data you provide to the code generator to recreate the previously templetized file structure (maybe renaming parts of it).

See the jinja2 documentation for the template syntax.

Code generator reads and evaluates templates generated with templetize and creates the directories and files according to the templates instructions.

Bevore operating the template will be parsed thru jinja2.

See the jinja2 documentation for the template syntax.

Code generator special directives start with “@@@” and extend to the end of the line. There are 3 different commands. An example:

@@@ dir dir/to/be/generated/

@@@ file dir/to/be/generated/with-a-file-{{inside}}.txt

This is the content {{inside}} of the file. The word inside will be replaced by jinja2. So if you set ‘inside’: ‘to-generate’, you will get a file called dir/to/be/generated/with-a-file-to-generate.txt with the content This is the content to-generate of the file. […]

@@@ binary another/dir/image.png

IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCiMgLSotIGNvZGluZzogdXRmLTggLSotCgppbXB==

Code generator will not throw exceptions but just ignore already existing files. They won’t be overwritten. A message is printed to stderr.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

templetize-2014.09.21.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file templetize-2014.09.21.tar.gz.

File metadata

File hashes

Hashes for templetize-2014.09.21.tar.gz
Algorithm Hash digest
SHA256 876fa728e3c0b300e871a56f0b26bf36c1289df3c53bcbb59b6f38f3fc3dc631
MD5 2ae5b78a166b0efc2f1e3dd98af1f35b
BLAKE2b-256 206c07d6a87b89c0df55346948d502e0cf3887707814f6b2bc759e9e3a9ffde5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page