npm install json-schema-static-docs
const JsonSchemaStaticDocs = require('json-schema-static-docs');
( async () => {
let jsonSchemaStaticDocs = new JsonSchemaStaticDocs({
inputPath: './schema',
outputPath: './docs'
});
await jsonSchemaStaticDocs.generate();
console.log('Documents generated.');
})();
Templates are authored in handlebars.js.
The default template is templates/markdown/schema.hbs.
You can provide your own custom templates using the templatePath
option.
In the example below you will be expected to provide `./your-templates/schema.hbs'.
const JsonSchemaStaticDocs = require('json-schema-static-docs');
( async () => {
let jsonSchemaStaticDocs = new JsonSchemaStaticDocs({
inputPath: './schema',
outputPath: './docs',
templatePath: './your-templates/'
});
await jsonSchemaStaticDocs.generate();
console.log('Documents generated.');
})();