seldon
v0.4.4
Published
CSS documentation generator inspired by Hologram
Downloads
4
Readme
seldon
Nodejs CSS documentation generator inspired by hologram.
This is a work in progress. This project currently works as a simple node script, but don't expect unicorns and rainbows (yet).
1. Use structured comments in your CSS
2. Create a Seldon config file
config.json
{
"source": "../sq2/sass/",
"destination": "build/index.html",
"assets": [
"templates/static/"
],
"templates": {
"layout": "templates/layout.hbs",
"example": "templates/example.hbs"
}
}
Property | Description
---------------------- | --------------------------------
source
| any dir containing files with structured comments
destination
| target dir for built docs (will be created if it doesn't exist)
assets
| static assets you'd like to copy into the destination
dir (files will be copied to the root of destination
)
templates["layout"]
| main handlebars template
templates["example"]
| template used to render html_example
blocks
Running Seldon
$ npm install seldon --save-dev
Use as a node module
const Seldon = require('seldon');
Seldon.compile('./config.json');
Use from the command line
$ node seldon.js /path/to/config/config.json
3. Seldon creates a view for handlebars
{
myCategory: {
title: "My Category",
name: myCategory,
blocks: [ //components filed under this category
{
title: "My Component Title",
name: "myUniqueComponentName",
description: "(html string compiled from markdown, including html_example blocks)"
},
{
title: "My Other Component in this category",
name: "myOtherComponent",
description: "(html string compiled from markdown, including html_example blocks)",
children: [ /* nesting is supported with the `parent` convention from hologram docs */
{
title: "My child component",
name: "childComponent",
description: "(html string compiled from markdown, including html_example blocks)",
}
]
}
]
}
}
4. Go forth and template
You can write your own handlebars template to use with the data provided by seldon
.
Seldon?
This project is named after Hari Seldon, a fictional character in Isaac Asimov's Foundation.
In the series, Seldon is a pivotal figure who appears only in hologram form.
Special thanks to the good folks at Trulia who wrote hologram, the tool that inspired this project.