kitabu 1.0.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -3
- data/.travis.yml +18 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +67 -50
- data/README.md +235 -0
- data/attachments/browser-version.png +0 -0
- data/attachments/cover.png +0 -0
- data/attachments/kitabu.epub +0 -0
- data/attachments/kitabu.mobi +0 -0
- data/attachments/kitabu.pdf +0 -0
- data/{spec/support/mybook/output → examples/kitabu/output/epub/images}/.gitkeep +0 -0
- data/examples/kitabu/output/epub/images/kitabu-icon.png +0 -0
- data/examples/kitabu/output/epub/images/kitabu-icon.svg +19 -0
- data/examples/kitabu/output/epub/images/kitabu-word.png +0 -0
- data/examples/kitabu/output/epub/images/kitabu-word.svg +14 -0
- data/examples/kitabu/output/epub/images/kitabu.png +0 -0
- data/examples/kitabu/output/epub/images/kitabu.svg +20 -0
- data/examples/kitabu/output/epub/section_0.html +266 -0
- data/examples/kitabu/output/epub/section_1.html +246 -0
- data/examples/kitabu/output/epub/section_2.html +520 -0
- data/examples/kitabu/output/epub/section_3.html +282 -0
- data/examples/kitabu/output/epub/section_4.html +276 -0
- data/examples/kitabu/output/epub/styles/epub.css +437 -0
- data/examples/kitabu/output/epub/styles/html.css +712 -0
- data/examples/kitabu/output/epub/styles/pdf.css +840 -0
- data/examples/kitabu/output/epub/styles/print.css +1278 -0
- data/examples/kitabu/output/epub/toc.html +37 -0
- data/{spec/support/mybook/templates/epub/style.css → examples/kitabu/output/images/.gitkeep} +0 -0
- data/examples/kitabu/output/images/kitabu-icon.png +0 -0
- data/examples/kitabu/output/images/kitabu-icon.svg +19 -0
- data/examples/kitabu/output/images/kitabu-word.png +0 -0
- data/examples/kitabu/output/images/kitabu-word.svg +14 -0
- data/examples/kitabu/output/images/kitabu.png +0 -0
- data/examples/kitabu/output/images/kitabu.svg +20 -0
- data/examples/kitabu/output/kitabu.epub +0 -0
- data/examples/kitabu/output/kitabu.html +513 -0
- data/examples/kitabu/output/kitabu.mobi +0 -0
- data/examples/kitabu/output/kitabu.pdf +0 -0
- data/examples/kitabu/output/kitabu.pdf.html +729 -0
- data/examples/kitabu/output/kitabu.print.html +729 -0
- data/examples/kitabu/output/kitabu.print.pdf +0 -0
- data/examples/kitabu/output/kitabu.txt +440 -0
- data/examples/kitabu/output/styles/epub.css +437 -0
- data/examples/kitabu/output/styles/html.css +712 -0
- data/examples/kitabu/output/styles/pdf.css +840 -0
- data/examples/kitabu/output/styles/print.css +1278 -0
- data/kitabu.gemspec +7 -5
- data/lib/kitabu.rb +10 -20
- data/lib/kitabu/cli.rb +0 -5
- data/lib/kitabu/dependency.rb +0 -4
- data/lib/kitabu/exporter.rb +2 -0
- data/lib/kitabu/extensions/rouge.rb +9 -0
- data/lib/kitabu/generator.rb +9 -21
- data/lib/kitabu/helpers.rb +47 -0
- data/lib/kitabu/markdown.rb +31 -0
- data/lib/kitabu/parser.rb +21 -3
- data/lib/kitabu/parser/epub.rb +31 -18
- data/lib/kitabu/parser/html.rb +48 -29
- data/lib/kitabu/parser/mobi.rb +1 -1
- data/lib/kitabu/parser/pdf.rb +52 -8
- data/lib/kitabu/version.rb +2 -2
- data/spec/kitabu/cli/export_spec.rb +4 -4
- data/spec/kitabu/cli/new_spec.rb +2 -2
- data/spec/kitabu/markdown_spec.rb +24 -0
- data/spec/kitabu/parser/html_spec.rb +20 -25
- data/spec/kitabu/parser/mobi_spec.rb +14 -0
- data/spec/kitabu/parser/pdf_spec.rb +18 -1
- data/spec/kitabu/parser/txt_spec.rb +14 -0
- data/spec/spec_helper.rb +10 -6
- data/spec/support/mybook/config/helper.rb +4 -29
- data/spec/support/mybook/config/kitabu.yml +0 -10
- data/spec/support/mybook/templates/epub/cover.erb +4 -3
- data/{templates → spec/support/mybook/templates/epub}/cover.png +0 -0
- data/spec/support/mybook/templates/epub/page.erb +3 -2
- data/spec/support/mybook/templates/html/layout.erb +10 -13
- data/spec/support/mybook/templates/styles/epub.scss +3 -0
- data/spec/support/mybook/templates/styles/html.scss +3 -0
- data/spec/support/mybook/templates/styles/pdf.scss +3 -0
- data/spec/support/mybook/templates/styles/print.scss +3 -0
- data/spec/support/mybook/text/{01_Markdown_Chapter.markdown → 01_Markdown_Chapter.md} +2 -3
- data/spec/support/mybook/text/02_ERB_Chapter.md.erb +7 -0
- data/spec/support/mybook/text/{04_With_Directory/Some_Chapter.mkdn → 03_With_Directory/Some_Chapter.md} +0 -0
- data/spec/support/mybook/text/{CHANGELOG.textile → CHANGELOG.md} +2 -2
- data/spec/support/mybook/text/{TOC.textile → TOC.md} +0 -0
- data/spec/support/mybook/text/{_00_Introduction.markdown → _00_Introduction.md} +0 -0
- data/spec/support/shared.rb +14 -10
- data/templates/Gemfile +3 -3
- data/templates/Guardfile +1 -5
- data/templates/config.erb +5 -5
- data/templates/cover.erb +4 -3
- data/templates/epub.erb +3 -2
- data/templates/helper.rb +28 -29
- data/templates/images/.gitkeep +0 -0
- data/templates/images/kitabu-icon.png +0 -0
- data/templates/images/kitabu-icon.svg +19 -0
- data/templates/images/kitabu-word.png +0 -0
- data/templates/images/kitabu-word.svg +14 -0
- data/templates/images/kitabu.png +0 -0
- data/templates/images/kitabu.svg +20 -0
- data/{examples/RailsGuides/templates → templates/templates/epub}/cover.erb +4 -3
- data/templates/templates/epub/cover.png +0 -0
- data/templates/templates/epub/page.erb +16 -0
- data/templates/{layout.erb → templates/html/layout.erb} +22 -11
- data/templates/templates/styles/epub.scss +1 -0
- data/templates/templates/styles/files/_normalize.scss +427 -0
- data/templates/templates/styles/html.scss +252 -0
- data/templates/templates/styles/pdf.scss +371 -0
- data/templates/templates/styles/print.scss +2 -0
- data/templates/text/01_Getting_Started.md +26 -0
- data/templates/text/02_Creating_Chapters.md +22 -0
- data/templates/text/03_Syntax_Highlighting.erb +69 -0
- data/templates/text/04_Dynamic_Content.erb +64 -0
- data/templates/text/05_Exporting_Files.md +49 -0
- metadata +143 -83
- data/README.rdoc +0 -218
- data/examples/RailsGuides/config/helper.rb +0 -29
- data/examples/RailsGuides/config/kitabu.yml +0 -44
- data/examples/RailsGuides/images/challenge.png +0 -0
- data/examples/RailsGuides/images/posts_index.png +0 -0
- data/examples/RailsGuides/images/rails_welcome.png +0 -0
- data/examples/RailsGuides/output/RailsGuides.epub +0 -0
- data/examples/RailsGuides/output/RailsGuides.html +0 -1556
- data/examples/RailsGuides/output/RailsGuides.pdf +3 -4934
- data/examples/RailsGuides/templates/layout.css +0 -352
- data/examples/RailsGuides/templates/layout.erb +0 -43
- data/examples/RailsGuides/templates/syntax.css +0 -62
- data/examples/RailsGuides/templates/user.css +0 -19
- data/examples/RailsGuides/text/01_Guide_Assumptions.mkdn +0 -13
- data/examples/RailsGuides/text/02_What_is_Rails.mkdn +0 -106
- data/examples/RailsGuides/text/03_Creating_a_new_Rails_project.mkdn +0 -200
- data/examples/RailsGuides/text/04_Hello_Rails.mkdn +0 -62
- data/examples/RailsGuides/text/05_Getting_Up_and_Running_Quickly_with_Scaffolding.mkdn +0 -4
- data/examples/RailsGuides/text/06_Creating_a_resource.mkdn +0 -503
- data/examples/RailsGuides/text/07_Adding_a_second_model.mkdn +0 -232
- data/examples/RailsGuides/text/08_Refactoring.mkdn +0 -123
- data/examples/RailsGuides/text/09_Deleting_comments.mkdn +0 -57
- data/examples/RailsGuides/text/09_Security.mkdn +0 -56
- data/examples/RailsGuides/text/10_Building_a_multi_model_form.mkdn +0 -130
- data/examples/RailsGuides/text/11_View_helpers.mkdn +0 -50
- data/examples/RailsGuides/text/12_Whats_next.mkdn +0 -14
- data/examples/RailsGuides/text/13_Configuration_gotchas.mkdn +0 -10
- data/lib/kitabu/adapters/markdown.rb +0 -34
- data/lib/kitabu/extensions/redcloth.rb +0 -69
- data/lib/kitabu/syntax.rb +0 -130
- data/spec/kitabu/extensions/redcloth_spec.rb +0 -57
- data/spec/kitabu/syntax_spec.rb +0 -106
- data/spec/support/mybook/templates/html/layout.css +0 -353
- data/spec/support/mybook/templates/html/syntax.css +0 -58
- data/spec/support/mybook/templates/html/user.css +0 -1
- data/spec/support/mybook/text/02_Textile_Chapter.textile +0 -3
- data/spec/support/mybook/text/03_HTML_Chapter.html +0 -3
- data/templates/epub.css +0 -500
- data/templates/layout.css +0 -353
- data/templates/sample.md +0 -6
- data/templates/syntax.css +0 -58
- data/templates/user.css +0 -1
@@ -0,0 +1,252 @@
|
|
1
|
+
@import './files/normalize';
|
2
|
+
|
3
|
+
$cover-color: #5091b1;
|
4
|
+
$link-color: $cover-color;
|
5
|
+
|
6
|
+
html {
|
7
|
+
background: #eee;
|
8
|
+
padding: 50px;
|
9
|
+
}
|
10
|
+
|
11
|
+
body {
|
12
|
+
width: 700px;
|
13
|
+
padding: 50px;
|
14
|
+
background: #fff;
|
15
|
+
margin: 0 auto;
|
16
|
+
line-height: 1.4;
|
17
|
+
}
|
18
|
+
|
19
|
+
a {
|
20
|
+
color: $link-color;
|
21
|
+
}
|
22
|
+
|
23
|
+
p code,
|
24
|
+
li code {
|
25
|
+
color: #3F9C55;
|
26
|
+
}
|
27
|
+
|
28
|
+
// Format cover page.
|
29
|
+
.frontcover {
|
30
|
+
background: $cover-color;
|
31
|
+
color: #fff;
|
32
|
+
padding: 50px;
|
33
|
+
margin: -50px -50px 50px -50px;
|
34
|
+
text-align: center;
|
35
|
+
}
|
36
|
+
|
37
|
+
.frontcover * {
|
38
|
+
margin: 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
.frontcover .description {
|
42
|
+
width: 45%;
|
43
|
+
margin: 20px auto;
|
44
|
+
color: rgba(#fff, .7);
|
45
|
+
}
|
46
|
+
|
47
|
+
.frontcover .authors {
|
48
|
+
font-weight: thin;
|
49
|
+
text-transform: uppercase;
|
50
|
+
font-size: 24px;
|
51
|
+
}
|
52
|
+
|
53
|
+
// Define asterism.
|
54
|
+
.chapter + .chapter:before {
|
55
|
+
content: '\2234';
|
56
|
+
display: block;
|
57
|
+
text-align: center;
|
58
|
+
font-size: 24px;
|
59
|
+
padding: 50px 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
.chapter > h2 {
|
63
|
+
margin-top: 0;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Code highlighting
|
67
|
+
.highlight {
|
68
|
+
padding: 15px;
|
69
|
+
}
|
70
|
+
|
71
|
+
.highlight .gutter {
|
72
|
+
color: #ccc;
|
73
|
+
padding-right: 15px;
|
74
|
+
}
|
75
|
+
|
76
|
+
// Table of contents
|
77
|
+
.toc {
|
78
|
+
padding-bottom: 50px;
|
79
|
+
margin-bottom: 50px;
|
80
|
+
border-bottom: 1px solid #eee;
|
81
|
+
}
|
82
|
+
|
83
|
+
// Define chapter numbering
|
84
|
+
.chapters {
|
85
|
+
counter-reset: chapter 1;
|
86
|
+
}
|
87
|
+
|
88
|
+
.chapter {
|
89
|
+
counter-increment: chapter;
|
90
|
+
}
|
91
|
+
|
92
|
+
.chapter h2:before {
|
93
|
+
content: 'Chapter ' counter(chapter);
|
94
|
+
display: block;
|
95
|
+
text-transform: uppercase;
|
96
|
+
font-weight: normal;
|
97
|
+
color: #DB0209;
|
98
|
+
font-size: 14px;
|
99
|
+
}
|
100
|
+
|
101
|
+
.chapter h3 {
|
102
|
+
margin-top: 50px;
|
103
|
+
}
|
104
|
+
|
105
|
+
// Footnotes
|
106
|
+
.footnotes {
|
107
|
+
margin-top: 50px;
|
108
|
+
padding-top: 25px;
|
109
|
+
border-top: 1px solid #eee;
|
110
|
+
}
|
111
|
+
|
112
|
+
.footnotes hr {
|
113
|
+
display: none;
|
114
|
+
}
|
115
|
+
|
116
|
+
// Notes
|
117
|
+
.note {
|
118
|
+
font-size: 13px;
|
119
|
+
float: right;
|
120
|
+
overflow: hidden;
|
121
|
+
position: relative;
|
122
|
+
padding-left: 50px;
|
123
|
+
margin: 30px 0;
|
124
|
+
}
|
125
|
+
|
126
|
+
.note:before {
|
127
|
+
content: '!';
|
128
|
+
display: inline-block;
|
129
|
+
font-size: 25px;
|
130
|
+
width: 10px;
|
131
|
+
height: 10px;
|
132
|
+
padding: 15px;
|
133
|
+
line-height: 15px;
|
134
|
+
text-align: center;
|
135
|
+
border-radius: 50%;
|
136
|
+
border-bottom-right-radius: 0;
|
137
|
+
position: absolute;
|
138
|
+
top: 5px;
|
139
|
+
left: 0;
|
140
|
+
}
|
141
|
+
|
142
|
+
.note.info:before {
|
143
|
+
background: #f5be28;
|
144
|
+
color: #fff;
|
145
|
+
}
|
146
|
+
|
147
|
+
.note.warning:before {
|
148
|
+
background: #e42e24;
|
149
|
+
color: #fff;
|
150
|
+
}
|
151
|
+
|
152
|
+
// Format lexers list
|
153
|
+
.lexers-list {
|
154
|
+
margin: 0;
|
155
|
+
padding: 0;
|
156
|
+
-webkit-columns: 2;
|
157
|
+
columns: 2;
|
158
|
+
}
|
159
|
+
|
160
|
+
.lexers-list li {
|
161
|
+
-webkit-column-break-inside: avoid;
|
162
|
+
break-inside: avoid-column;
|
163
|
+
}
|
164
|
+
|
165
|
+
.lexers-list span {
|
166
|
+
font-size: 13px;
|
167
|
+
}
|
168
|
+
|
169
|
+
.lexers-list li + li {
|
170
|
+
margin-top: 15px;
|
171
|
+
}
|
172
|
+
|
173
|
+
// Format imprint
|
174
|
+
.imprint {
|
175
|
+
margin-top: 50px;
|
176
|
+
padding-top: 50px;
|
177
|
+
border-top: 1px solid #eee;
|
178
|
+
}
|
179
|
+
|
180
|
+
.imprint * {
|
181
|
+
margin: 0;
|
182
|
+
font-size: 12px;
|
183
|
+
}
|
184
|
+
|
185
|
+
.imprint .description {
|
186
|
+
margin-bottom: 10px;
|
187
|
+
}
|
188
|
+
|
189
|
+
// Table of contents
|
190
|
+
.table-of-contents {
|
191
|
+
padding-bottom: 50px;
|
192
|
+
margin-bottom: 50px;
|
193
|
+
border-bottom: 1px solid #eee;
|
194
|
+
}
|
195
|
+
|
196
|
+
.table-of-contents .level2 {
|
197
|
+
counter-increment: toc-level2;
|
198
|
+
counter-reset: toc-level3;
|
199
|
+
position: relative;
|
200
|
+
margin-bottom: 10px;
|
201
|
+
}
|
202
|
+
|
203
|
+
.table-of-contents .level2 a {
|
204
|
+
text-decoration: none;
|
205
|
+
color: #000;
|
206
|
+
text-transform: uppercase;
|
207
|
+
font-weight: bold;
|
208
|
+
}
|
209
|
+
|
210
|
+
.table-of-contents .level2:before {
|
211
|
+
content: 'Chapter ' counter(toc-level2);
|
212
|
+
font-size: 13px;
|
213
|
+
text-transform: uppercase;
|
214
|
+
font-weight: bold;
|
215
|
+
color: #aaa;
|
216
|
+
display: block;
|
217
|
+
}
|
218
|
+
|
219
|
+
.table-of-contents .level2 ~ .level2 {
|
220
|
+
margin-top: 40px;
|
221
|
+
}
|
222
|
+
|
223
|
+
#toc {
|
224
|
+
-webkit-columns: 2;
|
225
|
+
columns: 2;
|
226
|
+
}
|
227
|
+
|
228
|
+
#toc > div {
|
229
|
+
-webkit-column-break-inside: avoid;
|
230
|
+
break-inside: avoid-column;
|
231
|
+
}
|
232
|
+
|
233
|
+
// Go top
|
234
|
+
.go-top {
|
235
|
+
font-size: 50px;
|
236
|
+
text-decoration: none;
|
237
|
+
position: fixed;
|
238
|
+
bottom: 25px;
|
239
|
+
right: 25px;
|
240
|
+
width: 60px;
|
241
|
+
display: inline-block;
|
242
|
+
background: rgba(#000, .2);
|
243
|
+
text-align: center;
|
244
|
+
border-radius: 10px;
|
245
|
+
line-height: 1;
|
246
|
+
color: rgba(#fff, .4);
|
247
|
+
padding-top: 10px;
|
248
|
+
|
249
|
+
&:hover {
|
250
|
+
color: #fff;
|
251
|
+
}
|
252
|
+
}
|
@@ -0,0 +1,371 @@
|
|
1
|
+
@import './files/normalize';
|
2
|
+
|
3
|
+
$frontcover-color: #5091b1;
|
4
|
+
$page-height: 22.86cm;
|
5
|
+
$page-height: 19.05cm;
|
6
|
+
|
7
|
+
$frontcover-padding: 50px;
|
8
|
+
|
9
|
+
@page {
|
10
|
+
size: 19.05cm 22.86cm portrait;
|
11
|
+
}
|
12
|
+
|
13
|
+
@page chapter:left {
|
14
|
+
@bottom-left {
|
15
|
+
background: #000;
|
16
|
+
color: #fff;
|
17
|
+
content: counter(page);
|
18
|
+
font-size: 12px;
|
19
|
+
margin-left: -100px;
|
20
|
+
text-align: center;
|
21
|
+
width: 35px;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
@page chapter:right {
|
26
|
+
@bottom-right {
|
27
|
+
background: #000;
|
28
|
+
color: #fff;
|
29
|
+
content: counter(page);
|
30
|
+
font-size: 12px;
|
31
|
+
margin-right: -100px;
|
32
|
+
text-align: center;
|
33
|
+
width: 35px;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
@page frontcover {
|
38
|
+
margin: 0;
|
39
|
+
background: $frontcover-color;
|
40
|
+
border-left: 50px solid darken($frontcover-color, 10%);
|
41
|
+
}
|
42
|
+
|
43
|
+
@page chapter {
|
44
|
+
margin: 100px 100px 50px;
|
45
|
+
background: #fff;
|
46
|
+
|
47
|
+
@footnotes {
|
48
|
+
border-top: thin solid #777;
|
49
|
+
margin-top: 1em;
|
50
|
+
padding-top: .5em;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
@page white {
|
55
|
+
margin: 0;
|
56
|
+
background: #fff;
|
57
|
+
display: block;
|
58
|
+
height: 100%;
|
59
|
+
}
|
60
|
+
|
61
|
+
* {
|
62
|
+
box-sizing: border-box;
|
63
|
+
}
|
64
|
+
|
65
|
+
body {
|
66
|
+
font-family: Caslon, serif;
|
67
|
+
font-size: 14px;
|
68
|
+
line-height: 1.5;
|
69
|
+
}
|
70
|
+
|
71
|
+
a {
|
72
|
+
color: $frontcover-color;
|
73
|
+
}
|
74
|
+
|
75
|
+
.go-top {
|
76
|
+
display: none;
|
77
|
+
}
|
78
|
+
|
79
|
+
// White page
|
80
|
+
.white-page {
|
81
|
+
page: white;
|
82
|
+
page-break-before: always;
|
83
|
+
page-break-after: always;
|
84
|
+
}
|
85
|
+
|
86
|
+
.white-page:before {
|
87
|
+
content: 'This page intentionally left blank';
|
88
|
+
text-transform: uppercase;
|
89
|
+
position: absolute;
|
90
|
+
left: 0;
|
91
|
+
right: 0;
|
92
|
+
text-align: center;
|
93
|
+
top: 50%;
|
94
|
+
transform: translatey(-50%);
|
95
|
+
}
|
96
|
+
|
97
|
+
// Style frontcover
|
98
|
+
.frontcover {
|
99
|
+
page: frontcover;
|
100
|
+
padding: $frontcover-padding;
|
101
|
+
padding-left: 0;
|
102
|
+
text-align: center;
|
103
|
+
font-family: sans-serif;
|
104
|
+
}
|
105
|
+
|
106
|
+
.frontcover * {
|
107
|
+
margin: 0;
|
108
|
+
}
|
109
|
+
|
110
|
+
.frontcover .logo {
|
111
|
+
background: url('../images/kitabu-word.svg') no-repeat center bottom;
|
112
|
+
height: 150px;
|
113
|
+
margin-bottom: 35px;
|
114
|
+
}
|
115
|
+
|
116
|
+
.frontcover .logo img {
|
117
|
+
display: none;
|
118
|
+
}
|
119
|
+
|
120
|
+
.frontcover .description {
|
121
|
+
display: inline-block;
|
122
|
+
width: 400px;
|
123
|
+
font-size: 20px;
|
124
|
+
color: rgba(#fff, .7);
|
125
|
+
}
|
126
|
+
|
127
|
+
.frontcover .description:after {
|
128
|
+
content: '';
|
129
|
+
display: block;
|
130
|
+
background: url('../images/kitabu-icon.svg') no-repeat center bottom;
|
131
|
+
background-size: 200px;
|
132
|
+
height: 300px;
|
133
|
+
margin-top: 50px;
|
134
|
+
}
|
135
|
+
|
136
|
+
.frontcover .authors {
|
137
|
+
font-size: 24px;
|
138
|
+
padding: $frontcover-padding;
|
139
|
+
font-weight: bold;
|
140
|
+
margin-top: 30px;
|
141
|
+
color: rgba(#000, .4);
|
142
|
+
text-transform: uppercase;
|
143
|
+
}
|
144
|
+
|
145
|
+
.frontcover .authors:before {
|
146
|
+
content: 'By ';
|
147
|
+
}
|
148
|
+
|
149
|
+
// Style chapter
|
150
|
+
.chapters {
|
151
|
+
counter-reset: chapter;
|
152
|
+
}
|
153
|
+
|
154
|
+
.chapter {
|
155
|
+
page: chapter;
|
156
|
+
page-break-before: always;
|
157
|
+
counter-increment: chapter;
|
158
|
+
}
|
159
|
+
|
160
|
+
.chapter > h2 {
|
161
|
+
font-family: sans-serif;
|
162
|
+
margin: -100px -100px 75px -100px;
|
163
|
+
background: $frontcover-color;
|
164
|
+
padding: 100px;
|
165
|
+
color: rgba(#fff, .6);
|
166
|
+
font-size: 40px;
|
167
|
+
}
|
168
|
+
|
169
|
+
.chapter > h3 {
|
170
|
+
margin-top: 40px;
|
171
|
+
}
|
172
|
+
|
173
|
+
.chapter > h2:before {
|
174
|
+
content: 'Chapter ' counter(chapter);
|
175
|
+
display: block;
|
176
|
+
font-size: 18px;
|
177
|
+
text-transform: uppercase;
|
178
|
+
color: #fff;
|
179
|
+
}
|
180
|
+
|
181
|
+
// Code highlighting
|
182
|
+
p code,
|
183
|
+
li code {
|
184
|
+
font-size: 12px;
|
185
|
+
font-family: Menlo, monospace;
|
186
|
+
}
|
187
|
+
|
188
|
+
.highlight {
|
189
|
+
padding: 15px;
|
190
|
+
font-size: 12px;
|
191
|
+
}
|
192
|
+
|
193
|
+
.highlight * {
|
194
|
+
font-family: Menlo, monospace;
|
195
|
+
}
|
196
|
+
|
197
|
+
.highlight .gutter {
|
198
|
+
color: #aaa;
|
199
|
+
padding-right: 15px;
|
200
|
+
}
|
201
|
+
|
202
|
+
// Format lexers list
|
203
|
+
.lexers-list {
|
204
|
+
margin: 0;
|
205
|
+
padding: 0;
|
206
|
+
columns: 2;
|
207
|
+
list-style: none;
|
208
|
+
}
|
209
|
+
|
210
|
+
.lexers-list li {
|
211
|
+
-webkit-column-break-inside: avoid;
|
212
|
+
break-inside: avoid-column;
|
213
|
+
}
|
214
|
+
|
215
|
+
.lexers-list span {
|
216
|
+
font-size: 13px;
|
217
|
+
}
|
218
|
+
|
219
|
+
.lexers-list li + li {
|
220
|
+
margin-top: 15px;
|
221
|
+
}
|
222
|
+
|
223
|
+
// Footnotes
|
224
|
+
.fn {
|
225
|
+
counter-increment: footnote;
|
226
|
+
display: prince-footnote;
|
227
|
+
font-size: 9pt;
|
228
|
+
footnote-style-position: inside;
|
229
|
+
line-height: 1.4;
|
230
|
+
position: footnote;
|
231
|
+
}
|
232
|
+
|
233
|
+
.fn::footnote-call {
|
234
|
+
content: "";
|
235
|
+
font-size: 80%;
|
236
|
+
}
|
237
|
+
|
238
|
+
.fn::footnote-marker {
|
239
|
+
padding-right: 0.4em;
|
240
|
+
vertical-align: super;
|
241
|
+
display: none;
|
242
|
+
}
|
243
|
+
|
244
|
+
.footnote a,
|
245
|
+
.fn a {
|
246
|
+
color: #000;
|
247
|
+
}
|
248
|
+
|
249
|
+
.fn code {
|
250
|
+
font-size: 8pt;
|
251
|
+
}
|
252
|
+
|
253
|
+
// Table of contents
|
254
|
+
.table-of-contents {
|
255
|
+
page: chapter;
|
256
|
+
font-family: sans-serif;
|
257
|
+
}
|
258
|
+
|
259
|
+
.table-of-contents > h2 {
|
260
|
+
font-family: sans-serif;
|
261
|
+
margin: -100px -100px 75px -100px;
|
262
|
+
background: $frontcover-color;
|
263
|
+
padding: 100px;
|
264
|
+
color: rgba(#fff, .6);
|
265
|
+
font-size: 40px;
|
266
|
+
}
|
267
|
+
|
268
|
+
.table-of-contents a {
|
269
|
+
text-decoration: none;
|
270
|
+
}
|
271
|
+
|
272
|
+
.table-of-contents {
|
273
|
+
.level4 { display: none; }
|
274
|
+
.level5 { display: none; }
|
275
|
+
.level6 { display: none; }
|
276
|
+
}
|
277
|
+
|
278
|
+
.table-of-contents * + .level2 {
|
279
|
+
margin-top: 25px;
|
280
|
+
}
|
281
|
+
|
282
|
+
.table-of-contents .level2 a {
|
283
|
+
text-transform: uppercase;
|
284
|
+
font-weight: bold;
|
285
|
+
color: #000;
|
286
|
+
font-size: 20px;
|
287
|
+
position: relative;
|
288
|
+
padding-left: 25px;
|
289
|
+
|
290
|
+
&:before {
|
291
|
+
content: target-counter(attr(href), page) " ";
|
292
|
+
position: absolute;
|
293
|
+
left: 0;
|
294
|
+
transform: translatex(-100%);
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
.table-of-contents .level3 {
|
299
|
+
padding-left: 25px;
|
300
|
+
}
|
301
|
+
|
302
|
+
.table-of-contents .level3 {
|
303
|
+
margin-top: 10px;
|
304
|
+
}
|
305
|
+
|
306
|
+
.table-of-contents .level3 a {
|
307
|
+
position: relative;
|
308
|
+
color: #777;
|
309
|
+
|
310
|
+
&:after {
|
311
|
+
content: leader('.') target-counter(attr(href), page) " ";
|
312
|
+
cursor: default;
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
// Footnotes
|
317
|
+
.chapters {
|
318
|
+
counter-reset: fnref;
|
319
|
+
counter-reset: fndesc;
|
320
|
+
}
|
321
|
+
|
322
|
+
.fn-ref {
|
323
|
+
counter-increment: fnref;
|
324
|
+
}
|
325
|
+
|
326
|
+
.fn-desc {
|
327
|
+
counter-increment: fndesc;
|
328
|
+
display: prince-footnote;
|
329
|
+
footnote-style-position: inside;
|
330
|
+
position: footnote;
|
331
|
+
}
|
332
|
+
|
333
|
+
.fn-desc:footnote-marker {
|
334
|
+
vertical-align: super;
|
335
|
+
content: counter(fndesc);
|
336
|
+
margin-right: 5px;
|
337
|
+
}
|
338
|
+
|
339
|
+
// Notes
|
340
|
+
.note {
|
341
|
+
font-size: 13px;
|
342
|
+
float: right;
|
343
|
+
overflow: hidden;
|
344
|
+
position: relative;
|
345
|
+
padding-left: 50px;
|
346
|
+
margin: 30px 0;
|
347
|
+
}
|
348
|
+
|
349
|
+
.note:before {
|
350
|
+
content: '!';
|
351
|
+
display: inline-block;
|
352
|
+
font-size: 25px;
|
353
|
+
width: 10px;
|
354
|
+
height: 10px;
|
355
|
+
padding: 15px;
|
356
|
+
line-height: 15px;
|
357
|
+
text-align: center;
|
358
|
+
position: absolute;
|
359
|
+
top: 15px;
|
360
|
+
left: 0;
|
361
|
+
}
|
362
|
+
|
363
|
+
.note.info:before {
|
364
|
+
background: #f5be28;
|
365
|
+
color: #fff;
|
366
|
+
}
|
367
|
+
|
368
|
+
.note.warning:before {
|
369
|
+
background: #e42e24;
|
370
|
+
color: #fff;
|
371
|
+
}
|