0.1.1 • Published 7 years ago

simple-build-markup v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

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]

FlagParameterDescription
‑‑templatespath-to-template-folderDefines the path to a folder containing handlebars templates and optionally data json files. Will also look within subdirectories.
‑‑datapath-to-data-folderDefines 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.
‑‑partialpath-to-partials-folderDefines the path to a folder containing handlebars partials. Will also look within subdirectories.
‑‑outputpath-to-output-folderDefines the path where the resulting HTML files will be saved.
‑‑prefixesset-of-prefixesYou can define a set of language specific prefixes which will be prepended to the output file.Use the following format: language-code:prefixe.g. --prefixes "en: es:es/" This would put all Spanish HTML files in a subdirectory called 'es/' while leaving English files unaffected
‑‑suffixesset-of-suffixesYou 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‑namenoneIf set, templates and data files will be associated via a shared file name. Pages will be created based on template files.
‑‑devnoneUsing this flag the output files will not be minified.
‑‑watchnoneThis will start a file watcher watching the template, data and partial folders.