The Cadasta API docs provide documentation for Cadasta's REST API. The API docs are using Docbox, a React app that compiles Markdown documents into an HTML website.
If you'd like to contribute to this documentation, you'll need to edit Markdown files that live in content
. Each file here follows the Docbox format, as developed by MapBox.
Learn more about writing documentation using Docbox
To view what your changes will look like on the website, you need to compile the docs and run a local web server. Below are instructions for how to do this, modified from the Docbox instructions.
After you npm install
the project, you can run npm start
and its development server, budo will serve the website locally and update automatically.
###Requirements
- Node v4 or higher
- NPM
- Git
To run the site locally:
- Clone this repository
- using SSH:
git clone [email protected]:Cadasta/api-docs.git
- using HTTPS:
git clone https://github.com/Cadasta/api-docs.git
- using SSH:
npm install
npm start
- Open http://localhost:9966/
To exit npm start
, hit ctrl + C
.
We host API docs on Github pages; the current live site is pushed to gh-pages
branch. There is a shell script that simplifies deployment.
The script:
- Compiles the markdown files into an HTML website.
- Clones the
gh-pages
branch into a new directory. - Copies the compiled HTML website into that directory.
- Commits and pushes the contents to
gh-pages
(if there are changes).
To deploy API docs to gh-pages
run:
./deploy.sh
NOTE: Using the shell script will only work if you have set up SSH for Github correctly.