Every component is expected to provide complete API documentation for every public API and a top-level README.md file that includes the following:
components/ Component/ .vars <- A list of variables that can be used by the template generators. README.md <- This is an auto-generated file. Do not modify it directly. docs/ <- All documentation source lives here. README.md <- The root index of your component's documentation. article.md <- An article that is linked to from your root index. assets/ <- All pngs, gifs live here.
Use the following template command as a starting point for component documentation:
./scripts/apply_template ComponentName scripts/templates/component/docs/README.md.template components/ComponentName/docs/README.md
This will create a README.md in your component's docs/
directory.
The .vars
defines common template variables for a component. This file should be a list of variable_name=value
lines.
The list of possible variables are:
component= component_name= a_component_name= root_path= icon_id= short_description= color_themer_api= typography_themer_api= themer_parameter_name= guidelines_short_link= guidelines_title=
If a variable is not provided and a template requires it, then the template will be generated with the missing variables shown as placeholders still.
To generate badges for a component, use the following snippet.
<!-- badges -->
To generate design and API links, use the following snippet. Note that this requires that you've installed jazzy.
<!-- design-and-api -->
To embed an article in the generated readme, use the following syntax:
- [Article title](article-file.md)
The following snippet will tell the readme generator to create a table of contents.
<!-- toc -->
Use the following snippet to generate installation docs for your component:
## Installation - [Typical installation](../../../docs/component-installation.md)
To generate the root README.md file for a given component, run:
./scripts/generate_readme ActivityIndicator
This will generate the root README.md from docs/README.md
and any linked-to articles.