timp

Crates.iotimp
lib.rstimp
version0.1.0
created_at2025-06-06 02:22:17.733132+00
updated_at2025-06-06 02:22:17.733132+00
descriptionSimple linux CLI for importing code templates with macros
homepage
repositoryhttps://github.com/Lucas-Araujo-Lima/timp
max_upload_size
id1702537
size6,019
Lucas (Lucas-Araujo-Lima)

documentation

README

What is it and why

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.

Usage

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.

Commit count: 6

cargo fmt