Skip to content

Commit 89dea3f

Browse files
mperrottijoshblack
andauthored
Add guidance for writing minimum-viable component docs (#700)
* adds guideance for writing minimum-viable component docs * de-duplicates headings * rms duplicate info from CONTRIBUTING.md * Update content/guides/contribute/documentation.mdx Co-authored-by: Josh Black <[email protected]> * Update content/guides/contribute/documentation.mdx --------- Co-authored-by: Josh Black <[email protected]>
1 parent 61c0d81 commit 89dea3f

File tree

4 files changed

+52
-137
lines changed

4 files changed

+52
-137
lines changed

CONTRIBUTING.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,4 @@ You can read about different ways to contribute to the Primer Design System in [
44

55
If you are designing new components, please read the [design contribution guidelines](https://primer.style/contribute/design).
66

7-
If you are writing documentation, please read the [documentation guidelines](https://primer.style/contribute/documentation).
8-
9-
## Design guidelines template
10-
Even though some guidelines follow a different format, most can use the following template as a starting point. Required sections are indicated.
11-
12-
💡 The [action list component](https://primer.style/components/action-list) documentation is a good example of design guidelines.
13-
14-
| Section | Description | Notes |
15-
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
16-
| Name / Title (required) | Name of the component | Use the singular form. Keep it as short as possible. Use sentence case ("Select menu", and not "SelectMenu"). |
17-
| Description (required) | In a sentence, what is this component used for. | It should allow the reader to decide if they should continue reading or move on. Avoid going into specific usage and implementation detail. Don’t include guidelines. Don’t repeat words from the title to describe the content. |
18-
| Anatomy (required) | A labelled image of the most representative view(s) of the component, followed by a glossary of the constituent parts. | What smaller components constitute the larger pattern. |
19-
| Usage (required) | List of dos and donts covering the most important ways of how to (and not) use the component. This section can also be referred to as **Options**. | Consider when and how this component could be used incorrectly, what are the ideal ways of using it, special cases, alternative components (include links if needed). |
20-
| Hierarchy and placement | Where to use the component and how it interacts with the rest of the UI. | Include images and dos and donts of how the component should be used within the UI. |
21-
| Accessibility | Accessibility considerations when using the component. | Include keyboard navigation, descriptions, common mistakes to avoid. |
7+
If you are writing documentation, please read the [documentation guidelines](https://primer.style/contribute/documentation). |

content/components/component-documentation-guidelines/component-MVP-documentation-guidelines.md

-55
This file was deleted.

content/components/component-documentation-guidelines/component-documentation-guidelines.md

-67
This file was deleted.

content/guides/contribute/documentation.mdx

+51
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,57 @@ The description appears directly under the title of the component. It may be aut
169169
#### Related components and patterns
170170

171171
Any components or patterns that you may want to reference as related to this component. This could include components that are similar, or components that are used in conjunction with this component. See [Autocomplete](/components/autocomplete#related-components-and-patterns) as an example.
172+
173+
### Minimum-viable component documentation
174+
175+
One of the strategies to help Primer documentation become self-serve is to accurately represent the breadth of patterns and components we have available through our documentation.
176+
177+
To do this, we are increasing our coverage to include 100% of available-for-use components temporarily in the primer/design repository. Executing on this plan requires us to be practical and concise in terms of the depth of the documentation. In order to ensure we can reach 100% coverage, we're using a "minimum-viable documentation" approach.
178+
179+
Minimum-viable documentation should be:
180+
181+
- Accurate
182+
- Informative but concise
183+
- Visible
184+
185+
#### Minimum-viable component documentation structure
186+
187+
Aside from components we deem to be high touch and therefore requiring more in-depth documentation, the majority of components that are missing usage guidelines will be documented with the following minimum requirements:
188+
189+
##### Minimum-viable description
190+
191+
- brief text describing what the component is
192+
- link to available implementations
193+
- image, if applicable
194+
195+
##### Minimum-viable usage guidance
196+
197+
- proper usage guides
198+
- visual examples, such as an image or gif demonstrating what the component is
199+
200+
#### Add more documentation if it's readily available
201+
202+
If more information (than required above) is easily accessible and doesn't require a huge time investment to include, it should be added to to the minimum-viable component documentation. Some examples of this include listing out related components, cross-linking to Accessibility guidelines, and more.
203+
204+
### Tips and tricks
205+
206+
- A great starting off point is to consolidate existing documentation for the component that's already available. Places to look:
207+
- Figma ([Primer Web file](https://www.figma.com/file/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=179%3A3870))
208+
- [CSS documentation](https://primer.style/css/)
209+
- [React Storybook](https://primer.style/react/storybook/?path=/story/)
210+
- [Rails Lookbook](https://primer.style/view-components/lookbook)
211+
- [Interface guidelines component documentation](/components)
212+
- [Interface guidelines UI pattern documentation](/ui-patterns)
213+
- [Interface guidelines Accessibility documentation](/guides/accessibility)
214+
- Related components that may have guidelines applicable to your component
215+
- Take a look at an existing component that was documented using this approach, such as [Action menu](/components/action-menu)
216+
217+
#### Recommendations for tackling this work quickly and efficiently
218+
219+
- Work in pairs or with a small group. Dedicate 1-2 components per person, with each person in the group responsible for reviewing the others' PRs.
220+
- Timebox each component to x hour(s) for writing, x hour(s) for reviewing, and x hour(s) for writing revisions.
221+
- If you feel blocked by a lack of information about the component to write useful documentation, move on to documenting a different component until we can get the context we need.
222+
172223
## Review process
173224

174225
All pull requests for new and updated guidelines should be reviewed and approved by a member of the Design Infrastructure team.

0 commit comments

Comments
 (0)