Skip to content

Barber is simple wrapper for processing mustache templates

License

Notifications You must be signed in to change notification settings

vankooch/barber

Repository files navigation

barber

Barber is cli-tool for generating files based on mustache templates. In addition it can read and process OpenAPI 3 specifications and generate code based on templates.

Installation & Usage

Barber is installed as a dotnet global tool.

dotnet tool install -g barber

# Show help
barber --help

# Render
barber render -i template.mustache -- -Var1=A212

# OpenAPI create configuration
barber openapi init

# OpenAPI process
barber openapi

Commands

Render

You can use this command for processing any mustache template. Either you pass the variables per arguments or by passing in a json file.

Arguments

barber render -i template.mustache -o index.html -- -Var1="Foo"

JSON

barber render -i template.mustache -o index.html -j data.json"
{
    "Var1": "Foo"
}

Template File

<html>
<body>
    <h1>{{ Var1 }}</h1>
</body>
</html>

Result File

<html>
<body>
    <h1>Foo</h1>
</body>
</html>

OpenAPI

Create Configuration

Create initial configuration file.

barber openapi init"

Process

Read OpenAPI specification file and generate code based on templates

barber openapi init"

About

Barber is simple wrapper for processing mustache templates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published