• Stars
    star
    1,136
  • Rank 41,003 (Top 0.9 %)
  • Language
    CSS
  • License
    ISC License
  • Created almost 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

REST API documentation generator


docbox

Circle CI

Docbox is an open source REST API documentation system. It takes structured Markdown files and generates a friendly two-column layout with navigation, permalinks, and examples. The documentation source files that Docbox uses are friendly for documentation authors and free of presentational code: it's Markdown.

Demo documentation

Docbox is a JavaScript application written with React. The core magic is thanks to the remark Markdown parser, which enables the layout: after parsing a file into an Abstract Syntax Tree, we can move examples to the right, prose to the left, and build the navigation system.

It has a supercharged test suite. Our tests check for everything from broken links to invalid examples and structure problems: this way, the application is only concerned with output and you can proactively enforce consistency and correctness. We even extract JavaScript examples from documentation and test them with eslint

When you're ready to ship, Docbox's build task minifies JavaScript and uses React's server rendering code to make documentation indexable for search engines and viewable without JavaScript.

Writing Documentation

Documentation is written as Markdown files in the content directory, and is organized by the src/custom/content.js file - that file requires each documentation page and puts them in order. This demo has a little bit of content - content/example.md and content/introduction.md, so that there's an example to follow.

Testing-driven

Docbox's test suite is an integral part of the design: it's designed to catch any error that would produce invalid documentation and also designed to be extended with custom rules for your documentation standards. Remember to run npm test if anything looks funky, and if you have a standard you want to enforce, to enforce it automatically by writing a test!

Customization

All custom code - code that relates to brands and specifics of APIs - is in the ./src/custom directory. Content is src/custom/content.js and brand names & tweaks are in src/custom/index.js, with inline documentation for both.

Development

We care about the ease of writing documentation. Docbox comes with batteries included: 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:

  1. Clone this repository
  2. git clone https://github.com/tmcw/docbox.git
  3. npm install
  4. npm start
  5. Open http://localhost:9966/

Tests

Tests cover both the source code of Docbox as well as the content in the content/ directory.

To run tests:

  1. Clone this repository
  2. git clone https://github.com/tmcw/docbox.git
  3. npm install
  4. npm test

Deployment

The npm run build command builds a bundle.js file that contains all the JavaScript code and content needed to show the site, and creates an index.html file that already contains the site content. Note that this replaces the existing index.html file, so it's best to run this only when deploying the site and to undo changes to index.html if you want to keep working on content.

  1. Clone this repository
  2. git clone https://github.com/tmcw/docbox.git
  3. npm install
  4. npm run build

Using docbox

FAQ & See Also

Props to Tripit's Slate project, which served as the inspiration for Docbox's layout. We also maintain a list of similar projects.

More Repositories

1

big

presentations for busy messy hackers
JavaScript
3,268
star
2

awesome-geojson

GeoJSON utilities that will make your life easier.
2,084
star
3

mapmakers-cheatsheet

popular tourist destinations on the wild and exciting quest to make web maps in fewer tries
411
star
4

stickshift

A clean & modern SQL data interface.
JavaScript
373
star
5

systemfontstack

HTML
288
star
6

literate-raytracer

a literate raytracer in javascript
HTML
193
star
7

wah

a slightly higher-level language superset of webassembly
Clojure
150
star
8

geojson.net

JavaScript
150
star
9

perception

collected & summarized research on the effectiveness of visualization techniques
148
star
10

gedcom

A simple GEDCOM parser that focuses on translating GEDCOM structure into JSON.
TypeScript
145
star
11

github-best-practices

how to use this dang site!
144
star
12

wcag-contrast

WCAG contrast ratio measurement and scoring
JavaScript
120
star
13

notfoundbot

fix & archive outgoing links on your website
TypeScript
109
star
14

mistakes

line-oriented presentation-optimized live coding in javascript
JavaScript
108
star
15

happen

make real events happen in-browser, with pure DOM and optional $
JavaScript
105
star
16

biggie

everyone can get big
JavaScript
104
star
17

simpleopendata

simple guidelines for publishing open data in useful formats
HTML
89
star
18

flair

Cocktail browser interface and dataset
Elm
81
star
19

geojson-random

Generate random GeoJSON features.
JavaScript
73
star
20

d3-axis-for-react

d3-axis for React
TypeScript
63
star
21

minute-agent

a keycounter for osx
Objective-C
57
star
22

heard

a minimal, local listener for iTunes data.
Objective-C
53
star
23

geojson-flatten

flatten multipart geometries and geometrycollections in geojson
JavaScript
50
star
24

today-i-learned

keeping track of things i never would have guessed but were true anyway
45
star
25

running-for-nerds

like running, but for nerds
42
star
26

react-tangle

A tangle.js-style numeric input for React.js.
JavaScript
39
star
27

node-canvas-animation-example

An example of how to use node-canvas to create an animation as a GIF and a Video
JavaScript
38
star
28

presentations

Presentations I've given
JavaScript
36
star
29

minute

a personal data visualizer
JavaScript
36
star
30

quotes

guiding principles.
34
star
31

stickshift-app

