1.0.0 • Published 9 years ago
trucks-transform-usage v1.0.0
Usage Transform
Generate component usage examples
Install
npm i trucks-transform-trim --save-devFor the command line interface see trucks-cli.
For each component module definition scan the input document for elements matching the component tag name and write them to usage HTML files.
Usage
Use the usage key to configure this transform:
const trucks = require('trucks');
trucks(
{
files: ['components.html'],
transforms: ['usage'],
usage: {
main: false,
files: true
}
}, (err, state) => {
if(err) {
throw err;
}
console.log(state);
}
);API
trim
public trim(state, conf)Removes leading and trailing whitespace from inline styles and scripts.
When the lines option is given each line is stripped of leading
whitespace that matches the pattern regular expression.
Returns map of visitor functions.
stateObject compiler state.confObject transform plugin configuration.
Options
inlineBoolean=true only replace inline elements.linesBoolean=true strip each line.templatesBoolean=false also trim template elements.
License
MIT
Created by mkdoc on August 4, 2016
1.0.0
9 years ago