How To Edit The Documentation
Repository Setup Instructions
Fork the repository for canon react
Clone the repository
Create a branch
Update
package.json
to the latest versionRun
scripts/update_gitbook
(This script will install dependencies and npm install)
Adding a Static Page
Open
SUMMARY.md
and add section or subsection (Indented)Create the
.md
file with the path given inSUMMARY.md
Add content
Run
scripts/update_gitbook
Look at the changes on
localhost:4000
Editing An Existing Page
Find the
.md
file (or, for component pages, the.jsx
file) and make changesRun
scripts/update_gitbook
Look at the changes on
localhost:4000
Adding a Component
If the component is from a new release, update package.json and npm install
Create the
.md
file for the component in thedocs/components
directory (Will be the same html as every file in that directory)Add the component's section to
SUMMARY.md
Create
.jsx
for component indocumentation/components
directoryImport that component and add it in
documentation/components/View.jsx
, similar to the othersImport that component in
documentation/components/AllComponents.jsx
and create the React class for it:export const COMPONENT = React.createClass({ render() { return( <ComponentView id="COMPONENT-ID" name="COMPONENT NAME" > <COMPONENT_SECTION /> </ComponentView> ); } });
In
documentation/documentation.jsx
add aRoute
for the new component with the new view from #5:<Route path="docs/components/COMPONENT.html" component={ section.COMPONENTVIEW }/>
Run
scripts/update_gitbook
Verify changes are valid on
localhost:4000
Edit Page Styling
Open
styles/website.css
Add styling there
Run
scripts/update_gitbook
Submit Changes
Create pull request by pushing the branch
Get pull request accepted by someone with access, then have them run the following step on the
master
branch of the repositoryRun
scripts/publish_gitbook
(This will handle pushing the new documentation)Check site on
rackerlabs.github.io/canon-react