giuseppeg / suitcss-toolkit

A toolkit of UI components and utilities
Other
15 stars 2 forks source link

Modular docs system #5

Open giuseppeg opened 8 years ago

giuseppeg commented 8 years ago

Suitcss doesn't suggest any way to document components. Therefore README.md and tests are the only places to read about the component and learn how to use and test it, look at some examples etc.

It would be great to have a standard and modular docs system. Docs should be bound to the package repo/folder.

The docs folder may contain:

Sections are plain Markdown files and are atomic. They are similar to partial templates. Examples:

N.B. the filenames are not standard and should not be enforced i.e. one can add as many md files as he/she wants and they will all be available to use.

Entry point

index.md is a reserved section and represents the docs entry point. It can either be:

When index.md is in the docs folder an additional compilation step could replace all of the links to the sections with their actual content i.e. inline the sections content.

Examples

Examples are probably the most tricky part because suitcss is only about styling and any example uses hardcoded markup. As consequence of that any generated styleguide may not be live/living.

Examples should live in a subfolder (say examples). Each example can have an optional *examplename*-readme.md companion which hosts the example description.

In my opinion examples should be plain html files and self contained:

If organised like that examples could be reused in tests (or used to automatically generate test pages).

Feedbacks are welcome