npm i -g moza
# yarn global add moza
Place *.hbs
under ./.moza/
or ~/.config/moza/
directory. The contents are like this.
---
text: foo
---
<p>{{text}}</p>
Suppose you put this as html.hbs
. Then, The html
command is enabled.
moza --help
# Commands:
# html
And it is now possible to pass the text
flag.
moza html --help
# Variables
# --text
The entity of this
text
object is an option of yargs. When thestring
is set as above, it is converted as follows.text: default: foo
After that, just do it like this.
moza html --text baz path/to/baz.html
# <p>baz</p>
ls
Show enabled command list on put the local(./.moza/*.hbs
). When add --global
falg, global(~/.config/moza/*.hbs
) command list is shown.
moza ls
add
Can fetch .hbs
file from remote url. it put on local in default but this too can put on global using --global
moza add <url> --output foo.hbs
note
Show text of NOTE
part of the option of Front-matter.
# baz.hbs
# ---
# NOTE: baz note
# ---
#
# <p></p>
moza note baz
# baz note