Skip to content

Commit

Permalink
Added details for Setups and documented Setups and Credits files usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
braz committed Dec 17, 2013
1 parent 1d1ddb8 commit da41fa6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ Workshopper({
, title : 'LEARN YOU THE NODE.JS FOR MUCH WIN!'
, appDir : __dirname
, helpFile : path.join(__dirname, 'help.txt')
, setupsFile : path.join(__dirname, 'setups.txt')
, creditsFile : path.join(__dirname, 'credits.txt')
}).init()
```

Additionally you can supply a `'subtitle'` String option and a `'menu'` object option that will be passed to [terminal-menu](https://github.com/substack/terminal-menu) so you can change the `'bg'` and `'fg'` colours.

The `'helpFile'` option is optional but if you supply one, users will get the contents of this file when they type `app help` (where 'app' is your workshop application name). They will also see a pointer to this whenever they select a new exercise, so make sure you fill it up with details of where to receive actual help for your workshop: a repo, a Google Group, an IRC channel, whatever.

The `'setupsFile'` option is optional but if you supply one, users will get the contents of this file when they type `app setups` (where 'app' is your workshop application name). This file is intended to contain any instructions required for installations or setups which are prerequisites needed to begin the lessons. They will also see a pointer to this whenever they select a new exercise.

The `'creditsFile'` option is optional but if you supply one, users will get the contents of this file when they type `app credits` (where 'app' is your workshop application name). This file is intended to give credit to those who have added or assisted in creating the exercises. They will also see a pointer to this whenever they select a new exercise.

Create a *menu.json* file in your project that looks something like this:

```js
Expand Down
14 changes: 14 additions & 0 deletions workshopper.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Workshopper.prototype.init = function () {
if (argv.h || argv.help || argv._[0] == 'help')
return this._printHelp()

if (argv._[0] == 'credits')
return this._printCredits()

if (argv._[0] == 'setups')
return this._printSetups()

if (argv.v || argv.version || argv._[0] == 'version')
return console.log(this.name + '@' + require(path.join(this.appDir, 'package.json')).version)

Expand Down Expand Up @@ -379,6 +385,14 @@ function onselect (name) {
console.log(
bold(' » For help with this problem or with ' + this.name + ', run:\n `' + this.name + ' help`.'))
}
if (this.creditsFile) {
console.log(
bold(' » For a list of those who contributed to ' + this.name + ', run:\n `' + this.name + ' credits`.'))
}
if (this.setupsFile) {
console.log(
bold(' » For any setup/installion prerequisites for ' + this.name + ', run:\n `' + this.name + ' setups`.'))
}
console.log()
}.bind(this))
}
Expand Down

0 comments on commit da41fa6

Please sign in to comment.