Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pvorb/node-tpl
A general purpose template cli
https://github.com/pvorb/node-tpl
Last synced: about 1 month ago
JSON representation
A general purpose template cli
- Host: GitHub
- URL: https://github.com/pvorb/node-tpl
- Owner: pvorb
- License: mit
- Created: 2011-12-22T01:50:01.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-01-21T19:33:56.000Z (almost 13 years ago)
- Last Synced: 2024-10-03T23:31:43.956Z (about 2 months ago)
- Language: JavaScript
- Homepage: search.npmjs.org/#/tpl
- Size: 191 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.mkd
- License: LICENSE.mkd
Awesome Lists containing this project
README
# tpl
a general purpose template cli## Installation
`npm install tpl` or `npm install -g tpl`
## Usage
### Simple
To parse a file and apply a template, simply provide the file as an argument.
``` bash
tpl hello-world.mkd
```This will do several things.
1. Look for a `.conf` directory in the current working directory, if none exists
look for one in the parent directory, in the parent's parent directory and
so on. If there's no `.conf` directory all the way up to the root, use the
default `.conf` in the installation directory.
2. Use the configuration defined in `./tpl/conf.json`.
3. Look for a parser for the file extension (`.mkd`). If none was found,
use the default parser.
4. Read and parse the file.
5. Look if the file defined a template, which should be used for its rendering.
If not, use the default rendering.
6. Print the rendered document.If you want to save the output, you can use
``` bash
tpl hello-world.mkd > hello-world.html
```### Use custom configuration
For information on how to customize the behavior of **tpl**, look at the
[wiki](//github.com/pvorb/node-tpl/wiki).## Bugs and Issues
If you encounter any bugs or issues, feel free to open an issue at
[github](//github.com/pvorb/node-tpl/issues).## License
This package is licensed under the
[MIT license](http://vorb.de/license/mit.html).