The core kss API can be imported with:
var kss = require('kss');
The various constructors and methods can then be accessed with:
var kssStyleguide = new kss.KssStyleguide();
var kssSection = new kss.KssSection();
var kssModifier = new kss.KssModifier();
var kssParameter = new kss.KssParameter();
kss.parse();
kss.traverse();
Classes
Methods
(static) parse(input, options, callback)
Parse an array/string of documented CSS, or an object of files and their content.
File object formatted as { "absolute filename": content, ... }
.
This is called automatically as part of traverse
but is publicly
accessible as well.
Parameters:
Name | Type | Description |
---|---|---|
input |
Mixed | The input to parse |
options |
Object | Options to alter the output content. Inherited from |
callback |
function | Called when parsing is complete |
(static) traverse(directory, options, callback)
Traverse a directory, parse its contents, and create a KssStyleguide.
Callback returns an instance of KssStyleguide
Parameters:
Name | Type | Description |
---|---|---|
directory |
String | Array | The directory(s) to traverse |
options |
Object | Options to alter the output content (optional) |
callback |
function | Called when traversal AND parsing is complete |
- Source: