PostCSS plugin to collect documentation from structured comments in CSS.
npm install postcss-seldon[PostCSS] plugin to collect documentation from structured comments in CSS.postcss-seldon attaches an object, docs, to the postcss result. Nothing more, nothing less.
Use this plugin with your favorite templating language to generate CSS documentation.
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/akdetrick/postcss-seldon.svg
[ci]: https://travis-ci.org/akdetrick/postcss-seldon
Add structured documentation comments and postcss-seldon will provide an object representing all
comments found in your CSS.
Documentation comments begin with /**doc and a newline, followed by yaml frontmatter. There are no
required yaml properties; use whatever will work best for your documentation use case. Following the
frontmatter, you can use github-flavored markdown.
``css
/**doc
---
title: My Cool Class
foo: bar
keywords:
- valid
- yaml
- here
---
*/
.foo {
/ Input example /
}
`
#### result.doc`js`
[
{
meta: {
title: 'My Cool Class',
foo: 'bar',
keywords: ['valid', 'yaml', 'here']
},
markdown: "# This is markdown",
html: "This is markdown
"
}
]
`jsresult.doc
postcss([ require('postcss-seldon') ])
.then(result => {
// contains documentation extracted from CSS``
})
See [PostCSS] docs for examples for your environment.
----
This project was inspired by hologram.
In Isaac Asimov's _Foundation_ trilogy, Hari Seldon is a character that appears only in _hologram_ form.