Module: kss/generator/handlebars

The kss/generator/handlebars module loads the kssHandlebarsGenerator object, a KssGenerator object using Handlebars templating.

var kssHandlebarsGenerator = require('kss/generator/handlebars');
Source:

Methods

(static) generate(styleguide)

Generate the HTML files of the style guide given a KssStyleguide object.

Parameters:
Name Type Description
styleguide KssStyleguide

The KSS style guide in object format.

Source:

(static) generatePage(styleguide, sections, root, sectionRoots, partials)

Renders the handlebars template for a section and saves it to a file.

Parameters:
Name Type Description
styleguide KssStyleguide

The KSS style guide in object format.

sections Array

An array of KssSection objects.

root string

The current section's reference.

sectionRoots Array

An array of section references for all sections at the root of the style guide.

partials Object

A hash of the names and data of the registered Handlebars partials.

Source:

(static) init(config)

Initialize the style guide creation process.

This method is given a configuration JSON object with the details of the requested style guide generation. The generator can use this information for any necessary tasks before the KSS parsing of the source files.

Parameters:
Name Type Description
config Object

Configuration object for the style guide generation.

Source: