emiloberg / markdown-styleguide-generator

Will search all your (s)css files for comments and generate a single page html styleguide
GNU General Public License v3.0
62 stars 19 forks source link

Having multiple code examples on the same chapter #7

Closed luukhartsema closed 8 years ago

luukhartsema commented 8 years ago

In the screenshot I noticed the pagination chapter in the styleguide contained two sections (Pagination and Pagination/alignment). I wonder what markup is needed to achieve this.

Till now i've only been able to have one code example per chapter. Would appreciate your help. Thanks in advance.

emiloberg commented 8 years ago

Hi!

Might not be totally clear in the README (https://github.com/emiloberg/markdown-styleguide-generator#line-2), but:

Every style guide comment must have a heading. # is the Markdown syntax for a heading (equivalent to h1). The name of this section will be Glyphs (which will be shown in the menu). The subsection will be Style (which will be shown in the menu when it's expanded). The heading (the part before the slash) is required, the slash and the subsection is optional.

So what this means is that if you create the style guide section

# Pagination

and then create

# Pagination/Sizes

They'll be on the same chapter.

Here's an example from the actual file the screenshot is created from:

/* SG
# Pagination
* Use `.disabled` for unclickable links and `.active` to indicate the current page.
*/

/* SG
# Pagination/Alignment
* Add one of two optional classes to change the alignment of pagination links: `.pagination-centered` and `.pagination-right`.
*/
luukhartsema commented 8 years ago

Thanks very clear now!