使用API Blueprint 编写自己的api
Blurprint 是一套API描述标准,和MarkDown一样,属于一种标记语言,可以把标记文稿转换为漂亮的接口文档
语法与例子
官方例子 https://github.com/apiaryio/api-blueprint/tree/master/examples
语法规范 https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md
http://blog.callmewhy.com/2014/06/05/blueprint-tutorial/
转化成更加容易读懂的html
api blueprint 现在有两个开源的工具能够解析成静态的HTML:aglio和iglo,这里使用aglio作为示例。并且为了我们可以实时看到修改以后生成的文件,我们引入gulp作为实时的构建工具。
1 | npm install -g aglio |