Mapbox Open Sources API Documentation System Docbox

Mapbox, a mapping platform provider, has open sourced an API documentation system that it developed to create the documentation for its own REST API. The system is called Docbox and uses Markup and the remark Markdown parser to generate a responsive website based on the React JavaScript framework.

The documentation websites that Docbox generates have a multi-column layout with navigation on the left, documentation in the middle, and example code on the right. The layout is based on the Slate API documentation generator created by trip planning startup TripIt.

Docbox requires Node and Node's package manager, NPM. Once a Docbox project is ready for production, a build task minifies the JavaScript and React's server-side rendering functionality is used to ensure that the final output loads quickly is accessible to search engine crawlers and users without JavaScript.

In addition to the ability to create good-looking documentation, Docbox includes a number of advanced features. As Mapbox's Tom MacWright explains, "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."

Docbox, which is available on GitHub, is one of a growing number of tools API providers can use to create high-quality documentation for their APIs. Many tools are associated with increasingly popular API definition languages like RAML and Swagger

Be sure to read the next API Design article: Understanding The Role of APIs In Microservice Architectures


Comments (0)