3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
Aglio Aglio 是一套將 API Blueprint 的文件 render 成 HTML 的套件。 Installation Aglio 需要透過 npm 安裝。 npm install -g aglio Usage 使用上有兩種做法,一種是透過 aglio 的 command line 指令產生網頁,而另一種是當成 node.js 的 library 使用,在 javascript 中產生。 Command Line # 使用預設的 theme aglio -i input.apib -o output.html # 使用三欄的 layout aglio -i input.apib --theme-template triple -o output.html # 使用 slate theme aglio --theme-variables slate -i input.apib -o output.html # 其他更細部操作可以參考官網 Javascript var aglio = require('aglio'); var blueprint = '# Some API Blueprint string'; // 定義 Theme var 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 ::: warning This is a waring message ::: ::: note This is a note ::: 支援 Emoji :smile: :ship: :cake: :shit: 支援 include 其它檔案 ### testAPI [GET] 神佛資訊。 Categories: API Blueprint Tags: AglioAPI-Blueprint 分類 Android AngularJS API Blueprint Chrome Database MySQL DataStructure Editor Vim Firefox Git Hadoop Language Go Java JavaScript jQuery jQueryChart Node.js Vue PHP Laravel ZendFramework Python Mac Network Cisco DLink Juniper Oauth Server Apache Share Unix FreeBSD Linux WebDesign Bootstrap CSS HTML Wordpress Search 搜尋:

本文由blogjohnsonluorg提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