About

Kapow is a template processor that provides the following directives to support injecting file contents, command output, current date/time, etc in generated files.

Block directives

Directive | Description ---|--- !inc:path | Include file contents; path is relative to its containing file !run:command | Run command and insert stdout

Span directives

Directive | Example | Description ---|---|--- `!now` | 2023-03-10T17:28:12Z | Current date/time in UTC / RFC 3339 `!now:local` | Fri 10 Mar 2023 12:28:12 EST | Current date/time in local timezone `!now:local:%A %H:%M` | Friday 12:28 | Current date/time in local timezone and custom format `!now:MST7MDT` | Fri 10 Mar 2023 10:28:12 MST | Current date/time in custom timezone `!now:MST7MDT:%A %H:%M` | Friday 10:28 | Current date/time in custom timezone and format `!now:US/Hawaii` | Fri 10 Mar 2023 07:28:12 HST | Current date/time in custom locale `!now:US/Hawaii:%A %H:%M` | Friday 07:28 | Current date/time in custom locale and format `!now:UTC:%A %H:%M` | Friday 17:28 | Current date/time in UTC and custom format `!now:x` | Xh29HSC | Current date/time in "x" format

Usage

text $ kapow -V kapow 2.2.0

```text $ kapow -h KAPOW!

Usage: kapow [OPTIONS] [INPUT_FILES]...

Arguments: [INPUT_FILES]... Input file(s)

Options: -r, --readme Print readme -h, --help Print help -V, --version Print version ```

Example

See the readme task in Makefile.toml:

Changelog

Development

bash cargo install bat cargo-edit cargo-make cargo-outdated dtg kapow miniserve