Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Cake addin for working with Handlebars templates

License

Notifications You must be signed in to change notification settings

thzinc/Cake.HandlebarsDotNet

Repository files navigation

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.