0.5.5 • Published 5 years ago

monta-cli v0.5.5

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Monta CLI

Command-line tool to compile Monta templates into HTML files.

npm license Build Status Codecov David

Usage

npm install --global monta-cli

monta templates/**/*

This will compile all template files (*.mt or *.html) in the templates/ directory and subdirectories, and place the rendered html files in the default output directory dist/

The CLI will skip over any files starting with an underscore (e.g. _base.mt). You can use this to avoid compiling base templates that your other pages extend from.

Note: Monta CLI uses fast-glob 3, which expects forward slashes / on all operating systems, including Windows. Backslashes \ are used for escaping characters. See the fast-glob pattern syntax for more information.

Template Data

You can pipe a JSON object into Monta CLI, and it will be used as the template data in your templates.

<p>${ foo }</p>
echo {"foo":"bar"} | monta templates/foo.mt

Will result in:

<p>bar</p>

Root

Set the template root directory by providing the --root argument. If omitted, Monta CLI will use the current working directory to resolve file paths.

monta views/**/*.mt --root ./views

Output Directory

You can define a different output directory by providing the --out argument.

monta templates/**/* --out ./my-out-dir

Extensions

By default, the CLI looks for .mt and .html files. If you want to use a different file extension, you can specify it with the --ext argument.

monta templates/**/* --ext .myext

monta templates/**/* --ext .mt,.html,.myext
0.5.5

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago