| Crates.io | timp |
| lib.rs | timp |
| version | 0.1.0 |
| created_at | 2025-06-06 02:22:17.733132+00 |
| updated_at | 2025-06-06 02:22:17.733132+00 |
| description | Simple linux CLI for importing code templates with macros |
| homepage | |
| repository | https://github.com/Lucas-Araujo-Lima/timp |
| max_upload_size | |
| id | 1702537 |
| size | 6,019 |
timp (short for "template import") is a simple cli utility for importing code templates from the ~/Templates directory. it's goal is to help skip writing common boilerplate on new files, using simple to make templates.
Say you have a template named "clib" in ~/Templates. In that template, you also have a "libname" macro that you want to replace with the library's name when you import it. Then, to do that, you need only run "timp clib output_file -libname=name" and timp will do all the replacement for you.
In a more complex scenario, your template may have multiple macros, that can be defined with the same "-macro=definition" pattern. It is, however, important to know, when writing a template, that timp only does a simple text replacement. Therefore, if the text replacement breaks the language's syntax, timp will not correct it.
Also, if the user does not give a definition to a macro used in a template, timp simply does not do any replacement, so the output will have the macros still in it. I plan on, in the future, allowing templates to list all their needed macros and, if desired, give default definitions that are used if the user does not define them himself.