As a command line script
raml2html --help raml2html example.raml > example.html raml2html -t custom-template.nunjucks -p ./templates/ -i example.raml -o example.html
As a library
Using the default templates or your own Nunjucks templates
var raml2html = require('raml2html'); var configWithDefaultTemplates = raml2html.getDefaultConfig(); var configWithCustomTemplates = raml2html.getDefaultConfig('mytemplate.html', './templates'); // source can either be a filename, url, file contents (string) or parsed RAML object raml2html.render(source, configWithDefaultTemplates).then(function(result) { // Save the result to a file or do something else with the result }, function(error) { // Output error });
Read full article from kevinrenskers/raml2html
No comments:
Post a Comment