We built an awesome system for our REST API documentation and want to share it with you. Docbox is a Mapbox community open source project and the core of our amazing new REST API documentation.

Docbox is a responsive website generated from Markdown documentation content. It’s dynamically updated with React, but bootstrapped using React’s server rendering, so the page is easily indexed by search engines and lightning fast to load.

Just like retext-mapbox-standard, Docbox uses the remark library to interact with Markdown at a deep level, turning readable Markdown files into a structured website. It makes the process of writing documentation similar to and as simple as writing a blog post.

This is the code that powers Mapbox’s documentation, so it has a few advanced features. With multi-language examples, Docbox can toggle between different code samples. It has a sophisticated test suite that identifies broken links, invalid examples, and structure problems ahead of time. We even extract inline JavaScript examples and test them with eslint to make sure they’ll work properly.

Try out Docbox for your API documentation and contribute on the open source project!