- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
Documentation Styleguide
        Ryan Johnson edited this page Jul 16, 2018 
        ·
        4 revisions
      
    Documentation should guide a consumer through the steps needed to implement a component in their application. The ideal path should navigate through documentation that increases in complexity, so that the simplest path is reached as early as possible.
A consumer should be able to copy and paste a snippet into their own application with little to no modification.
RECOMMEND
- Short, focused snippets
- Use native HTML elements
- Use HelixUI-defined elements
- Use HelixUI-defined class names
- Function placeholders, with instruction to define in consumer's application
AVOID
- Avoid long, complex snippets
- Avoid using assets defined in a 3rd party library.
- e.g., Bootstrap class names
 
- Function placeholders without further instruction
A component is a collection of elements that contribute to a larger set of behaviors.
RECOMMEND
- Static examples of the component in various states
- Interactive demos (optional)
- Cross-link between related components to aid discovery.
- e.g., from Grid to Layout (and vice versa)
 
- Cross-link to elements used in a component
- e.g., from Tabs to <hx-tabset>
 
- e.g., from Tabs to 
AVOID
- Do not cross-link to unrelated elements
- e.g., from Iconsto<hx-tabset>
 
- e.g., from 
- Do not cross-link to unrelated components
- e.g., from IconstoGrid
 
- e.g., from 
An element is an isolated unit that is often used in combination with other elements to provide more complex behavior.
RECOMMEND
- Document element metadata (parents, children, events, etc.)
- Document element attributes
- Document element properties
- Every attribute should have an associated property.
 
- Cross-link between related elements
- e.g., from <hx-tabset>to<hx-tablist>
 
- e.g., from 
- Cross-link to components the element helps compose.
- e.g., from <hx-tabset>toTabs
 
- e.g., from 
AVOID
- No interactive examples
- No empty elements
- Do not define or document elements lacking behavior.
 
- Do not reflect every property as an attribute.
- Not every property can be configured via attributes.
 
- Do not cross-link between unrelated elements
- e.g., from <hx-tabset>to<hx-tooltip>
 
- e.g., from 
- Do not cross-link to unrelated components
- e.g., from <hx-tabset>toBox
 
- e.g., from 
(tentative to PR#281)
- 
<div class="example">(bind VueJS logic to this element along with a[v-cloak]attribute)- 
<header>(optional, configuration for the demo)- 
<form class="beta-hxForm">- 
<div>or<p>- <label for="...">
- 
<input id="...">or<select id="...">or<textarea id="...">
 
- 
<fieldset>- <legend>
- 
<label>- 
<input type="checkbox">or<input type="radio">
 
- 
 
 
- 
 
- 
- 
<div>(live demo)
- 
<footer>(code snippet)- 
<pre>- <code>
 
 
- 
 
- 
