Crates.io | pbl |
lib.rs | pbl |
version | 0.2.1 |
source | src |
created_at | 2021-03-13 20:04:31.456852 |
updated_at | 2022-01-17 20:44:03.966404 |
description | A simple command line application for rendering templates from structured data and a template. |
homepage | https://github.com/digitalsanctum/pbl |
repository | https://github.com/digitalsanctum/pbl |
max_upload_size | |
id | 368435 |
size | 17,029 |
Publisher is a simple command line application for rendering templates from structured data and a template.
A simple command line application for rendering templates from structured data and a template.
USAGE:
pbl --data <DATA> --template <TEMPLATE>
OPTIONS:
-d, --data <DATA> Path to the data file
-h, --help Print help information
-t, --template <TEMPLATE> Path to the template file
-V, --version Print version information
Given a data file, data.json
:
{
"title": "My Blog",
"body": "blah"
}
and a template, template.mustache
:
<html lang="en">
<head>
<title>{{title}}</title>
</head>
<body>
{{body}}
</body>
</html>
the following command will render the template:
pbl render --data data.json --template template.mustache
By default, the result is written to stdout
and will look like:
<html lang="en">
<head>
<title>My Blog</title>
</head>
<body>
blah
</body>
</html>
The first use case for pbl
was to create a templated CONTRIBUTING.md
document for a project given a data file describing the project.