Module with pluggable themes to generate html from the API Blueprint JSON.
var cipolla = require('cipolla');
var generator = new cipolla(require('cipolla-test-theme'));
generator.render(blueprintJSON, function (err, html) {
});
generator.renderToFile(blueprintJSON, 'path/to/file.html', function (err) {
});
theme
- theme plugin, needs the following interfacetheme(options)
- theme constructorrender(blueprint, callback)
generates the html, the callback has the signaturefunction(err, html)
err
any error during renderhtml
compiled html
renderToFile(blueprint, pathToFile, callback)
generates the html and saves it to a path, the callback has the signaturefunction(err)
err
any error during render to file
themeOptions
- optional options object to pass to the theme constructor
When plugin a theme into cipolla
you should implement this interface:
Constructor(options)
constructor for the themesetOptions(options)
function that set the options passed to the theme from cipollarender(blueprint, callback)
function that renders templates and returns an html on callback, callback parameterserr
if there's any error presenthtml
render html from the template
renderToFile(blueprint,pathToFile, callback)
function that renders template directly to a file, callback parameterserr
if there's any error