compot
Component-like template engine.
Get Started
The recommended way to use compot is using gulp plugin.
Install
(sudo) npm install -g compot
usage
Command Line Intergace
compot src dest
Node.js
var compot = fs = ; var src = fs; compot;
compot.render(source, option, callback)
return converted html string.
parmeters
name | type | description |
---|---|---|
source | string | source html string |
option | Object | options(optional) |
option.root | string | root directory which is used in resolving import compot file |
callback | Function | called as callback(Error, string) |
example
<!-- main.html --> This is my custom tag
<!-- my-tag.html --> {{title}}
# CLI compot ./main.html ./build.html
The output is,
<!-- build.html --> Compot! This is my custom tag