Kapow is a template processor that provides the following directives to support injecting file contents, command output, current date/time, etc in generated files.
Directive | Description
---|---
!inc:path
| Include file contents
!run:command
| Run command and insert stdout
Directive | Example | Description
---|---|---
`!now`
| 2023-02-21T15:26:23Z | Current date/time in UTC / RFC 3339
`!now:local`
| Tue 21 Feb 2023 10:26:23 EST | Current date/time in local timezone
`!now:local:%A %H:%M`
| Tuesday 10:26 | Current date/time in local timezone and custom format
`!now:MST7MDT`
| Tue 21 Feb 2023 08:26:23 MST | Current date/time in custom timezone
`!now:MST7MDT:%A %H:%M`
| Tuesday 08:26 | Current date/time in custom timezone and format
`!now:US/Hawaii`
| Tue 21 Feb 2023 05:26:23 HST | Current date/time in custom locale
`!now:US/Hawaii:%A %H:%M`
| Tuesday 05:26 | Current date/time in custom locale and format
`!now:UTC:%A %H:%M`
| Tuesday 15:26 | Current date/time in UTC and custom format
`!now:x`
| Xh1KFQN | Current date/time in "x" format
!
with a backslash: \!
text
$ kapow -V
kapow 1.0.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 ```
readme
task in Makefile.toml
:
VERSION.md
from VERSION.template.md
!run:./target/release/kapow -V
USAGE.md
from USAGE.template.md
!run:./target/release/kapow -h
README.md
from README.template.md
!inc:VERSION.md
!inc:USAGE.md
`!now`