Crates.io | ribboncurls-cli |
lib.rs | ribboncurls-cli |
version | 0.4.1 |
source | src |
created_at | 2024-05-13 18:03:10.54908 |
updated_at | 2024-09-19 10:29:19.843969 |
description | Simple rendering of mustache templates |
homepage | https://github.com/tinted-theming/ribboncurls |
repository | https://github.com/tinted-theming/ribboncurls |
max_upload_size | |
id | 1238729 |
size | 37,231 |
Ribboncurls CLI is a tool for rendering mustache templates.
cargo install ribboncurls-cli
brew tap tinted-theming/tinted
brew install ribboncurls
Download the relevant binary from the repository releases page.
The following takes in ./path/to/page.html.mustache
template file and
generates ./page.html
using ./path/to/data.yaml
:
ribboncurls render ./path/to/page.html.mustache \
--data-file="./path/to/data.yaml" \
--out="./page.html"
echo "Hello, {{name}}!" | ribboncurls render - --data="name: World" > ./hello-world-example.txt
The following is a table of the available subcommands for the CLI tool, including the descriptions and any notable arguments.
Subcommand | Description | Arguments | Example Usage |
---|---|---|---|
render |
Renders the Mustache template with provided data. | mustache_file_path : Path to mustache file or - to accept stdin. |
ribboncurls render ./path/to/file.mustache or `echo "Hello, {{name}}!" |
Flag/Option | Description | Required | Repeat flag | Applicable Subcommands | Example Usage |
---|---|---|---|---|---|
--data -d |
A string of YAML data to be used when rendering. | --data and/or --data-file |
Repeat | render |
ribboncurls render /path/to/file.mustache --data="name: some_first_name" |
--data-file -f |
Path to your YAML data file. | --data and/or --data-file |
Repeat | render |
ribboncurls render /path/to/file.mustache --data-file="/path/to/custom/data-file.yaml" |
--partials -p |
A path to a file that contains YAML partial data. | Optional | Repeat | render |
ribboncurls path/to/file.mustache --partials="path/to/partials-file.yaml" --partials="path/to/some/other/file.yaml" |
--partial-file -f |
YAML data containing a "partial" property name and "partial" value (path to file to use as partial). | Optional | Repeat | render |
ribboncurls render path/to/file.mustache --partial-file="property_name: path/to/file.mustache" |
--out -o |
Writes stdout to a file. | Optional | No repeat | render |
ribboncurls render /path/to/file.mustache" --out="./output.html" |
--help -h |
Displays help information for the subcommand. | Optional | No repeat | All | ribboncurls --help , ribboncurls render --help , etc |
--version -V |
Displays the current ribboncurls-cli version. |
Optional | No repeat | All | ribboncurls --version |
Some flags may be repeated, for example:
ribboncurls render ./file.mustache \
--data="name: Gillian" \
--data="surname: Doe" \
--data-file="./path/to/datafile1.yaml" \
--data-file="./path/to/datafile2.yaml"
Contributions are welcome! Have a look at CONTRIBUTING.md for more information.
Ribboncurls is licensed under the MPL-2.0 license.
This project includes third-party code licensed under the MPL-2.0 license. See the THIRD_PARTY_LICENSES file for details.