EnglishFrenchSpanish

OnWorks favicon

mustache - Online in the Cloud

Run mustache in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command mustache that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


mustache - Mustache processor

SYNOPSIS


mustache <YAML> <FILE>
mustache --compile <FILE>
mustache --tokens <FILE>

DESCRIPTION


Mustache is a logic-less templating system for HTML, config files, anything.

The mustache command processes a Mustache template preceded by YAML frontmatter from
standard input and prints one or more documents to standard output.

YAML frontmatter begins with --- on a single line, followed by YAML, ending with another
--- on a single line, e.g.

---
names: [ {name: chris}, {name: mark}, {name: scott} ]
---

If you are unfamiliar with YAML, it is a superset of JSON. Valid JSON should work fine.

After the frontmatter should come any valid Mustache template. See mustache(5) for an
overview of Mustache templates.

For example:

{{#names}}
Hi {{name}}!
{{/names}}

Now let´s combine them.

$ cat data.yml
---
names: [ {name: chris}, {name: mark}, {name: scott} ]
---

$ cat template.mustache
{{#names}}
Hi {{name}}!
{{/names}}

$ cat data.yml template.mustache | mustache
Hi chris!
Hi mark!
Hi scott!

If you provide multiple YAML documents (as delimited by ---), your template will be
rendered multiple times. Like a mail merge.

For example:

$ cat data.yml
---
name: chris
---
name: mark
---
name: scott
---

$ cat template.mustache
Hi {{name}}!

$ cat data.yml template.mustache | mustache
Hi chris!
Hi mark!
Hi scott!

OPTIONS


By default mustache will try to render a Mustache template using the YAML frontmatter you
provide. It can do a few other things, however.

-c, --compile
Print the compiled Ruby version of a given template. This is the code that is
actually used when rendering a template into a string. Useful for debugging but
only if you are familiar with Mustache´s internals.

-t, --tokens
Print the tokenized form of a given Mustache template. This can be used to
understand how Mustache parses a template. The tokens are handed to a generator
which compiles them into a Ruby string. Syntax errors and confused tags, therefore,
can probably be identified by examining the tokens produced.

INSTALLATION


If you have RubyGems installed:

gem install mustache

EXAMPLES


$ mustache data.yml template.mustache
$ cat data.yml | mustache - template.mustache
$ mustache -c template.mustache
$ cat <<data | ruby mustache - template.mustache
---
name: Bob
age: 30
---
data

COPYRIGHT


Mustache is Copyright (C) 2009 Chris Wanstrath

Original CTemplate by Google

Use mustache online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    AstrOrzPlayer
    AstrOrzPlayer
    AstrOrz Player is a free media player
    software, part based on WMP and VLC. The
    player is in a minimalist style, with
    more than ten theme colors, and can also
    b...
    Download AstrOrzPlayer
  • 2
    movistartv
    movistartv
    Kodi Movistar+ TV es un ADDON para XBMC/
    Kodi que permite disponer de un
    decodificador de los servicios IPTV de
    Movistar integrado en uno de los
    mediacenters ma...
    Download movistartv
  • 3
    Code::Blocks
    Code::Blocks
    Code::Blocks is a free, open-source,
    cross-platform C, C++ and Fortran IDE
    built to meet the most demanding needs
    of its users. It is designed to be very
    extens...
    Download Code::Blocks
  • 4
    Amidst
    Amidst
    Amidst or Advanced Minecraft Interface
    and Data/Structure Tracking is a tool to
    display an overview of a Minecraft
    world, without actually creating it. It
    can ...
    Download Amidst
  • 5
    MSYS2
    MSYS2
    MSYS2 is a collection of tools and
    libraries providing you with an
    easy-to-use environment for building,
    installing and running native Windows
    software. It con...
    Download MSYS2
  • 6
    libjpeg-turbo
    libjpeg-turbo
    libjpeg-turbo is a JPEG image codec
    that uses SIMD instructions (MMX, SSE2,
    NEON, AltiVec) to accelerate baseline
    JPEG compression and decompression on
    x86, x8...
    Download libjpeg-turbo
  • More »

Linux commands

Ad