Jericho / Cake.HandlebarsDotNet

Cake addin for working with Handlebars templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cake.HandlebarsDotNet

Cake addin for working with Handlebars templates

(This is very close in functionality to https://github.com/agc93/Cake.Handlebars. At some point, these should probably be merged.)

Quickstart

Add the Cake.HandlebarsDotNet package to your Cake script:

#addin nuget:?package=Cake.HandlebarsDotNet&loaddependencies=true

Then use it in your script

Task("RenderTemplate")
    .Does(() =>
    {
        var rendered = HandlebarsRenderText("Hello, {{Name}}!", new { Name = "World" });
        Information($"Result: {rendered}");
    });

Task("RenderTemplateFromFile")
    .Does(() =>
    {
        var rendered = HandlebarsRenderTextFile("./template.handlebars", new { Name = "World" });
        Information($"Result: {rendered}");
    });

Task("RenderTemplateFromFileToFile")
    .Does(() =>
    {
        HandlebarsRenderTextFile("./template.handlebars", "./rendered.txt", new { Name = "World" });
    });

Building

AppVeyor CI AppVeyor Tests NuGet NuGet Pre Release

This project is built using Cake. Because this Cake addin targets net46 for compatibility with Cake 0.25.0, it does require being built in an environment where net46 is available. (Generally Windows) Development and testing is possible on macOS/Linux, but packaging for use with Cake will require building against net46.

On macOS/Linux:

./build.sh

On Windows:

.\build.ps1

Code of Conduct

We are committed to fostering an open and welcoming environment. Please read our code of conduct before participating in or contributing to this project.

Contributing

We welcome contributions and collaboration on this project. Please read our contributor's guide to understand how best to work with us.

License and Authors

Daniel James logo Daniel James

license GitHub contributors

This software is made available by Daniel James under the MIT license.

About

Cake addin for working with Handlebars templates

License:MIT License


Languages

Language:PowerShell 42.3%Language:C# 40.8%Language:Shell 16.6%Language:HTML 0.4%