Jekyll built and Github Pages hosted API documentation and Internal API documentation
- Three column layout
- Fully responsive
- Auto-generated navigation based on category
Crux Docs were built with Jekyll version 3.1.6, but should support newer versions as well.
Install the dependencies with Bundler:
$ bundle installRun jekyll commands through Bundler to ensure you're using the right versions:
$ bundle exec jekyll serveThe source of each documented public endpoint is in the Paw file.
Internal endpoints are documented in the Internal Paw file.
The description contains the human readable notes and the code is generated from Paw. Any changes are made there. The Crux Aviator Generator extension is then used to generated the markdown file for each endpoint.
- Endpoints are organizaed in collections based upon domain
- Set the order of the collections with the position field in collection configuration in
_config.yml. - Set the order of the documents inside a collection by setting the position in front matter.
- Messages may be added to the documentation with the following classes:
info,error,success,warning
There are several different documentation pages:
/- The general public API documentation/internal/- The internal "undocumented" (unsupported) API documentation/file-specs/- Specifications for the "Crux Blessed" feed formats
Each collection or endpoint should have a visiblity setting.
The possible choices are:
all- Item will appear on all pagesapi- Item will appear on both public facing/and internal/internal/pagespublic- Item will appear only on public facing/pageinternal- Item will appear only on/internal/pagefile-specs- Item will appear only on/file-spec/page
Any other value will cause the item to be hidden.
Proposing changes to the API can be done using github.
- Create a new branch.
- Edit the markdown files for the specific endpoints you propose to change
- Create a pull request into master.
- Add the
proposed changelabel - Assign reviewers.
- After approval, change the label to
unreleaseduntil the relevant code is released. - During this time assign the PR to the documentation team to update PAW and flesh out the additional details. (example requests/responses etc.)
- After the doc team has completed their work, this branch should be merged coordinated with release of the change.
The file for a particular endpoint is found in the category folder pertaining to the call. You can see those categories on the left nav in the API documentation (login, organzations, billing, etc.)
Let’s say I wanted to add an api call at ‘/export/slap-dusty/’:
I would create a new file called slap_dusty.md inside the _export folder.
The contents would be:
---
title: /export/slap-dusty/
name: Slap Dusty
method: get
visibility: public
description: Give dusty a good slap.
---
### Request Parameters:
slap_type
: (string) Slap Type is the type of slap you are giving. e.g. back-handed, open-handed, butt
intensity
: (int) The intensity of the slap. 1-11
### Response Parameters:
uuid
: (string) Universal Unique Identifier for the slap
exclamation
: (string) The sound that came out of Dusty as you slapped him
### Expected Response Codes:
| Code | Name | Meaning |
|------|-------------------------------------------------------------------------|
| 200 | OK | Dusty was slapped |
| 400 | Bad Request | You failed at slapping Dusty. |
| 401 | Unauthorized | You haven't told me who you are to slap Dusty. |
| 403 | Permission Denied | You are not allowed to slap Dusty. |
| 404 | Not Found | Dusty is missing |
| 409 | Critical | Dusty is not a supplier |
| 500 | Internal Server Error | Dusty did something unexpected |
{% include links/response_codes.md %}
Note: Only document response codes in a table in the endpoint md file when they mean something special.