Organizing your Style Guide
lsg-quickstart-organizing
After you've documented your first stylesheet, if you generate the site you won't see your stylesheet page anywhere in the sidebar. Even though the page has been generated, it isn't linked up to the rest of the site because you need to tell DocumentJS where to put it.
We have two more tags so you can organize your style guide:
@parent
to tell DocumentJS where to put links to your pages and stylesheets@group
to organize links in the sidebarNew Tag:
@parent
The
@parent
tag organizes your site by telling DocumentJS where to put a link to your page or stylesheet.Example
The following tells DocumentJS that the parent page of
Typography
is our main page,styleguide
. After using this tag, theTypography
page will show up in the sidebar in the first position.Arguments
The
NAME
argument is the unique name of the parent. TheORDER
argument allows you to specify the order in which this child shows up in the sidebar. By default, children will be ordered alphabetically.New Tag:
@group
The
@group
tag organizes pages with headings in the sidebar. On the left of this page, the groups are "INTRO," "SETUP", "YOUR FIRST PAGE", "WRITING", and "CUSTOMIZING".Example
The group tag is used on a parent page. In this case, you will want to specify groups in
stylesheet.md
:Arguments
The
NAME
argument is the unique name. You'll use this as an argument for@parent
in pages or stylesheets that belong in this group.The
ORDER
specifies the order in which groups should appear in the sidebar. By default, they will be organized alphabetically.The
TITLE
is displayed as a heading in the sidebar.Putting Stylesheets into Groups
Once you've specified groups in
stylesheet.md
, you just need to make those groups the@parent
of your stylesheets (instead of using the base page). If you want to make put your Typography stylesheet in the "Baseline Elements" group, put this intypography.less
Notice that we are using the name we declared as a
@group
as the parent.Next Page