An open API service indexing awesome lists of open source software.

https://github.com/benstigsen/shgen

tiny posix shell templating engine
https://github.com/benstigsen/shgen

Last synced: 6 months ago
JSON representation

tiny posix shell templating engine

Awesome Lists containing this project

README

          

# shgen
tiny posix shell templating engine.

## example
**foo.shtml**
```html
$(cat './partials/header.html')

$([ 5 -lt 3 ] && echo 'true' || echo 'false')


    $(loop "$(ls)" '
  • $index is $item
  • ')

```

**./partials/header.html**
```html

shgen

```

run it like this: `shgen foo.shtml`

**output**
```html

shgen

false


  • 0 is foo.shtml

  • 1 is header.html


```

## usage
```sh
usage: shgen [FILE]

options:
-h, --help show this help message

examples:
shgen template.txt # process a file
cat file.txt | shgen # process from stdin
```

_**note:** only lines containing `$` will be evaluated.
use 'single quotes' for strings outside of $(command substitutions) or escape backticks and double quotes with backslash._