Open source app to read API docs offline.
Download a release from the release section, unpack it and start it. Or as a one-liner (for linux replace darwin
with linux
):
curl http://geller.io/rad/sad-1.0.0-darwin-amd64.xz | tar Jx > sad && ./sad
Then move the binary to a location that's on your PATH
and make it executable. For example, to add it to ~/bin
:
mv sad ~/bin/ && chmod +x ~/bin/sad
Just make sure you download packs before you go offline :)
All releases including snapshots are available here.
Alternatively, if you just want to give it a try there is a sample instance running here. Keep in mind though that the latency to that instance probably slows down the app's responsiveness. For example in my case, I have a latency of about 500ms to the sample instance while most requests render successfully in 40-100ms for an instance running on my tiny laptop.
Contents:
Start screen:
Searching Go's stdlib:
Searching Scala's stdlib using regular expressions:
Displaying installed and available packs:
- Clojure
- D3.js
- Django
- Go
- Java
- jQuery
- lodash
- Man pages
- MDN Javascript
- node.js
- PHP
- Python
- react.js
- Scala
While sad
includes a UI, it might be faster or more convenient to query
through one of the following integrations:
You can save some key strokes by assigning a custom search engine keyword to
rad
. For example in Chrome:
This will allow you to search for documentation by using a custom keyword
directly from the location bar. To speed things up even more, you can enable
live loading of documentation in rad
settings:
This will allow you to jump directly to the first result after you've entered a
query in the location bar (shift + →
and shift + ←
will cycle through the
search results if the query wasn't unique).
You can query a running rad
instance from Alfred
if you install the included workflow.
Then you can start a query with the configured keyword (the default is simply r
):
Selecting a result will open the documention in your default browser via rad
.
rad.coffee is a small HUBOT script that works with the Slack adapter:
You start a query with the keyword rad
and the results are links to a running
sad
instance.
I enjoy open source software and hacking on my projects while on the go or in cafes. And this project gave me an excuse to learn more about Go and react.js :)
rad is split into multiple components:
sad
: web app to serve API docs including a UI.pad
: app to package API docs.sap
: web app to serve documentation packs.
All three apps are written in Go and the sad
front-end uses react.js and plain
old HTML/Javascript. sad
uses web-sockets and Go's channels for streaming
results immediately to the UI.
Packs are zip archives with the following structure:
pack-name
|
|-- pack.json
|-- data.json
`-- html-contents
|
|-- first.html
`-- second.html
They contain a top-level directory that has the same name as the pack. The pack
name is used to identify the pack for searching, in the above example the name
is pack-name
. The top-level directory contains two data files that include
meta-data about the pack pack.json
and the documentation entries data.json
.
A pack.json
file has at least the following information: Name, Type, Version, Created, Description. Consider the following example:
{
"Name": "pack-name",
"Type": "go",
"Version": "3.1.4",
"Created": "2015-10-25T15:42:01.936261923+13:00",
"Description": "This is an <i>HTML</i> string containing source and copyright information."
}
The data.json
file contains the entries that sad
will index and search. An
entry is grouped under a path and contains member entries that are defined by a
name and a relative link to their location within the pack archive. Consider the
following example:
[
{
"Path": "com.example.super",
"Members": [
{
"Name": "Driver",
"Target": "html-contents/first.html#Driver"
}
]
},
{
"Path": "com.example.super",
"Members": [
{
"Name": "Runner",
"Target": "html-contents/second.html#Runner"
}
]
}
]
The currently included packs are driven by my use and what friends are interested in -- if you'd like to see another pack included please create an issue or even send me a wrapped pack :)
- Dash - Very mature OSX app with lots of packs available.
- DevDocs - Web app that supports offline mode with lots of packs especially for front-end tech.
Made with ❤ in Piha.