Accepts custom parsers too, so you can replicate any templating language. We made a language that almost exactly matches jade/pug’s features : )
Reshape
Reshape is a tool for transforming static html with javascript plugins.
Think of it like postcss or babel, but for html.
<section> <p>Hi, I’m {{ name }}!</p> <p md>look, **markdown**!</p> </section>
const reshape = require('reshape') const expr = require('reshape-expressions') const content = require('reshape-content') const marked = require('marked')
reshape({ plugins: [ expr(), content({ md: marked }) ] }).process(htmlInput) .then((res) => { res.output({ name: 'reshape' }) })
<section> <p>Hi, I’m reshape!</p> <p>look, <strong>markdown<strong>!</p> </section>
Try It Out!
We've Got Features for Days!
-
-
Can produce client-side templates for rich javascript apps, or static html. Works in static sites and on servers!
-
Reshape’s simple, clear plugin API makes it easy to make your own plugin. Plus, we have tons in the plugin directory!
-
Super clear and explicit error traces mean no confusion for users when dealing with any plugin!
-
If a feature exists, you can use it with reshape. We already have plugins for layouts, includes, loops, conditionals, and more.
Getting Started
Reshape is written in node.js and can be used with node v6 or higher. You can install it through npm as such:
npm install reshape
Reshape has a very simple API. Just call it as a function, passing in optional filename, plugins, parser, and/or generator, call .process(html)
with some html, and it will return a promise containing the output, just like the example at the top of this page. For more details, check out the readme on github.