cli-guide.js
v0.1.3
Published
A Javascript library for creating interactive command line tutorials that run in your web browser.
Downloads
3
Maintainers
Readme
CLI Guide jQuery Plugin v0.1.3
A Javascript library for creating interactive command line tutorials that run in your web browser.
Necessary Files
Libs
Fonts
Demos
Documentation
Example
$('#stepsdiv').cliguide({
nameOfTheProject: 'Apache Aurora'
}).cli({
stepsFile: 'templates/apache_aurora.json',
skipsteps: '1,2',
commandStepsFile: 'templates/apache_aurora_commands.json',
commandValidation: 'templates/apache_aurora_commands_validations.json',
preloadfile: 'templates/apache_aurora_files.json'
}, function(){
//Codes in here will be runned after CLI functions run
});
Options
| Property | Description | Required | |---|---|---| | nameOfTheProject | name of the project | X | | stepsFile | a .json file | X | | skipsteps | number of the step separated by comma | optional | | commandStepsFile | a .json file | X | | preloadfile | a .json file | optional |
The structure of .json files
stepsFile
[
{
"step": "0",
"content": {
"title": "Setup: Install Aurora 0",
"content": [
" You use the Aurora client and web UI to interact with Aurora jobs. ",
" To install it locally, see vagrant.md. The remainder of this Tutorial ",
" assumes you are running Aurora using Vagrant. Unless otherwise stated, ",
" all commands are to be run from the root of the aurora repository clone."
],
"tips": "You can run $ <i>aurora</i> for see all commands"
}
}
]
commandStepsFile
[
{
"command":"hello world!",
"result": "test...."
}
]
preloadfile
[
{
"name":"test.txt",
"content": "Hello World!"
},
{
"name":"hello.py",
"content": "print(\"Hello World!\")"
}
]
Components
Terminal
Nano Editor
Build
$ npm install
$ gulp
License
Copyright 2015 Twitter, Inc.
Licensed under the MIT License