package
Bring ohm to your browser the easy way
npm install ohm-builderGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Bring ohm to your browser the easy way.
What's Ohm? Check it out.
This requires Node v4+
$ npm install --save-dev ohm-builderOhm has steps on defining your grammar for either the browser or node, but not both. Don't like having two sets of steps? Keep reading...
HTML's <script> tag only allows you to use the src= attribute if you're
using a path to a javascript file, not an Ohm grammar. Let's fix that.
Now you can write your HTML with script tags like: <script type="text/ohm-js" src="src/bash.ohm"></script>. Run this tool and you can statically generate a
new HTML file with the grammar included.
Try it out as an npm script:
// put this in package.json
"scripts": {
// ...
"build": "ohm-builder.js src/index.generator.html index.html"
},$ # Make your edits in src/index.generator.html
$ # Then run this command to build index.html
$ npm run buildIf you don't want to constantly reenter that command, check out watch to
automatically recompile your project:
$ npm install --save-dev watchThen, assuming your file is inside src/, put this in package.json:
"scripts": {
// ...
"build": "ohm-builder.js src/index.generator.html index.html",
"build:watch": "watch 'npm run build' src"
},