Skip to content

Commit 08c59f6

Browse files
committed
Organize tutorials better
1 parent f706cb3 commit 08c59f6

13 files changed

+88
-26
lines changed

README.md

+23
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ Now preview your changes locally:
5353

5454
- `bundle exec rake serve`
5555

56+
## Adding a new tutorial
57+
58+
Tutorials come in two forms: regular and side-by-side. To create a new regular
59+
tutorial, make a new `.md` file in `_tutorials/`. Add front matter (the YAML
60+
metadata at the top) following the pattern of other files in that directory,
61+
followed by your content in HTML and/or Markdown format.
62+
63+
To create a new side-by-side tutorial, make a new `.js` file in `_tutorials/src`.
64+
Add mixed doc comment blocks and code, following the pattern of other files in
65+
that directory. Then add a configuration for your new tutorial to `locco.js` and
66+
run `node locco.js`. Be sure to check in both the JS source file in
67+
`_tutorials/src` and the generated Markdown file in `_tutorials`.
68+
69+
In either case, you'll need to manually add a link to your new tutorial to
70+
`pages/docs_home.html`.
71+
72+
## Archiving an old tutorial
73+
74+
To archive an old tutorial:
75+
76+
1. Add `archived: true` to the YAML at the top of the tutorial's Markdown file.
77+
2. Add a link to the tutorial to `pages/archives.html`.
78+
5679
## Publishing API docs for a new version of Jasmine
5780

5881
- Update the edge API docs as described in the previous section

