-
Notifications
You must be signed in to change notification settings - Fork 3
Documentation Files
All components should be documented in component-specific Markdown documentation files. If a component has variations (see Data Files and Demo Folders), they should also be documented in separate variation-specific documentation files.
Documentation files should have the following sections:
The only compulsory section is the Front Matter section. Other sections should be added where applicable.
All documentation files must begin a block of YAML set between triple-dashed lines.
Example:
---
title: Panel
state: complete
---This block is called front matter, and it is used in building the component library website.
| Key | Allowed values |
|---|---|
title |
Human readable component or component variation name |
state |
inprogress, inreview, complete
|
Description of the component or component variation. Component variations may leave this section out if the variation name is explanatory enough.
All properties ($this->render() parameters) exposed by the component should be documented in a table with columns for parameter name, type and possible default value.
Example:
| Property | Type | Default value |
|---|---|---|
attributes |
array | |
collapsed |
boolean | true |
collapseId |
string | |
content |
string | |
heading |
string | |
headingId |
string | |
headingLevel |
integer | |
headingTag |
boolean | true |
This section should contain notes on using the properties and anything else that is good to know about the functionality of the component.
Example:
Setting
collapseId,headingandheadingIdwill make the panel collapsible.
collapsedhas no effect unless the panel is collapsible.ARIA
roleandaria-levelattributes will be added to the headingdivif aheadingLevelis set andheadingTagis set tofalse.
Possible component variations should be documented in this section.
Example:
| Class | Description |
|---|---|
finna-panel-default |
Default variation |
finna-panel-borderless |
Borderless variation |
All global and component-specific Less variables used by the component should be documented in this section.