https://github.com/thesurlydev/pbl
Simple command line publishing from data and templates
https://github.com/thesurlydev/pbl
command-line-tool json mustache rust
Last synced: 4 months ago
JSON representation
Simple command line publishing from data and templates
- Host: GitHub
- URL: https://github.com/thesurlydev/pbl
- Owner: thesurlydev
- License: mit
- Created: 2021-03-13T15:43:34.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T22:46:53.000Z (over 1 year ago)
- Last Synced: 2025-09-18T02:23:32.829Z (9 months ago)
- Topics: command-line-tool, json, mustache, rust
- Language: Mustache
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Publisher (pbl)
Publisher is a simple command line application for rendering templates from structured data
and a template.
## Usage
```
A simple command line application for rendering templates from structured data and a template.
USAGE:
pbl [OPTIONS]
OPTIONS:
-d, --data Path to the data file [env: PBL_DATA=] [default: data.json]
-h, --help Print help information
-o, --output Output file [env: PBL_OUTPUT=] [default: ]
-t, --template Path to the template file [env: PBL_TEMPLATE=] [default:
template.mustache]
-v, --verbose Verbose mode for debugging
-V, --version Print version information
```
## Examples
Given a data file, `data.json`:
```json
{
"title": "My Blog",
"body": "blah"
}
```
and a template, `template.mustache`:
```mustache
{{data.title}}
Author: {{env.USER}}
{{data.body}}
```
the following command will render the template:
```shell
pbl render --data data.json --template template.mustache
```
By default, the result is written to `stdout` and will look like:
```html
My Blog
blah
```
## Why was pbl created?
The first use case for `pbl` was to create a templated `CONTRIBUTING.md`
document for a project given a data file describing the project.
## Roadmap
* Add support for transformations.
* Add support for [json-e](https://json-e.js.org/).
* Ability to specify output path(s).
* Add support for multiple template engines.
* Add support for multiple data formats.
* Given a template, parse the data it requires and return an empty
serialized data file or prompt for values.