_layouts/mocking_ajax.yml.mustache

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ redirect_from:
55
{{#redirectFrom}}
66
- "{{ &path }}"
77
{{/redirectFrom}}
8-
order: {{ order }}
98
include_docco: true
109
file_name: "{{ &filename }}"
1110
archived: true

_layouts/tutorial_docco.yml.mustache

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ redirect_from:
55
{{#redirectFrom}}
66
- "{{ &path }}"
77
{{/redirectFrom}}
8-
order: {{ order }}
98
include_docco: true
109
file_name: "{{ &filename }}"
1110
---

_tutorials/async.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: article
33
title: Asynchronous work
4-
order: 1
54
---
65

76
# Asynchronous Work

_tutorials/custom_boot.html

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
redirect_from:
44
- "/edge/custom_boot.html"
55
file_name: custom_boot
6-
order:
76
archived: true
87
---
98
<table cellspacing="0" cellpadding="0">

_tutorials/custom_matcher.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
layout: tutorial
44
redirect_from:
55
- "/edge/custom_matcher.html"
6-
order:
76
include_docco: true
87
file_name: "custom_matcher"
98
---

_tutorials/mocking_ajax.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
layout: tutorial
44
redirect_from:
55
- "/edge/mocking_ajax.html"
6-
order:
76
include_docco: true
87
file_name: "mocking_ajax"
98
archived: true

_tutorials/your_first_suite.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ layout: tutorial
44
redirect_from:
55
- "/edge/your_first_suite.html"
66
- "/edge/introduction.html"
7-
order: 0
87
include_docco: true
98
file_name: "your_first_suite"
109
---

css/_scss/pages.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ h2 {
5050
margin-bottom: 20px;
5151
}
5252

53-
h3, .api-docs-versions li {
53+
h3, .doc-list li {
5454
font-size: 20px;
5555
width: 100%;
5656
margin-top: 10px;
5757
margin-bottom: 10px;
5858
}
5959

60-
.api-docs-versions {
60+
.doc-list {
6161
margin-left: 15px;
6262
padding-left: 0;
6363
list-style: none;

css/_scss/pre-30-archived-docs/pages.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ h2 {
145145
margin-bottom: 20px;
146146
}
147147

148-
h3, .api-docs-versions li {
148+
h3, .doc-list li {
149149
font-size: 20px;
150150
width: 100%;
151151
margin-top: 10px;
152152
margin-bottom: 10px;
153153
}
154154

155-
.api-docs-versions {
155+
.doc-list {
156156
margin-left: 15px;
157157
padding-left: 0;
158158
list-style: none;
@@ -290,7 +290,7 @@ table {
290290
}
291291

292292

293-
// Restore docco styles for cells that are actually docco's, overriding the
293+
// Restore docco styles for cells that are actually docco's, overriding the
294294
// above.
295295
table {
296296
td.docs, th.doc {

locco.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
documentation and code blocks are fed to _layouts/tutorail_docco.html as
1111
a list of {docs, code} pairs.
1212
13-
Redirects and/or order can be specified in this file. They will be omitted
13+
Redirects can be specified in this file. They will be omitted
1414
(i.e. inferred by Jekyll) if not specified.
1515
*/
1616

@@ -27,7 +27,6 @@ const configs = [
2727
{
2828
src: '_tutorials/src/your_first_suite.js',
2929
dest: '_tutorials/your_first_suite.md',
30-
order: 0,
3130
redirectFrom: [
3231
{path: '/edge/your_first_suite.html'},
3332
{path: '/edge/introduction.html'},

pages/archives.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ <h1>Archived Documentation</h1>
1818
<h2>API Reference</h2>
1919

2020
<h3>jasmine-core</h3>
21-
<ol class="api-docs-versions">
21+
<ol class="doc-list">
2222
{% assign versions = site.api | sort: 'sortKey' %}
2323
{% for version in versions reversed %}
2424
{% if version.url contains "/global" and version.archived %}
@@ -27,7 +27,7 @@ <h3>jasmine-core</h3>
2727
{% endfor %}
2828
</ol>
2929
<h3>jasmine-npm</h3>
30-
<ol class="api-docs-versions">
30+
<ol class="doc-list">
3131
{% assign versions = site.npm-api | sort: 'sortKey' %}
3232
{% for version in versions reversed %}
3333
{% if version.title == "Class: Jasmine" and version.archived %}
@@ -36,7 +36,7 @@ <h3>jasmine-npm</h3>
3636
{% endfor %}
3737
</ol>
3838
<h3>jasmine-browser-runner</h3>
39-
<ol class="api-docs-versions">
39+
<ol class="doc-list">
4040
{% assign versions = site.browser-runner-api | sort: 'sortKey' %}
4141
{% for version in versions reversed %}
4242
{% if version.url contains "/module-jasmine-browser-runner" and version.archived %}

pages/docs_home.html

+56-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ <h2>Getting Started</h2>
1010
<h3><a href="{{ site.github.url }}/pages/faq.html">Frequently asked questions</a>
1111
<h3><a href="{{ site.github.url }}/setup/nodejs.html">Node.js</a>
1212
<h3><a href="{{ site.github.url }}/setup/browser.html">Browser runner</a>
13+
<h3><a href="{{ site.github.url }}/tutorials/your_first_suite">Your first suite</a>
1314

1415
<h2>Upgrade Guides</h2>
1516
<h3><a href="{{ site.github.url }}/upgrade-guides/5.0">5.0</a></h3>
@@ -19,17 +20,63 @@ <h3><a href="{{ site.github.url }}/upgrade-guides/2.0">2.0</a></h3>
1920
</div>
2021
<div>
2122
<h2>Tutorials</h2>
22-
{% assign sorted_tutorials = site.tutorials | sort:"order", "last" %}
23-
{% for tut in sorted_tutorials %}
24-
{% unless tut.omit_from_index or tut.archived %}
25-
<h3><a href="{{site.github.url}}{{tut.url}}">{{ tut.url | remove_first: "/tutorials/" | replace: "_", " " | capitalize }}</a></h3>
26-
{% endunless %}
27-
{% endfor %}
23+
<h3>Basics</h3>
24+
<ol class="doc-list">
25+
<li><a href="{{ site.github.url }}/tutorials/your_first_suite">Your first suite</a></li>
26+
<li><a href="{{ site.github.url }}/tutorials/async">Async</a></li>
27+
</ol>
28+
29+
<h3>Matcher and equality customization</h3>
30+
<ol class="doc-list">
31+
<li><a href="{{ site.github.url }}/tutorials/custom_matcher">
32+
Custom matcher
33+
</a></li>
34+
<li><a href="{{ site.github.url }}/tutorials/custom_equality">
35+
Custom equality
36+
</a></li>
37+
<li><a href="{{ site.github.url }}/tutorials/custom_asymmetric_equality_testers">
38+
Custom asymmetric equality testers
39+
</a></li>
40+
<li><a href="{{ site.github.url }}/tutorials/custom_object_formatters">
41+
Custom object formatters
42+
</a></li>
43+
</ol>
44+
45+
<h3>Spies/Mocking</h3>
46+
<ol class="doc-list">
47+
<li><a href="{{ site.github.url }}/tutorials/spying_on_properties">
48+
Spying on propertids</a></li>
49+
<li><a href="{{ site.github.url }}/tutorials/default_spy_strategy">
50+
Default spy strategy</a></li>
51+
<li><a href="{{ site.github.url }}/tutorials/module_mocking">Module mocking</a></li>
52+
</ol>
53+
54+
<h3>Other Jasmine Features</h3>
55+
<ol class="doc-list">
56+
<li><a href="{{ site.github.url }}/tutorials/custom_reporter">Custom reporter</a></li>
57+
<li><a href="{{ site.github.url }}/tutorials/running_specs_in_parallel">
58+
Running specs in parallel
59+
</a></li>
60+
<li><a href="{{ site.github.url }}/tutorials/use_without_globals">
61+
Use without globals
62+
</a></li>
63+
</ol>
64+
65+
<h3>Techniques</h3>
66+
<ol class="doc-list">
67+
<li><a href="{{ site.github.url }}/tutorials/sharing_behaviors">Sharing behaviors</a></li>
68+
</ol>
69+
70+
<h3>Guides for Specific Environments</h3>
71+
<ol class="doc-list">
72+
<li><a href="{{ site.github.url }}/tutorials/react_with_browser">React with browser</a></li>
73+
<li><a href="{{ site.github.url }}/tutorials/react_with_node">React with node</a></li>
74+
</ol>
2875
</div>
2976
<div>
3077
<h2>API Reference</h2>
3178
<h3>jasmine-core</h3>
32-
<ol class="api-docs-versions">
79+
<ol class="doc-list">
3380
{% assign versions = site.api | sort: 'sortKey' %}
3481
{% for version in versions reversed %}
3582
{% if version.url contains "/global" and version.archived != true %}
@@ -38,7 +85,7 @@ <h3>jasmine-core</h3>
3885
{% endfor %}
3986
</ol>
4087
<h3>jasmine-npm</h3>
41-
<ol class="api-docs-versions">
88+
<ol class="doc-list">
4289
{% assign versions = site.npm-api | sort: 'sortKey' %}
4390
{% for version in versions reversed %}
4491
{% if version.title == "Class: Jasmine" and version.archived != true %}
@@ -47,7 +94,7 @@ <h3>jasmine-npm</h3>
4794
{% endfor %}
4895
</ol>
4996
<h3>jasmine-browser-runner</h3>
50-
<ol class="api-docs-versions">
97+
<ol class="doc-list">
5198
{% assign versions = site.browser-runner-api | sort: 'sortKey' %}
5299
{% for version in versions reversed %}
53100
{% if version.url contains "/module-jasmine-browser-runner" and version.archived != true %}

0 commit comments

Comments
 (0)