Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(documentation): added (sub)groups documentation again #1262 #1334

4 changes: 3 additions & 1 deletion packages/core/src/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ const ui_builder = function () {
patternName: _.startCase(
isSubgroupPattern ? pattern.patternSubgroup : pattern.patternGroup
),
patternDesc: '',
patternDesc: isSubgroupPattern
? pattern.patternSubgroupData.markdown
: pattern.patternGroupData.markdown,
patternPartial: `viewall-${pattern.patternGroup}-${
isSubgroupPattern ? pattern.patternSubgroup : 'all'
}`,
Expand Down
15 changes: 14 additions & 1 deletion packages/docs/src/docs/pattern-documenting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sitemapPriority: '0.8'
sitemapChangefreq: 'monthly'
---

Pattern documentation gives developers and designers the ability to provide context for their patterns. The documentation file consists of Markdown with YAML front matter. It should follow this format:
Pattern documentation gives developers and designers the ability to provide context for their patterns and subgroups. The documentation file consists of Markdown with YAML front matter. It should follow this format:

```
---
Expand Down Expand Up @@ -55,6 +55,19 @@ We'd name our documentation file:
atoms/button/button~red.md
```

## Documenting Subgroups


To document pattern subgroups, you need to create a companion `.md` file for that subgroup. For example create `_patters/atoms/buttons/_buttons.md` for a pattern subgroup. In the `.md` file, the above concept can be applied. The doc-file resolving works the following `{patternsRoot}/{pattern-group folder name}/{pattern-sub-group folder name}/_{pattern-sub-group raw name without prefixes}.md`


```markdown

This is a *Markdown* description of the subgroup button.
```

In the future we'll even also provide the possibility to document groups as well.

## Adding More Attributes to the Front Matter

A future update of Pattern Lab will support more front matter attributes including: excludeFromStyleguide and links.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
order: 0
---

A graphical element that indicates interactivity.