Stickshift as a desktop application.
JavaScript
33
star
32

sitemap-static

Make a sitemap for a static website based on files on disk
JavaScript
31
star
33

testing-webgl

Notes on continuous-integration testing WebGL applications and libraries.
30
star
34

togeojson-cli

toGeoJSON in the console
JavaScript
28
star
35

nvim

My .vim
Lua
28
star
36

dx-spec

Issue (and spec) repository for the development of a spec that would succeed JSDoc.
27
star
37

relative-luminance

Calculate the relative luminance of an RGB triplet color.
JavaScript
27
star
38

coffeedex

openstreetmap but for coffee
JavaScript
27
star
39

make-relative

JavaScript
26
star
40

windchime

assistive / ambient technology for writing software
Objective-C
26
star
41

d12

documentation future experiment
JavaScript
25
star
42

bespoke

Image resizing for macwright.org. Full, medium, small, and original, in jpeg and webp.
JavaScript
25
star
43

sometimemachine

openstreetmap history analysis
HTML
23
star
44

obsy

livecoding observable-ish experiment, just an experiment
JavaScript
22
star
45

k-means

k-means clustering
JavaScript
21
star
46

fischer-color

eric fischer's perceptually-friendly color system
JavaScript
20
star
47

memory-geojson

experimental memory-efficient geojson representation
JavaScript
19
star
48

bookish-api

bookish api
JavaScript
18
star
49

canvas-animation-maps-example

http://www.macwright.com/2015/08/31/canvas-animations-on-maps.html
JavaScript
18
star
50

openstreetmap-landscape

writing about mapping is like dancing about architecture
17
star
51

trump.mistakes

HTML
16
star
52

visualization-cheatsheet

data ⇢ representation
16
star
53

ditty

JavaScript
15
star
54

pig

pig is a presentation system for beautiful people
JavaScript
14
star
55

awesome-coding-paradigms

14
star
56

myland

Scraping and displaying TrafficLand data.
Python
13
star
57

projectityourself

a website that encourages people to make their own projections
JavaScript
13
star
58

geos-wasm

C
13
star
59

bookish

JavaScript
13
star
60

zig-raytracer

a webassembly/zig raytracer
Zig
13
star
61

literate-game-of-life

a literate javascript implementation of conway's game of life
CSS
12
star
62

identify-hate

identifies hate groups on GuideStar
JavaScript
12
star
63

landpatch

a visualization of landsat collection paths through the northern hemisphere
JavaScript
12
star
64

the-united-states-of-america

12
star
65

dcmr

making the DC Municipal Regulations Accessible
JavaScript
12
star
66

running

acquiring, processing, and visualizing running data
Python
11
star
67

big-themes

themes for big
JavaScript
11
star
68

truisms

truisms for your lock screen
EJS
11
star
69

are-we-flow-yet

A CLI tool that scans a source directory and gives statistics and a big list of files that are and are not flow-annotated.
JavaScript
10
star
70

shotspotter

gunshot data from shotspotter
JavaScript
10
star
71

clone-pull-requests

re-file pull requests from one repository to another
JavaScript
10
star
72

incremental-eval

run javascript line-by-line
JavaScript
9
star
73

deuteranopia

Simulate the prevalent deuteranopia form of colorblindness.
JavaScript
9
star
74

bookish-old

semi-universal book identification code converter
JavaScript
8
star
75

got-links

download multiple pages of results from a paged endpoint
JavaScript
8
star
76

treeui

A simple collapsible tree ui, for file selectors and the like.
JavaScript
7
star
77

dc-ownership

Tinkering with Real Estate ownership and assessment data.
Go
7
star
78

exif-extract

extract exif data from files dropped, including positions and thumbnails
JavaScript
7
star
79

orphanarium

Find non-required files in your source tree.
JavaScript
6
star
80

live-require

simple script-tag includes
JavaScript
6
star
81

demo

lightweight demos
JavaScript
6
star
82

awesome-converters

just a list of the tools for converting things
6
star
83

howsmy

Python
6
star
84

rust-geojson-random

Rust
5
star
85

gandi-ipfs

JavaScript
5
star
86

lodebuilder

loading gif builder
JavaScript
5
star
87

coords

parse and generate decimal and sexagesimal latitude longitude coordinates
JavaScript
5
star
88

taurus

Swift
5
star
89

channel-arc

HTML
4
star
90

flacbox-sync

JavaScript
4
star
91

snap-archive

archive a specific geographical area of snapchat posts
JavaScript
4
star
92

entropy

research into random
4
star
93

ukulele

The code to uke.tommacwright.com
Ruby
4
star
94

podcast-luddite

Shell
4
star
95

stories

narrative-specific open data or accessibility projects
Elm
4
star
96

turtle

turtle, on the internet
JavaScript
4
star
97

terrarium-stream

an interface to terrarium that provides a readable & writable stream
JavaScript
3
star
98

geo-codepoints

generates sets of unicode codepoints for each square on the earth
JavaScript
3
star
99

teenmom

a band, a plan, a nalp
CSS
3
star
100

npm-add-repo

Add a repository field to a package.json that doesn't have one.
JavaScript
3
star