Skip to content

Commit 5bdc6ba

Browse files
committed
update docs
1 parent 3835606 commit 5bdc6ba

File tree

9 files changed

+165
-19
lines changed

9 files changed

+165
-19
lines changed

_includes/docs/docs.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<link rel="stylesheet" type="text/css" href="/css/docs.min.css" />
22

33
<section id="docs">
4-
<div class="container">
4+
<div class="container bs-docs-container">
55
<div class="row">
66

77

@@ -13,11 +13,9 @@ <h1 id="overview" class="page-header">Overview</h1>
1313
CodeRoad aims to make building & sharing interactive tutorials as easy as possible.
1414
</blockquote>
1515

16-
<div class="lead">
17-
For a quick overview of how everything comes together&nbsp;&nbsp;&nbsp;
18-
<a href="/build" class="btn btn-default btn-lg"><i class="fa fa-road fa-fw"></i> <span class="network-name">Read this</span></a>
16+
<div class="lead">We hope to create fun and maintainable coding tutorials that actually improve with time. We hope to create a world where students become teachers, teachers become empowered & coders become better, faster. But first, we need to get some tutorials built.</div>
1917

20-
</div>
18+
<a href="/build" class="btn btn-default btn-lg"><i class="fa fa-road fa-fw"></i> <span class="network-name">Read an Overview of Building a Tutorial</span></a>
2119

2220
<br> {% for post in site.posts reversed %}
2321

