-
Notifications
You must be signed in to change notification settings - Fork 0
/
es6-features.html
104 lines (78 loc) · 2.25 KB
/
es6-features.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
layout: default
---
{% assign book = site.data.es6_features.book %}
<!-- todo: check - can we use book.contents - why? why not? -->
{% assign book_contents = site.data.es6_features.contents %}
<p>
<a href="index.html">=()=> Fun Press</a>
</p>
<!-- cover -->
<h1>{{ book.title }}</h1>
<h3>by {{ book.author.name }}</h3>
<!-- table of contents -->
<div class='toc'>
Contents
<ul>
{% for chapter in book_contents %}
<li>{{ chapter.title }}
<ul>
{% for sec in chapter.sections %}
<li>{{ sec.title }}
{% if sec.sections %}
<ul>
{% for subsec in sec.sections %}
<li>{{ subsec.title }}</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
<h2>Notes</h2>
<p>
This is the <a href="https://github.com/lukehoban/es6features">original source</a>
reformatted in a single-page book edition (using the
<a href="http://manuscripts.github.io">Manuscripts format</a>).
</p>
<p>See the <a href="https://github.com/funpress/es6-features">source repo</a> for how
the book gets auto-built with "plain" Jekyll - of course - and hosted on GitHub Pages.
</p>
<p>
Onwards.
</p>
<!-- chapters -->
{% for chapter in book_contents %}
<div class="chapter">
<h1>{{forloop.index}}. {{ chapter.title }}</h1>
<!-- add mini table of contents for chapter if available -->
{% if chapter.sections %}
Contents
<ul>
{% for sec in chapter.sections %}
<li>{{ sec.title }}
{% if sec.sections %}
<ul>
{% for subsec in sec.sections %}
<li>{{ subsec.title }}</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
<!-- try adding content using include_relative -->
{% capture txt %}{% include_relative _es6-features/{{chapter.path}} %}{% endcapture %}
<!-- hack: cut off yaml front matter header
possible alternative??:
try to use collection and use a content lookup with title or path - why? whynot??
-->
{% assign txt2 = txt | replace_first: '---', '' | replace_first: '---', '@@END@@' | split: '@@END@@' %}
{{ txt2[1] | markdownify }}
</div>
{% endfor %}