Skip to content

Commit 159a890

Browse files
committed
minor improvements
1 parent 021a2b3 commit 159a890

File tree

13 files changed

+128
-70
lines changed

13 files changed

+128
-70
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
# Atom CodeRoad plugin
22

3-
Interactive coding tutorials inside of the Atom editor. Learn more at [coderoad.io](https://coderoad.github.io).
3+
Interactive coding tutorials inside of the Atom editor.
44

5-
*Currently beta. Please post issues.*
5+
See a [video](https://youtu.be/DbLpdgrYVOU).
66

7-
Join the development conversation on [our Wekan board](https://coderoad.herokuapp.com).
7+
Read the [docs](https://coderoad.github.io).
88

9+
*Currently beta. Please post issues.*
910

10-
### QuickStart
1111

12-
Use [Atom CodeRoad](https://github.com/coderoad/atom-coderoad) to view and play your tutorial
12+
### Atom CodeRoad
1313

14-
* Download the [Atom](https://atom.io/) editor
14+
Use [Atom CodeRoad](https://github.com/coderoad/atom-coderoad) to view and play your tutorial.
1515

16-
* Install the *Atom-CodeRoad* package, or use the [apm](https://github.com/atom/apm) command-line tool
16+
You'll need to download the [Atom](https://atom.io/) editor and install *Atom Shell Commands*.
1717

18-
> apm install atom-coderoad
18+
Install the *Atom-CodeRoad* package: `> apm install atom-coderoad`
1919

20-
* Toggle open *Atom-CodeRoad* in *Atom* using the "packages" menu or press *ctrl-alt-0*.
20+
For an example of how to do this, *hover* over the image below:
2121

22-
* It's recommended you also enable Autosave in Atom.
22+
![Install atom-coderoad](https://coderoad.github.io/img/gif/install-atom-coderoad.png)
2323

24-
To enable autosave in Atom, go to *Atom* > *Preferences* > *Packages* > search for *"autosave"* > *settings* > check *"enabled"*.
24+
You may also want to install [terminal-plus](https://atom.io/packages/terminal-plus) used in the example above.
2525

26-
* If CodeRoad is unavailable under *Atom* > *Packages* > *CodeRoad*, restart or reload atom.
26+
Toggle open *Atom-CodeRoad* using the *Packages* menu or press *ctrl-alt-0*.
2727

28-
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.
2928

30-
* Windows & Linux: alt-ctrl-r
31-
* Mac: ctrl-alt-cmd-l
3229

33-
### Install a Tutorial
30+
### Tutorial
3431

3532
To install a tutorial, setup a *package.json* file and save the tutorial as a dependency. Make sure [NodeJS](nodejs.org) is already installed.
3633

37-
You can setup a project quickly by typing `npm init --y` into the command line in your project's folder. This agrees to all of the defaults for your newly created *package.json* file.
34+
![Install a Tutorial](https://coderoad.github.io/img/gif/install-tutorial.png)
35+
36+
You can setup a project quickly by typing `> npm init --y` into the command line in your project's folder. This agrees to all of the defaults for your newly created *package.json* file.
3837

39-
Now you can install a tutorial. Run `npm install --save-dev $THE-PACKAGE-NAME$` to save the tutorial as a package development dependency. If you run *Atom-CodeRoad* you should see the tutorial appear on the first screen.
38+
Now you can install a tutorial. Run `> npm install --save-dev $THE-PACKAGE-NAME$` to save the tutorial as a package development dependency. If you run *Atom-CodeRoad* you should see the tutorial appear on the first screen.

lib/components/account/account.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ var default_1 = (function (_super) {
1111
_super.apply(this, arguments);
1212
}
1313
default_1.prototype.render = function () {
14-
return (React.createElement("section", {className: 'cr-account'}, React.createElement("h3", null, "Account")));
14+
return (React.createElement("section", {className: 'cr-account'},
15+
React.createElement("h3", null, "Account")
16+
));
1517
};
1618
return default_1;
1719
}(React.Component));

lib/components/app/app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ var default_1 = (function (_super) {
3030
};
3131
default_1.prototype.render = function () {
3232
var state = this.props.state;
33-
return (React.createElement("section", {className: 'cr'}, React.createElement(_components_1.Menu, {route: state.route, position: state.position}), React.createElement(_components_1.Router, {state: state}), React.createElement(_components_1.Alert, {alert: state.alert})));
33+
return (React.createElement("section", {className: 'cr'},
34+
React.createElement(_components_1.Menu, {route: state.route, position: state.position}),
35+
React.createElement(_components_1.Router, {state: state}),
36+
React.createElement(_components_1.Alert, {alert: state.alert})));
3437
};
3538
default_1.childContextTypes = {
3639
muiTheme: React.PropTypes.object,

lib/components/menu/menu.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ var default_1 = (function (_super) {
3939
default_1.prototype.menuOptions = function () {
4040
switch (this.props.route) {
4141
case 'page':
42-
return (React.createElement("div", null, React.createElement(material_ui_1.MenuItem, {primaryText: 'progress', onClick: this.props.routeToProgress}), React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects})));
42+
return (React.createElement("div", null,
43+
React.createElement(material_ui_1.MenuItem, {primaryText: 'progress', onClick: this.props.routeToProgress}),
44+
React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects})));
4345
case 'progress':
4446
return React.createElement(material_ui_1.MenuItem, {primaryText: 'projects', onClick: this.props.routeToProjects});
4547
default: return null;
@@ -49,7 +51,17 @@ var default_1 = (function (_super) {
4951
render_1.togglePanel();
5052
};
5153
default_1.prototype.render = function () {
52-
return (React.createElement(material_ui_1.AppBar, {title: 'CodeRoad', className: 'cr-menu-bar', iconElementLeft: React.createElement(material_ui_1.IconButton, {onClick: this.closePanel}, React.createElement(NavigationClose, null)), iconElementRight: React.createElement(material_ui_1.IconMenu, {iconButtonElement: React.createElement(material_ui_1.IconButton, null, React.createElement(MoreVertIcon, null)), targetOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'top' }}, this.menuOptions(), global.coderoad.issuesPath ? React.createElement(material_ui_1.MenuItem, null, React.createElement("a", {href: global.coderoad.issuesPath}, "post issue")) : null, React.createElement(material_ui_1.Divider, null), React.createElement(material_ui_1.MenuItem, {primaryText: 'quit', onClick: this.props.quit}))}));
54+
return (React.createElement(material_ui_1.AppBar, {title: 'CodeRoad', className: 'cr-menu-bar', iconElementLeft: React.createElement(material_ui_1.IconButton, {onClick: this.closePanel},
55+
React.createElement(NavigationClose, null)
56+
), iconElementRight: React.createElement(material_ui_1.IconMenu, {iconButtonElement: React.createElement(material_ui_1.IconButton, null,
57+
React.createElement(MoreVertIcon, null)
58+
), targetOrigin: { horizontal: 'right', vertical: 'top' }, anchorOrigin: { horizontal: 'right', vertical: 'top' }},
59+
this.menuOptions(),
60+
global.coderoad.issuesPath ? React.createElement(material_ui_1.MenuItem, null,
61+
React.createElement("a", {href: global.coderoad.issuesPath}, "post issue")
62+
) : null,
63+
React.createElement(material_ui_1.Divider, null),
64+
React.createElement(material_ui_1.MenuItem, {primaryText: 'quit', onClick: this.props.quit}))}));
5365
};
5466
default_1 = __decorate([
5567
react_redux_1.connect(null, function (dispatch) {

lib/components/page/chapter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ var _components_1 = require('../_components');
33
Object.defineProperty(exports, "__esModule", { value: true });
44
exports.default = function (_a) {
55
var chapter = _a.chapter;
6-
return (React.createElement("section", {className: 'cr-chapter'}, React.createElement(_components_1.MarkdownText, {text: chapter.title})));
6+
return (React.createElement("section", {className: 'cr-chapter'},
7+
React.createElement(_components_1.MarkdownText, {text: chapter.title})
8+
));
79
};

lib/components/page/edit.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
55
exports.default = function (editPath) {
66
if (editPath && global.coderoad.edit) {
77
var repoPath = path.join(global.coderoad.repo, 'edit', 'master', editPath);
8-
return React.createElement("a", {href: repoPath}, React.createElement(Edit, {style: { position: 'absolute', top: '10px', right: '10px' }}));
8+
return React.createElement("a", {href: repoPath},
9+
React.createElement(Edit, {style: { position: 'absolute', top: '10px', right: '10px' }})
10+
);
911
}
1012
};

lib/components/page/page.js

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,60 @@ var default_1 = (function (_super) {
9595
var taskPosition = this.props.taskPosition;
9696
var currentTask = taskPosition <= tasks.length ? tasks[taskPosition] : null;
9797
var allComplete = taskPosition >= tasks.length;
98-
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-page'}, React.createElement(material_ui_1.Card, null, React.createElement(material_ui_1.CardHeader, {title: page.title, subtitle: page.description}), React.createElement(material_ui_1.CardText, null, React.createElement(_components_1.MarkdownText, {text: page.explanation}))), React.createElement(material_ui_1.Divider, null), React.createElement(material_ui_1.List, {subheader: 'Tasks', className: 'cr-tasks', ref: 'tasks'}, tasks.map(function (task, index) {
99-
var isCurrentTask = index === taskPosition;
100-
var isDisabledTask = index > taskPosition;
101-
var isCompletedTask = index < taskPosition;
102-
var isFinalTask = index >= tasks.length - 1;
103-
var hints = _this.hintsShown(task);
104-
return (React.createElement("div", null, React.createElement(material_ui_1.ListItem, {ref: 'task' + index, className: classNames({
105-
'cr-task': true,
106-
'isCompletedTask': isCompletedTask,
107-
'isCurrentTask': isCurrentTask,
108-
'isDisabledTask': isDisabledTask
109-
})}, React.createElement("span", {className: 'cr-task-checkbox'}, _this.getIcon(index, taskPosition)), React.createElement("span", {className: 'cr-task-index'}, index + 1, "."), React.createElement("div", {className: 'cr-task-description'}, React.createElement(_components_1.MarkdownText, {text: task.description}))), isCurrentTask && hints ?
110-
hints.map(function (hint, indexHint) {
111-
return React.createElement(material_ui_1.ListItem, {className: 'cr-task-hint', ref: 'hint' + indexHint}, React.createElement("div", {class: 'cr-task-hint-box'}, React.createElement("span", {className: 'cr-task-hint-index'}, indexHint + 1, "."), React.createElement("div", {className: 'cr-task-hint-description'}, React.createElement(_components_1.MarkdownText, {text: hint}))));
112-
})
113-
: null, isFinalTask ? null : React.createElement(material_ui_1.Divider, null)));
114-
})), React.createElement("section", {className: 'cr-page-toolbar'}, React.createElement(material_ui_1.LinearProgress, {mode: 'determinate', value: taskProgress(taskPosition, tasks.length), style: { height: '6px' }}), React.createElement(material_ui_1.Toolbar, null, currentTask && currentTask.hints && currentTask.hints.length ?
115-
React.createElement(material_ui_1.ToolbarGroup, {float: 'left'}, this.state.hintPos <= currentTask.hints.length - 2 ?
116-
React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint', icon: React.createElement(InfoOutline, null), onClick: this.displayHint.bind(this, currentTask)})
117-
: React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint-disabled', icon: React.createElement(Info, null), disabled: true}))
118-
: null, React.createElement(material_ui_1.ToolbarGroup, {float: 'right'}, allComplete ?
119-
React.createElement(material_ui_1.RaisedButton, {label: 'Continue', primary: true, onClick: this.props.callNextPage})
120-
:
121-
React.createElement(material_ui_1.RaisedButton, {label: 'Run', secondary: true, onClick: this.props.callRunTests}))))));
98+
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-page'},
99+
React.createElement(material_ui_1.Card, null,
100+
React.createElement(material_ui_1.CardHeader, {title: page.title, subtitle: page.description}),
101+
React.createElement(material_ui_1.CardText, null,
102+
React.createElement(_components_1.MarkdownText, {text: page.explanation})
103+
)),
104+
React.createElement(material_ui_1.Divider, null),
105+
React.createElement(material_ui_1.List, {subheader: 'Tasks', className: 'cr-tasks', ref: 'tasks'}, tasks.map(function (task, index) {
106+
var isCurrentTask = index === taskPosition;
107+
var isDisabledTask = index > taskPosition;
108+
var isCompletedTask = index < taskPosition;
109+
var isFinalTask = index >= tasks.length - 1;
110+
var hints = _this.hintsShown(task);
111+
return (React.createElement("div", null,
112+
React.createElement(material_ui_1.ListItem, {ref: 'task' + index, className: classNames({
113+
'cr-task': true,
114+
'isCompletedTask': isCompletedTask,
115+
'isCurrentTask': isCurrentTask,
116+
'isDisabledTask': isDisabledTask
117+
})},
118+
React.createElement("span", {className: 'cr-task-checkbox'}, _this.getIcon(index, taskPosition)),
119+
React.createElement("span", {className: 'cr-task-index'},
120+
index + 1,
121+
"."),
122+
React.createElement("div", {className: 'cr-task-description'},
123+
React.createElement(_components_1.MarkdownText, {text: task.description})
124+
)),
125+
isCurrentTask && hints ?
126+
hints.map(function (hint, indexHint) {
127+
return React.createElement(material_ui_1.ListItem, {className: 'cr-task-hint', ref: 'hint' + indexHint},
128+
React.createElement("div", {class: 'cr-task-hint-box'},
129+
React.createElement("span", {className: 'cr-task-hint-index'},
130+
indexHint + 1,
131+
"."),
132+
React.createElement("div", {className: 'cr-task-hint-description'},
133+
React.createElement(_components_1.MarkdownText, {text: hint})
134+
))
135+
);
136+
})
137+
: null,
138+
isFinalTask ? null : React.createElement(material_ui_1.Divider, null)));
139+
})),
140+
React.createElement("section", {className: 'cr-page-toolbar'},
141+
React.createElement(material_ui_1.LinearProgress, {mode: 'determinate', value: taskProgress(taskPosition, tasks.length), style: { height: '6px' }}),
142+
React.createElement(material_ui_1.Toolbar, null,
143+
currentTask && currentTask.hints && currentTask.hints.length ?
144+
React.createElement(material_ui_1.ToolbarGroup, {float: 'left'}, this.state.hintPos <= currentTask.hints.length - 2 ?
145+
React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint', icon: React.createElement(InfoOutline, null), onClick: this.displayHint.bind(this, currentTask)})
146+
: React.createElement(material_ui_1.FlatButton, {className: 'cr-task-showHint-disabled', icon: React.createElement(Info, null), disabled: true}))
147+
: null,
148+
React.createElement(material_ui_1.ToolbarGroup, {float: 'right'}, allComplete ?
149+
React.createElement(material_ui_1.RaisedButton, {label: 'Continue', primary: true, onClick: this.props.callNextPage})
150+
:
151+
React.createElement(material_ui_1.RaisedButton, {label: 'Run', secondary: true, onClick: this.props.callRunTests}))))));
122152
};
123153
default_1 = __decorate([
124154
react_redux_1.connect(null, function (dispatch, state) {

lib/components/progress/progress.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ var style = {
9090
Object.defineProperty(exports, "__esModule", { value: true });
9191
exports.default = function (_a) {
9292
var progress = _a.progress, position = _a.position;
93-
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-progress'}, React.createElement(material_ui_1.List, {subheader: 'Progress'}, progress.chapters.map(function (chapter, chapterIndex) {
94-
var isActive = chapterIndex === position.chapter;
95-
return React.createElement(material_ui_1.ListItem, {primaryText: (chapterIndex + 1) + ". " + chapter.title, className: classNames({
96-
'chapter': true,
97-
'isActive': isActive
98-
}), secondaryText: chapter.description, secondaryTextLines: chapter.description.length > 35 ? 2 : 1, initiallyOpen: chapterIndex === 0, leftIcon: chapter.completed ? React.createElement(AllCompleted, null) : null, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) {
99-
var itemPosition = { chapter: chapterIndex, page: pageIndex };
100-
return React.createElement(ProgressPage, {page: page, itemPosition: itemPosition, position: position});
101-
})});
102-
}))));
93+
return (React.createElement(material_ui_1.Paper, {style: style, zDepth: 1, className: 'cr-progress'},
94+
React.createElement(material_ui_1.List, {subheader: 'Progress'}, progress.chapters.map(function (chapter, chapterIndex) {
95+
var isActive = chapterIndex === position.chapter;
96+
return React.createElement(material_ui_1.ListItem, {primaryText: (chapterIndex + 1) + ". " + chapter.title, className: classNames({
97+
'chapter': true,
98+
'isActive': isActive
99+
}), secondaryText: chapter.description, secondaryTextLines: chapter.description.length > 35 ? 2 : 1, initiallyOpen: chapterIndex === 0, leftIcon: chapter.completed ? React.createElement(AllCompleted, null) : null, primaryTogglesNestedList: chapterIndex === position.chapter && !chapter.completed, nestedItems: chapter.pages.map(function (page, pageIndex) {
100+
var itemPosition = { chapter: chapterIndex, page: pageIndex };
101+
return React.createElement(ProgressPage, {page: page, itemPosition: itemPosition, position: position});
102+
})});
103+
}))
104+
));
103105
};

0 commit comments

Comments
 (0)