Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Writing API Documentation with Slate
Dec 15, 2014 @ 19:46:59

The SitePoint PHP blog has a new tutorial for the API developers out there showing you how you can use Slate for creating documentation. They point out a few other tools or formats you could use, but focus in on Slate, a Markdown-based tool that converts the result to HTML.

So you’ve built yourself an API. Perhaps it’s RESTful, RESTlike or something else entirely. [...] There’s one more thing, however. Thing is, an API is only as good as its documentation. That applies if it’s for internal use only – perhaps it’s for a JavaScript-based one-page app, or a mobile application – but even more so if it’s for public consumption.

He includes an example of what the output looks like first so you know what the end result will be (and if it meets your needs). They then walk you through the installation of Slate and a few Ruby tools you'll need to generate the HTML output. He includes a simple example of the configuration and a simple document with four sections. He also shows how to use includes, alerts, tables and a sidebar. Finally he gives the "rake" command to build the documentation and how to you can push the result up to your own GitHub Pages.

tagged: slate api documentation tutorial install configure example

Link: http://www.sitepoint.com/writing-api-documentation-slate/


Trending Topics: