Github Source
安裝方式
預設已經安裝,僅需編輯 book.json 啟動功能
"plugins": ["exercises"],
使用方式
使用 3個 "-" 或 "*" 將區塊包起來,並使用 ">" 說明錯誤原因,以下示範原始碼使用 "'" 取代 "`"
---
Define a variable `x` equal to 10.
'''js
var x =
'''
'''js
var x = 10;
'''
'''js
assert(x == 10);
'''
'''js
// This is context code available everywhere
// The user will be able to call magicFunc in his code
function magicFunc() {
return 3;
}
'''
---
var x = 10;
assert(x == 10);
// This is context code available everywhere // The user will be able to call magicFunc in his code function magicFunc() { return 3; }
待解決問題
觀看時會出現 "Uncaught ReferenceError: JSREPL is not defined exercises.js:7" 的錯誤,已有人將問題反應至 Github 上,待觀察