Mustache templates in Elm
Elm
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Update to 0.18 Jan 27, 2017
tests Update to 0.18 Jan 27, 2017
.gitignore Update to 0.18 Jan 27, 2017
LICENSE Initial commit May 12, 2016
README.md Initial commit May 12, 2016
elm-package.json Bump version number Jan 27, 2017
package.json Bump version number Jan 27, 2017

README.md

Elm-Mustache

An Elm library for mustache templates

Usage

import Mustache


template : String
template =
  "Hi, my name is {{ name }}.{{# show }} Show me!{{/ show }}"

evaluatedTemplate : String
evaluatedTemplate =
  Mustache.render
    [ Mustache.Variable "name" "John"
    , Mustache.Section "show" True
    ]
    template

-- evaluatedTemplate == "Hi, my name is John. Show me!"