@economist/doc-pack

1.0.8 • Public • Published

doc-pack

This module provides documentation generation for provision-react-component generated modules.

How to use

Simply require the Handlebars helpers to help render templates:

Handlebars.registerHelper(require('@economist/doc-pack'));

You can also register the partials that come with the doc-pack:

Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/component-example.hbs')));
Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/component-preview.hbs')));
Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/component-readme.hbs')));
Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/component-tests.hbs')));
Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/layout.hbs')));
Handlebars.registerPartial(fs.readFileSync(require.resolve('@economist/doc-pack/partials/panel.hbs')));

It also provides templates one can render:

Handlebars.render(fs.readFileSync(require.resolve('@economist/doc-pack/templates/index.hbs')));
Handlebars.render(fs.readFileSync(require.resolve('@economist/doc-pack/templates/standalone.hbs')));

Usage with hbs-cli

hbs-cli can also be very helpful for rendering these:

hbs --helper @economist/doc-pack --partial @economist/doc-pack/partials/* -- @economist/doc-pack/templates/index.hbs

Dependents (0)

Package Sidebar

Install

npm i @economist/doc-pack

Weekly Downloads

1

Version

1.0.8

License

MIT

Last publish

Collaborators

  • wellingtonvieira
  • economist-org-bot