0.1.1 • Published 7 years ago
simple-build-markup v0.1.1
Simple Markup Build Tool
This is an early, not very well tested version of a tool with a very specific use case!
What it does
This simple command line tool is intended to quickly build markup for small projects. For templating handlebars is used.
File Name Association Mode
The idea is to have a folder containing all your data as JSON files and handlebars templates. Corresponding data and template files share matching file names. Data files also have their content language appended.
For example:
root/
├ templates/
| ├ index.handlebars
| ├ index.en.json
| ├ index.es.json
| ├ index.de.json
| ├ contact.handlebars
| ├ contact.en.json
| ├ contact.es.json
| └ contact.de.json
└ dist/
├ index.html
├ es/
| └ index.html
└ de/
└ index.html
Data File Mode
TODO!
CLI Usage
Usage: simple-build-markup [options]
Flag | Parameter | Description |
---|---|---|
‑‑templates | path-to-template-folder | Defines the path to a folder containing handlebars templates and optionally data json files. Will also look within subdirectories. |
‑‑data | path-to-data-folder | Defines the path to a folder containing JSON files. Will also look within subdirectories. If undefined, it will behave as if ‑‑associate‑by‑file‑name was set. |
‑‑partial | path-to-partials-folder | Defines the path to a folder containing handlebars partials. Will also look within subdirectories. |
‑‑output | path-to-output-folder | Defines the path where the resulting HTML files will be saved. |
‑‑prefixes | set-of-prefixes | You can define a set of language specific prefixes which will be prepended to the output file.Use the following format: language-code:prefix e.g. --prefixes "en: es:es/" This would put all Spanish HTML files in a subdirectory called 'es/' while leaving English files unaffected |
‑‑suffixes | set-of-suffixes | You can define a set of language specific suffixes which will be appended to the output file before the file type suffix. Use the following format: language-code:suffix e.g. --suffixes "en: es:_es" This would append an "_es" to all Spanish HTML files. "index.handlebars" would become "index_es.html". |
‑‑associate‑by‑file‑name | none | If set, templates and data files will be associated via a shared file name. Pages will be created based on template files. |
‑‑dev | none | Using this flag the output files will not be minified. |
‑‑watch | none | This will start a file watcher watching the template, data and partial folders. |