pandemics-mustache

0.6.2 • Public • Published

pandemics-mustache

Wrapper to apply mustache templating to your manuscript in pandemics.

Usage

cat my_document > pandemics-mustache [view1.json] [view2.json] [...]

Where the arguments are .json or .yaml files that contain the 'views' (ie. the name/values association to replace in the template).

If no arguments are given, pandemics-mustache will look in the front matter of the document provided on stdin:

---
mustache: results.json
---

or

---
mustache:
- results/res1.json
- results/res2.yaml
---

Glob expansion

You can directly load a set of files using globs:

---
mustache: results/*
---

Conflict management

If multiple files are provided, it might happen that the same entry is defined twice, which will throw an error. One workaround is add a prepend a prefix to the values loaded from a file, eg:

---
mustache:
- results/res1.json
- prefix: newres
  file: results/res2.yaml
---

will make all values in results/res2.yaml available using {{ newres.keyinres2 }}.

/pandemics-mustache/

    Package Sidebar

    Install

    npm i pandemics-mustache

    Weekly Downloads

    1

    Version

    0.6.2

    License

    BSD-3-Clause

    Unpacked Size

    11.8 kB

    Total Files

    12

    Last publish

    Collaborators

    • lionel-rigoux