2018-02-13 03:50:31 -08:00
|
|
|
---
|
2018-02-19 02:55:30 -08:00
|
|
|
path: "/contributing/writing-documentation"
|
2018-02-13 03:50:31 -08:00
|
|
|
title: "Writing Documentation"
|
|
|
|
hasPlayground: false
|
|
|
|
---
|
|
|
|
|
|
|
|
## Writing Documentation
|
2018-02-16 03:00:27 -08:00
|
|
|
|
2018-02-16 06:42:01 -08:00
|
|
|
Documentation pages are generated from Markdown files in `contents/`.
|
|
|
|
The files are organized in 4 sections/folders (getting-started, properties,
|
|
|
|
examples, contributing) which are dynamically listed on the docs overview page.
|
|
|
|
The Markdown files should contain a header with metadata.
|
2018-02-16 03:00:27 -08:00
|
|
|
|
|
|
|
```markdown
|
|
|
|
---
|
|
|
|
path: "docs/flexDirection"
|
|
|
|
title: "Flex Direction"
|
|
|
|
hasPlayground: true
|
|
|
|
initialPlayground: eyJ3aWR0aCI6IjYwMCIsImhlaWdodCI6NTAwLCJjaGlsZHJlbiI6W3t9LHt9LHt9XX0=
|
|
|
|
---
|
|
|
|
```
|
|
|
|
|
2018-02-16 06:42:01 -08:00
|
|
|
- The `path` indicates the URL path this page will be available at.
|
|
|
|
- The `title` is used as the page's HTML-title and when referencing
|
|
|
|
the file from the documentation overview.
|
|
|
|
- The `hasPlayground` property indicates whether this documentation
|
|
|
|
has an associated playground to test out the documented feature.
|
|
|
|
- The `initialPlayground` property is only relevant for documentation
|
|
|
|
pages with playgrounds and contains the initial playground state.
|
|
|
|
This base64 string is a reference to the hash (content after #)
|
|
|
|
of a [playground](/playground) url.
|
2018-02-16 07:38:27 -08:00
|
|
|
- The `redirect` property allows to redirect to the other page, the path of which is mentioned in the property `path`.
|
|
|
|
|
2018-02-16 03:00:27 -08:00
|
|
|
|
2018-02-16 06:42:01 -08:00
|
|
|
Within the markdown of a documentation page which has an associated
|
|
|
|
playground you can add controls to let the user play around with the feature
|
|
|
|
directly from the documenation page.
|
2018-02-16 03:00:27 -08:00
|
|
|
|
2018-02-16 06:42:01 -08:00
|
|
|
```markdown
|
2018-02-16 03:00:27 -08:00
|
|
|
<controls prop="alignContent"></controls>
|
|
|
|
```
|
2018-02-16 07:38:27 -08:00
|
|
|
|
|
|
|
If you would like to redirect to another page (potentially an external link) the header would look something like this.
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
---
|
2019-04-04 08:48:12 -07:00
|
|
|
path: "/playground?eyJ3aWR0aCI6IjYwMCIsImhlaWdodCI6NTAwLCJjaGlsZHJlbiI6W3t9LHt9LHt9XX0="
|
2018-02-16 07:38:27 -08:00
|
|
|
title: "Flex Direction"
|
|
|
|
redirect: true
|
|
|
|
---
|
|
|
|
|
|
|
|
```
|