0.1.3 • Published 10 years ago

cli-guide.js v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

CLI Guide jQuery Plugin v0.1.3

npm version License

GSoC 2015 Project

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

PropertyDescriptionRequired
nameOfTheProjectname of the projectX
stepsFilea .json fileX
skipstepsnumber of the step separated by commaoptional
commandStepsFilea .json fileX
preloadfilea .json fileoptional

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

terminal

Nano Editor

nano editor

Build

$ npm install
$ gulp

License

Copyright 2015 Twitter, Inc.

Licensed under the MIT License