Skip to content

Commit 90521f3

Browse files
committed
update docs
1 parent 81f2649 commit 90521f3

File tree

2 files changed

+67
-56
lines changed

2 files changed

+67
-56
lines changed

README.md

Lines changed: 66 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,93 @@
11
# CodeRoad CLI
2-
Command line interface for [CodeRoad](http://coderoad.github.io).
2+
Command line interface for [CodeRoad](http://coderoad.github.io). See the [docs](https://coderoad.github.io/docs) for more.
33

4-
## Setup
4+
### Install
55

6-
```
7-
> npm install -g coderoad-cli
8-
```
9-
10-
## Tutorial Development
11-
12-
##### Development
13-
14-
* In your development directory, run `> coderoad create $NAME$`
15-
* Run `> npm link` to create a symbolic link to your project
16-
* Update changes to your tutorial by running `> coderoad build`
6+
Use [CodeRoad CLI](https://github.com/coderoad/coderoad-cli) to setup and build a project data file.
177

18-
##### Viewing/Testing your Tutorial
8+
* Install *CodeRoad-CLI*. Make sure [NodeJS](nodejs.org) is already installed
199

20-
* Open a new directory and run `> npm init`
21-
* Add your package name to the `dependencies` in `package.json`:
22-
23-
```
24-
"dependencies": {
25-
"coderoad-$NAME$": "^0.1.0"
26-
}
27-
```
10+
> npm install -g coderoad-cli
2811

29-
* Run `> npm link coderoad-$NAME$` & `> npm install`. This will install a package link pointing at your development tutorial.
30-
* Open [atom-coderoad](https://github.com/coderoad/atom-coderoad) to view your tutorial. Your package should appear as a loaded package.
31-
* Reload Atom if necessary (cmd + shift + P, type "reload", enter)
32-
33-
## Commands
34-
- create [name]
35-
- build [tutorial.md]
36-
- publish [version] _currently instructions only_
37-
- tutorials _coming soon_
38-
- search [query] _currently instructions only_
39-
- docs
40-
- help
4112

4213
### Create
4314

44-
"create" gets you started building your tutorial.
15+
Get setup quickly with CodeRoad: either [clone a tutorial repo](https://git-scm.com/docs/git-clone) or use the *CodeRoad-CLI*.
4516

46-
```
47-
> coderoad create $my-tutorial-name$
48-
```
17+
In your development directory, run **create** with your new package name.
4918

50-
"create" generates:
19+
> coderoad create $YOUR-PACKAGE-NAME$
5120

52-
* a `package.json` configuration with the following settings:
21+
Running **create** generates:
5322

54-
```
23+
* an example `tutorial.md`, which imports several tutorial files
24+
* an example `test` directory with a few example tests
25+
* a `package.json` configuration with some of the following settings:
26+
27+
```json
28+
{
5529
"name": "coderoad-$TUTORIAL-NAME$",
30+
"version": "0.1.0",
31+
"description": "Coderoad tutorial",
32+
"author": "Name <email> (site)",
5633
"main": "coderoad.json",
5734
"keywords": ["coderoad", "tutorial"],
35+
"dependencies": {
36+
"mocha-coderoad": "^0.3.1"
37+
},
5838
"coderoad": {
5939
"testDir": "test",
60-
"testSuffix": ".spec.js"
61-
}
40+
"testSuffix": ".spec.js",
41+
"testRunner": "mocha-coderoad"
42+
}
43+
}
6244
```
6345

64-
* an example `tutorial.md` file & tutorial directory
65-
* an example `test` directory with a few example tests
46+
We'll learn more about these configurations when it's time to [publish](#publish).
6647

67-
Feel free to fill out the "author" or "authors" field, and add any additional
68-
project related keywords.
48+
Update changes to your tutorial by running **build**. This will generate a *coderoad.json* data file used by *atom-coderoad*.
6949

70-
### Build
50+
> coderoad build
7151

72-
"build" compiles your markdown tutorial into a data file called `coderoad.json`.
52+
### Demo Your Tutorial
7353

74-
"build" defaults to `tutorial/tutorial.md`. Optionally specify the path to your tutorial markdown file.
54+
Open a new directory for demoing your tutorial. Setup a new NPM project file.
7555

56+
> npm init
57+
58+
Add your package name to the `dependencies` in `package.json`:
59+
60+
```json
61+
{
62+
"dependencies": {
63+
"coderoad-$YOUR-PACKAGE-NAME$": "^0.1.0"
64+
}
65+
}
7666
```
77-
> coderoad build
78-
> coderoad build $path/to/tutorial.md$
79-
```
8067

81-
"build" also generates a `README.md` with an outline of your chapters & pages
82-
as well as an explanation of how to setup your tutorial.
68+
Normally you would use `npm install` to install the package, but your package isn't ready to be published yet. Instead, you need to link your tutorial package to your demo directory.
69+
70+
### Link Your Demo & Tutorial
71+
72+
[NPM link](https://docs.npmjs.com/cli/link) creates a symbolic link between directories. This allows your demo directory to always load your tutorial package.
73+
74+
Inside of your tutorial root directory, run link.
75+
76+
> npm link
77+
78+
Inside of your demo root directory, connect the link.
79+
80+
> npm link coderoad-$YOUR-PACKAGE-NAME$
81+
> npm install
82+
83+
84+
### Using Atom
85+
86+
Open *Atom-Coderoad* to view your tutorial. Your package should appear as a loaded package. Click on it.
87+
88+
![CodeRoad Loaded Packages](/img/docs/loaded-packages.png)
89+
90+
Reload *Atom* to view changes. You can use the Atom [command-palette](https://atom.io/docs/latest/getting-started-atom-basics#command-palette) to find "reload" or simply use the reload hot-key.
91+
92+
* Windows & Linux: alt-ctrl-r
93+
* Mac: ctrl-alt-cmd-l

src/build/parser/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function doAction(type, isArray, actionValue, result, line, index) {
1717
if (!!isArray) {
1818
var valueList = actionValue.slice(1, -1).split(',');
1919
valueList.forEach(function (value) {
20-
var value = cleanup_1.trimQuotes(value.trim(), true);
20+
value = cleanup_1.trimQuotes(value.trim(), true);
2121
result.chapters[index.chapter].pages[index.page].tasks[index.task][type].push(value);
2222
});
2323
}

0 commit comments

Comments
 (0)