_includes/docs/js.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script type="text/javascript">
2+
$(function(){
3+
// build side menu
4+
var html = '';
5+
6+
$('.bs-docs-section').each(function() {
7+
var h1 = $(this).find('h1[id]').first(),
8+
h23 = $(this).find('h2[id], h3[id]');
9+
10+
if (h1.length) {
11+
html+= '<li><a href="#' + h1[0].id +'">'+ h1.clone().children().remove().end().text() +'</a>';
12+
13+
if (h23.length) {
14+
html+= '<ul class="nav">';
15+
h23.each(function() {
16+
html+= '<li><a href="#' + this.id +'">'+ $(this).clone().children().remove().end().text() +'</a></li>';
17+
});
18+
html+= '</ul>';
19+
}
20+
21+
html+= '</li>';
22+
}
23+
});
24+
25+
if (html == '') {
26+
$('[role=complementary]').hide();
27+
$('[role=main]').toggleClass('col-md-9 col-md-12');
28+
}
29+
else {
30+
$('.bs-docs-sidenav').html(html);
31+
}
32+
33+
!function(a){a(function(){if(navigator.userAgent.match(/IEMobile\/10\.0/)){var b=document.createElement("style");b.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.querySelector("head").appendChild(b)}{var c=a(window),d=a(document.body);a(".navbar").outerHeight(!0)+10}d.scrollspy({target:".bs-docs-sidebar"}),c.on("load",function(){d.scrollspy("refresh")}),a(".bs-docs-container [href=#]").click(function(a){a.preventDefault()}),setTimeout(function(){var b=a(".bs-docs-sidebar");b.affix({offset:{top:function(){var c=b.offset().top,d=parseInt(b.children(0).css("margin-top"),10),e=a(".bs-docs-nav").height();return this.top=c-e-d},bottom:function(){return this.bottom=a(".bs-docs-footer").outerHeight(!0)}}})},100),setTimeout(function(){a(".bs-top").affix()},100)})}(jQuery);
34+
</script>

_layouts/docs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
{% include docs/docs.html %}
99
{% include docs/footer.html %}
1010
{% include js.html %}
11+
{% include docs/js.html %}
1112
</body>
1213
</html>

_posts/2016-01-03-tutorial.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,36 @@ layout: docs
33
title: Tutorial File
44
id: tutorial
55
---
6-
Description
6+
CodeRoad tutorials are written in Github Flavored Markdown, then parsed into a *coderoad.json* file when you run `> coderoad build`.
77

88
### Markdown
99

10-
### Syntax
10+
Each level of header indicates a different section, followed by a description.
1111

12-
#### @import
12+
* `#` Project
13+
* `##` Chapter
14+
* `###` Page
15+
* `+` Task
1316

14-
#### @test
17+
As an example:
1518

16-
#### @hint
19+
# Project Title
20+
A description of your project
1721

18-
#### @action
22+
## Chapter One Title
23+
A description of chapter one
1924

20-
* open
25+
### Page One Title
26+
A description of page one
2127

22-
* set
28+
+ A description of task one
2329

24-
* insert
30+
+ A description of task two
31+
32+
### Page Two Title
33+
A description of page two
34+
35+
## Chapter Two Title
36+
etc.
37+
38+
[Read more](https://help.github.com/articles/working-with-advanced-formatting/) about Github Flavored Markdown, including how to write tables & syntax highlight code blocks.

_posts/2016-01-04-coderoad-api.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
layout: docs
3+
title: CodeRoad API
4+
id: coderoad-API
5+
---
6+
7+
Of course Markdown couldn't cover all uses necessary for CodeRoad. Instead, there is a special **CodeRoad API** which is parsed into the data file whenever you run `> coderoad build`.
8+
9+
For these API features to work, they must be placed at the beginning of a line.
10+
11+
@import('file') // ✓
12+
@import('file') // ✗
13+
14+
Features can be commented out, allowing you to view different files at a time. Be aware the parser matches content from the beginning of a line.
15+
16+
<!-- @import('file') --> // ✗
17+
<!-- @import('file') // ✗
18+
@import('file2') --> // ✓
19+
20+
### `@import`
21+
22+
*@import* loads other markdown files. Specify a relative path from the root project directory. If no file extension is provided, it will default to *.md*.
23+
24+
@import('./path/to/file')
25+
@import('./path/to/file.md')
26+
27+
See an [example](https://github.com/coderoad/coderoad-functional-school/blob/master/tutorial/tutorial.md).
28+
29+
30+
### `@test`
31+
32+
Defaults for loading tests are specified in the tutorial *package.json* file.
33+
34+
"config": {
35+
"testDir": "tutorial", // the directory name tests paths will load from
36+
"testSuffix": ".spec.js" // the test file suffix that will be added
37+
}
38+
39+
*@test* loads a test file. It is important that these files are loaded in the correct order. *@test* can take a single test file, or an array of test files.
40+
41+
@test('path/to/file')
42+
@test(['path/to/file', 'path/to/file2'])
43+
44+
The first example would load the file './tutorial/path/to/file.spec.js' in the project root directory.
45+
46+
### `@hint`
47+
48+
*Note: Hints have not been implemented yet in Atom-Coderoad. Coming soon.*
49+
50+
*@hint* loads a string, or array of strings, which can be used to provide hints for the user.
51+
52+
@hint('A hint for the user')
53+
@hint(['The first hint', 'The second hint'])
54+
55+
*@hint* may use codeblocks with syntax highlighting.
56+
57+
58+
@hint(`var a = 42;`)
59+
@hint(```js
60+
var a = 42;
61+
```)
62+
63+
### `@action`
64+
65+
*@action* allows you to run changes in the Editor.
66+
67+
#### open
68+
69+
Open a file. The path to the file will be from the users root directory.
70+
71+
@action(open('file.js'))
72+
@action(open('path/to/file.js'))
73+
74+
#### set
75+
76+
Replace all text in a file.
77+
78+
@action(set('// hello world'))
79+
@action(set(`// hello world`))
80+
@action(set(```
81+
function sayHello() {
82+
return 'hello world';
83+
}
84+
```))
85+
86+
#### insert
87+
88+
Add text to the bottom of the active text editor.
89+
90+
@action(insert('// hello world'))
91+
@action(insert(`// hello world`))
92+
@action(insert(```
93+
function sayHello() {
94+
return 'hello world';
95+
}
96+
```))
97+
98+
#### Future API
99+
100+
More editor actions will be added to CodeRoad in the future.

_posts/2016-01-04-tests.md renamed to _posts/2016-01-05-tests.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ Description
2323
* property
2424
* spies
2525

26+
### Dynamic Tests
27+
28+
* task position
29+
2630
### Future Testing Tool
File renamed without changes.

_posts/2016-01-07-collaborating.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)