Getting Started with Aglio
Aglio 是一套将 API Blueprint
的文件 render 成 HTML 的套件。
Aglio 需要透过 npm
安装。
npm install -g aglio
Usage
使用上有两种做法,一种是透过 aglio
的 command line 指令产生网页,而另一种是当成 node.js 的 library 使用,在 javascript 中产生。
Command Line
# 使用预设的 themeaglio -i input.apib -o output.html# 使用三栏的 layoutaglio -i input.apib --theme-template triple -o output.html# 使用 slate themeaglio --theme-variables slate -i input.apib -o output.html# 其他更细部操作可以参考官网
Javascript
var aglio = require('aglio');var blueprint = '# Some API Blueprint string';// 定义 Themevar options = {themeVariables: 'slate'};aglio.render(blueprint, options, function (err, html, warnings) {if (err) return console.log(err);if (warnings) console.log(warnings);console.log(html);});
Tips
透过 Aglio
render 文件的话,在文件中还可以有一些特别的写法可以使用。
支援 Alert Bar
::: warningThis is a waring message:::::: noteThis is a note:::
支援 Emoji
:smile::ship::cake::shit:
支援 include 其它档案
### testAPI [GET]神佛资讯。
Categories:API Blueprint Tags: AglioAPI-Blueprint
分类 AndroidAngularJSAPI BlueprintChromeDatabaseMySQLDataStructureEditorVimFirefoxGitHadoopLanguageGoJavaJavaScriptjQueryjQueryChartNode.jsVuePHPLaravelZendFrameworkPythonMacNetworkCiscoDLinkJuniperOauthServerApacheShareUnixFreeBSDLinuxWebDesignBootstrapCSSHTMLWordpressSearch搜寻:aglioblueprinthtmlthemeapijavascriptrender