A low latency documentation API powered by Google Drive and Go.
An incredibly fast documentation API powered by Google Drive written purely in Go.
This API connects with your Google Drive and provides RESTful endpoints which return the pages within Drive in a organized and usable format. With this API, beautiful (or ugly) user interfaces can be created and reused anywhere you need to display documentation online.
Features:
Give authors access to the activated folder using the typical means of doing so
within Drive. Then authors can create pages and folders within the activated
folder. Pages can have children infinitely deep by using directories. Pages and
folders are both made public and ordered by using a special format in their page
name.
|n| Page Title
The number between the two pipes (n
) is what the menu is sorted by. It can be
any number. If a page or directory does not have this format, it will not be
public. This is useful when writing pages that should not yet be public (aka
drafts).
Lastly, if zero is used (|0|
), this is considered to be the landing page of
the sub directory. If there is no directory, it is used as the default response,
or “homepage”. If a |0|
is not provided for the root or sub directory, the
return menu item will have a type
of dir
instead of file
.
Formatting within the document is done by using Google’s wysiwyg, as usual. Allwrite then translates the content to well formatted html and markdown. Both the html and markdown formats are returned from the API so you may use which ever works best for you.
Formatting guide:
<h1>
, <h2>
, and <h3>
).First, you should generate a OAuth 2.0 json file here. Select
“other” for Application Type then place the client_secret.json file on the
server you’ll be running the API.
Head to your server and run the following to install or update Allwrite:
curl -L https://github.com/LevInteractive/allwrite-docs/blob/master/install.sh?raw=true | sh
If it’s you’re installing for the first time import the postgres schema:
curl -O https://raw.githubusercontent.com/LevInteractive/allwrite-docs/master/store/postgres/sql/pages.sql
psql < pages.sql
Finally, try to run the server in the foreground:
# Download the environmental variables. These need to available to the
# user/shell so allwrite can connect.
curl https://raw.githubusercontent.com/LevInteractive/allwrite-docs/master/creds.example.sh > creds
# Configure. Make sure these variables are correct.
vim creds
# Load the variables.
source creds
Start the server.
# Run the server. You'll eventually want to run this in the background and use
# something like nginx to create a reverse proxy.
allwrite s
Once you confirmed that it works, setup something like supervisord to run it for
you. You can see an example configuration file for supervisord here
See response examples here.
See docs for development here.
After installing, you’ll have access to the CLI
$ allwrite-docs