How To Edit The Documentation
Repository Setup Instructions
Fork the repository for canon react
Clone the repository
Create a branch
Update
package.jsonto the latest versionRun
scripts/update_gitbook(This script will install dependencies and npm install)
Adding a Static Page
Open
SUMMARY.mdand add section or subsection (Indented)Create the
.mdfile with the path given inSUMMARY.mdAdd content
Run
scripts/update_gitbookLook at the changes on
localhost:4000
Editing An Existing Page
Find the
.mdfile (or, for component pages, the.jsxfile) and make changesRun
scripts/update_gitbookLook 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
.mdfile for the component in thedocs/componentsdirectory (Will be the same html as every file in that directory)Add the component's section to
SUMMARY.mdCreate
.jsxfor component indocumentation/componentsdirectoryImport that component and add it in
documentation/components/View.jsx, similar to the othersImport that component in
documentation/components/AllComponents.jsxand 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.jsxadd aRoutefor the new component with the new view from #5:<Route path="docs/components/COMPONENT.html" component={ section.COMPONENTVIEW }/>Run
scripts/update_gitbookVerify changes are valid on
localhost:4000
Edit Page Styling
Open
styles/website.cssAdd 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
masterbranch of the repositoryRun
scripts/publish_gitbook(This will handle pushing the new documentation)Check site on
rackerlabs.github.io/canon-react