glyph 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. data/book/config.yml +1 -1
  2. data/book/document.glyph +5 -5
  3. data/book/lib/layouts/bookindex.glyph +4 -27
  4. data/book/lib/layouts/bookpage.glyph +5 -28
  5. data/book/lib/macros/reference.rb +4 -12
  6. data/book/text/changelog.glyph +10 -2
  7. data/book/text/compiling/compiling.glyph +0 -1
  8. data/book/text/extending/interpreting.glyph +1 -1
  9. data/book/text/introduction.glyph +21 -29
  10. data/book/text/license.glyph +1 -1
  11. data/book/text/macros/macros_core.glyph +0 -3
  12. data/book/text/ref_commands.glyph +32 -24
  13. data/book/text/stats/stats.glyph +1 -1
  14. data/book/text/text_editing/code.glyph +2 -2
  15. data/book/text/text_editing/evaluation.glyph +6 -6
  16. data/book/text/text_editing/inclusions.glyph +2 -2
  17. data/book/text/text_editing/links.glyph +3 -3
  18. data/config.yml +8 -1
  19. data/glyph-0.5.1.gem +0 -0
  20. data/glyph.gemspec +7 -7
  21. data/lib/glyph.rb +2 -2
  22. data/lib/glyph/commands.rb +9 -16
  23. data/lib/glyph/commands/add.rb +1 -1
  24. data/lib/glyph/commands/compile.rb +1 -1
  25. data/lib/glyph/commands/config.rb +1 -1
  26. data/lib/glyph/commands/init.rb +1 -1
  27. data/lib/glyph/commands/outline.rb +1 -1
  28. data/lib/glyph/commands/stats.rb +1 -1
  29. data/lib/glyph/commands/todo.rb +1 -1
  30. data/lib/glyph/utils.rb +200 -175
  31. data/macros/block.rb +2 -2
  32. data/macros/reps/html.rb +4 -3
  33. data/macros/reps/html5.rb +4 -3
  34. data/macros/structure.rb +1 -0
  35. data/spec/config.yml +3 -3
  36. data/spec/lib/commands_spec.rb +15 -28
  37. data/spec/macros/core_spec.rb +4 -4
  38. data/spec/macros/filters_spec.rb +3 -3
  39. data/spec/macros/html5_spec.rb +3 -3
  40. data/spec/macros/macros_spec.rb +28 -3
  41. data/spec/macros/textile_spec.rb +2 -2
  42. data/spec/macros/web5_spec.rb +4 -4
  43. data/spec/macros/web_spec.rb +4 -4
  44. data/spec/spec_helper.rb +12 -1
  45. data/spec/tasks/generate_spec.rb +1 -1
  46. data/styles/coderay.css +9 -7
  47. data/styles/coderay.scss +7 -7
  48. data/styles/default.css +60 -43
  49. data/styles/default.scss +68 -40
  50. data/styles/definitions.scss +1 -1
  51. data/styles/pagination.css +16 -13
  52. data/styles/pagination.scss +18 -18
  53. data/tasks/generate.rake +3 -3
  54. data/tasks/load.rake +1 -4
  55. metadata +98 -47
@@ -1,3 +1,4 @@
1
+ @import url(http://fonts.googleapis.com/css?family=Crimson+Text:400,700,400italic,700italic|Inconsolata);
1
2
  * {
2
3
  font-family: inherit;
3
4
  border: none;
@@ -12,9 +13,6 @@ html {
12
13
  ol, ul {
13
14
  margin: 0.3em 0; }
14
15
 
15
- p {
16
- margin: 1em 0; }
17
-
18
16
  table {
19
17
  border-collapse: collapse;
20
18
  border-spacing: 0;
@@ -37,30 +35,31 @@ body {
37
35
  margin: auto;
38
36
  text-align: center; }
39
37
  .titlepage h1 {
40
- font-size: 2.5em;
41
- font-weight: bold;
42
- line-height: 1.5em;
43
- margin-bottom: 0.2em; }
38
+ padding-top: 0;
39
+ line-height: 1.3em;
40
+ font-size: 3em;
41
+ font-style: italic;
42
+ font-weight: normal; }
43
+ .titlepage h2 {
44
+ padding-top: 0;
45
+ line-height: 1.3em;
46
+ font-size: 1.5em;
47
+ font-weight: normal;
48
+ margin-bottom: 0.5em;
49
+ prince-bookmark-level: none; }
44
50
 
45
51
  .halftitlepage h1 {
46
- font-size: 2.5em;
47
- font-weight: bold;
48
- line-height: 1.5em;
52
+ padding-top: 0;
53
+ font-size: 3em;
54
+ font-weight: normal;
55
+ line-height: 1.3em;
56
+ font-style: italic;
49
57
  margin-bottom: 0.2em; }
50
58
  .halftitlepage h2 {
51
- font-size: 1.1em;
52
- font-style: italic;
53
- font-weight: bold;
54
- line-height: 1.2em;
55
- margin-bottom: 0.5em;
56
- prince-bookmark-level: none; }
57
-
58
- .titlepage h2 {
59
- font-size: 1.1em;
60
- font-style: italic;
61
- font-weight: bold;
62
- line-height: 1.2em;
63
- margin-bottom: 0.5em;
59
+ padding-top: 0;
60
+ font-size: 1.5em;
61
+ font-weight: normal;
62
+ line-height: 1.3em;
64
63
  prince-bookmark-level: none; }
65
64
 
66
65
  .author {
@@ -70,9 +69,15 @@ body {
70
69
  font-size: 0.8em; }
71
70
 
72
71
  li {
73
- list-style-type: square;
74
- margin: 0.4em 0;
75
- margin-left: 1.5em; }
72
+ margin: 0;
73
+ margin-left: 1.3em; }
74
+
75
+ ul li {
76
+ list-style-type: disc; }
77
+ ul li li {
78
+ list-style-type: circle; }
79
+ ul li li li {
80
+ list-style-type: square; }
76
81
 
77
82
  ol li {
78
83
  list-style-type: decimal; }
@@ -82,7 +87,8 @@ ol li {
82
87
 
83
88
  img {
84
89
  margin: 0 5px;
85
- padding: 2px; }
90
+ padding: 2px;
91
+ max-width: 675px; }
86
92
 
87
93
  dt {
88
94
  font-weight: bold;
@@ -97,7 +103,7 @@ blockquote {
97
103
  color: #121212; }
98
104
 
99
105
  table {
100
- border: 1px solid #e6e6e6; }
106
+ border: 1px solid black; }
101
107
 
102
108
  th {
103
109
  background: #EEE; }
@@ -105,8 +111,8 @@ th {
105
111
  tr, td, th {
106
112
  padding: 5px; }
107
113
 
108
- td, tr {
109
- border: 1px solid #e6e6e6; }
114
+ td, tr, th {
115
+ border: 1px solid black; }
110
116
 
111
117
  sup {
112
118
  font-size: 0.7em;
@@ -127,25 +133,31 @@ sup {
127
133
  text-align: center; }
128
134
 
129
135
  .note, .important, .tip, .caution, .box {
130
- border: 1px solid #e6e6e6;
136
+ border-top: 1px solid black;
137
+ border-bottom: 1px solid black;
131
138
  display: block;
132
- margin: 0.5em auto;
133
- padding: 0 0.5em;
139
+ min-height: 50px;
140
+ margin: 1em auto;
141
+ padding: 0.5em 0.5em;
134
142
  width: 600px;
135
- background: #EEE;
136
- color: #1F1F1F; }
143
+ color: #000; }
137
144
 
138
145
  .note > p, .important > p, .tip > p, .caution > p {
146
+ display: block;
139
147
  margin: 0;
140
148
  padding: 0; }
141
149
 
142
150
  .note-title {
151
+ display: block;
152
+ vertical-align: middle;
143
153
  font-weight: bold;
154
+ font-variant: small-caps;
144
155
  margin-right: 1em; }
145
156
 
146
157
  .box-title {
147
158
  display: block;
148
159
  text-align: center;
160
+ font-variant: small-caps;
149
161
  font-weight: bold; }
150
162
 
151
163
  .comment {
@@ -171,27 +183,32 @@ body {
171
183
  color: #000;
172
184
  font-size: 1em; }
173
185
 
174
- h2, section section h1, h1.toc-header {
186
+ h2, section section section h1, h1.toc-header {
175
187
  display: block;
176
188
  font-size: 2em;
177
189
  font-weight: bold;
178
- margin: 3em 0 1em 0; }
190
+ margin: 1em 0; }
179
191
 
180
- h3, section section section h1 {
192
+ h3, section section section section h1 {
181
193
  font-size: 1.6em;
182
194
  font-weight: bold;
183
195
  margin: 3em 0 1em 0; }
184
196
 
185
- h4, section section section section h1 {
197
+ h4, section section section section section h1 {
186
198
  font-size: 1.3em;
187
199
  font-weight: bold;
188
200
  margin: 3em 0 1em 0; }
189
201
 
190
- h5, section section section section section h1 {
202
+ h5, section section section section section section h1 {
191
203
  font-size: 1.2em;
192
204
  font-weight: bold;
193
205
  margin: 3em 0 1em 0; }
194
206
 
207
+ h6, section section section section section section section h1 {
208
+ font-size: 1.1em;
209
+ font-weight: bold;
210
+ margin: 3em 0 1em 0; }
211
+
195
212
  em {
196
213
  font-style: italic; }
197
214
 
@@ -221,7 +238,7 @@ nav, .navigation {
221
238
  display: block;
222
239
  margin: 1em auto;
223
240
  text-align: center;
224
- border: 1px solid #e6e6e6; }
241
+ border: 1px solid black; }
225
242
 
226
243
  nav.contents {
227
244
  margin: auto;
@@ -249,7 +266,7 @@ td p, td ul, td ol {
249
266
 
250
267
  /* FONTS */
251
268
  body {
252
- font-family: "Gentium Book Basic", "Book Antiqua", "Times New Roman", "Serif"; }
269
+ font-family: "Crimson Text", Serif; }
253
270
 
254
271
  code, pre {
255
- font-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier", "Monospace"; }
272
+ font-family: "Inconsolata", Monospace; }
@@ -14,9 +14,6 @@ html {
14
14
  ol, ul {
15
15
  margin: 0.3em 0; }
16
16
 
17
- p {
18
- margin: 1em 0; }
19
-
20
17
  table {
21
18
  border-collapse: collapse;
22
19
  border-spacing: 0;
@@ -40,33 +37,38 @@ body {
40
37
  margin: auto;
41
38
  text-align: center;
42
39
  h1 {
43
- font-size: 2.5em;
44
- font-weight: bold;
45
- line-height: 1.5em;
46
- margin-bottom: 0.2em; } }
40
+ padding-top: 0;
41
+ line-height: 1.3em;
42
+ font-size: 3em;
43
+ font-style: italic;
44
+ font-weight: normal;
45
+ }
46
+
47
+ h2 {
48
+ padding-top: 0;
49
+ line-height: 1.3em;
50
+ font-size: 1.5em;
51
+ font-weight: normal;
52
+ margin-bottom: 0.5em;
53
+ prince-bookmark-level: none;
54
+ }
55
+ }
47
56
 
48
57
  .halftitlepage {
49
58
  h1 {
50
- font-size: 2.5em;
51
- font-weight: bold;
52
- line-height: 1.5em;
59
+ padding-top: 0;
60
+ font-size: 3em;
61
+ font-weight: normal;
62
+ line-height: 1.3em;
63
+ font-style: italic;
53
64
  margin-bottom: 0.2em; }
54
65
  h2 {
55
- font-size: 1.1em;
56
- font-style: italic;
57
- font-weight: bold;
58
- line-height: 1.2em;
59
- margin-bottom: 0.5em;
66
+ padding-top: 0;
67
+ font-size: 1.5em;
68
+ font-weight: normal;
69
+ line-height: 1.3em;
60
70
  prince-bookmark-level: none; } }
61
71
 
62
- .titlepage h2 {
63
- font-size: 1.1em;
64
- font-style: italic;
65
- font-weight: bold;
66
- line-height: 1.2em;
67
- margin-bottom: 0.5em;
68
- prince-bookmark-level: none; }
69
-
70
72
  .author {
71
73
  font-size: 1em; }
72
74
 
@@ -74,9 +76,20 @@ body {
74
76
  font-size: 0.8em; }
75
77
 
76
78
  li {
77
- list-style-type: square;
78
- margin: 0.4em 0;
79
- margin-left: 1.5em; }
79
+ margin: 0;
80
+ margin-left: 1.3em; }
81
+
82
+ ul {
83
+ li {
84
+ list-style-type: disc;
85
+ li {
86
+ list-style-type: circle;
87
+ li {
88
+ list-style-type: square;
89
+ }
90
+ }
91
+ }
92
+ }
80
93
 
81
94
  ol li {
82
95
  list-style-type: decimal; }
@@ -86,7 +99,9 @@ ol li {
86
99
 
87
100
  img {
88
101
  margin: 0 5px;
89
- padding: 2px; }
102
+ padding: 2px;
103
+ max-width: 675px;
104
+ }
90
105
 
91
106
  dt {
92
107
  font-weight: bold;
@@ -109,7 +124,7 @@ th {
109
124
  tr, td, th {
110
125
  padding: 5px; }
111
126
 
112
- td, tr {
127
+ td, tr, th {
113
128
  @include standard-border; }
114
129
 
115
130
  sup {
@@ -132,25 +147,31 @@ sup {
132
147
  text-align: center; }
133
148
 
134
149
  .note, .important, .tip, .caution, .box {
135
- @include standard-border;
150
+ border-top: 1px solid $border-color;
151
+ border-bottom: 1px solid $border-color;
136
152
  display: block;
137
- margin: 0.5em auto;
138
- padding: 0 0.5em;
153
+ min-height: 50px;
154
+ margin: 1em auto;
155
+ padding: 0.5em 0.5em;
139
156
  width: 600px;
140
- background: #EEE;
141
- color: #1F1F1F; }
157
+ color: #000; }
142
158
 
143
159
  .note>p, .important>p, .tip>p, .caution>p {
160
+ display: block;
144
161
  margin: 0;
145
162
  padding: 0; }
146
163
 
147
164
  .note-title {
165
+ display: block;
166
+ vertical-align: middle;
148
167
  font-weight: bold;
168
+ font-variant: small-caps;
149
169
  margin-right: 1em; }
150
170
 
151
171
  .box-title {
152
172
  display: block;
153
173
  text-align: center;
174
+ font-variant: small-caps;
154
175
  font-weight: bold; }
155
176
 
156
177
  .comment {
@@ -177,27 +198,32 @@ body {
177
198
  color: #000;
178
199
  font-size: 1em; }
179
200
 
180
- h2, section section h1, h1.toc-header {
201
+ h2, section section section h1, h1.toc-header {
181
202
  display: block;
182
203
  font-size: 2em;
183
204
  font-weight: bold;
184
- margin: 3em 0 1em 0; }
205
+ margin: 1em 0; }
185
206
 
186
- h3, section section section h1 {
207
+ h3, section section section section h1 {
187
208
  font-size: 1.6em;
188
209
  font-weight: bold;
189
210
  margin: 3em 0 1em 0; }
190
211
 
191
- h4, section section section section h1 {
212
+ h4, section section section section section h1 {
192
213
  font-size: 1.3em;
193
214
  font-weight: bold;
194
215
  margin: 3em 0 1em 0; }
195
216
 
196
- h5, section section section section section h1 {
217
+ h5, section section section section section section h1 {
197
218
  font-size: 1.2em;
198
219
  font-weight: bold;
199
220
  margin: 3em 0 1em 0; }
200
221
 
222
+ h6, section section section section section section section h1 {
223
+ font-size: 1.1em;
224
+ font-weight: bold;
225
+ margin: 3em 0 1em 0; }
226
+
201
227
  em {
202
228
  font-style: italic; }
203
229
 
@@ -251,8 +277,10 @@ td {
251
277
 
252
278
  /* FONTS */
253
279
 
280
+ @import url(http://fonts.googleapis.com/css?family=Crimson+Text:400,700,400italic,700italic|Inconsolata);
281
+
254
282
  body {
255
- font-family: "Gentium Book Basic", "Book Antiqua", "Times New Roman", "Serif"; }
283
+ font-family: "Crimson Text", Serif; }
256
284
 
257
285
  code, pre {
258
- font-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier", "Monospace"; }
286
+ font-family: "Inconsolata", Monospace; }
@@ -1,4 +1,4 @@
1
- $border-color: #e6e6e6;
1
+ $border-color: #000;
2
2
  $link-color: #007BC4;
3
3
  $link-hover-color: #005B91;
4
4
 
@@ -1,6 +1,6 @@
1
1
  @page {
2
2
  size: A4;
3
- margin: 40pt 30pt 40pt 30pt;
3
+ margin: 60pt 30pt 60pt 30pt;
4
4
  @top {
5
5
  content: string(book-title) " - " string(chapter-title);
6
6
  font-style: italic; }
@@ -8,6 +8,9 @@
8
8
  @bottom {
9
9
  content: counter(page, decimal); } }
10
10
 
11
+ .bodymatter > :nth-child(1) {
12
+ counter-reset: page 1; }
13
+
11
14
  @page frontmatter {
12
15
  @bottom {
13
16
  content: counter(page, lower-roman); } }
@@ -110,23 +113,23 @@ div.backmatter {
110
113
  .bodymatter h3::before, .bodymatter section h1:before {
111
114
  content: counter(h2) "." counter(h3) " "; }
112
115
 
113
- .backmatter h3::before {
116
+ .backmatter h3.toc::before {
114
117
  content: counter(a2, upper-latin) "." counter(h3) " "; }
115
118
 
116
- .bodymatter section section h1:before {
119
+ .bodymatter section section h1.toc:before {
117
120
  content: counter(a2, upper-latin) "." counter(h3) " "; }
118
- .bodymatter h4::before, .bodymatter section section h1:before {
121
+ .bodymatter h4.toc::before, .bodymatter section section h1.toc:before {
119
122
  content: counter(h2) "." counter(h3) "." counter(h4) " "; }
120
123
 
121
- .backmatter h4::before {
124
+ .backmatter h4.toc::before {
122
125
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
123
126
 
124
- .bodymatter section section section h2:before {
127
+ .bodymatter section section section h2.toc:before {
125
128
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
126
- .bodymatter h5::before, .bodymatter section section section section h2:before {
129
+ .bodymatter h5.toc::before, .bodymatter section section section section h2.toc:before {
127
130
  content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "; }
128
131
 
129
- .backmatter h5::before, .bodymatter section section section section h2:before {
132
+ .backmatter h5.toc::before, .bodymatter section section section section h2.toc:before {
130
133
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) "." counter(h5) " "; }
131
134
 
132
135
  h2, section h1 {
@@ -137,23 +140,23 @@ h2, section h1 {
137
140
  .halftitlepage h2, .titlepage h2 {
138
141
  page-break-before: avoid; }
139
142
 
140
- .bodymatter h2, .bodymatter h1 {
143
+ .bodymatter .chapter {
141
144
  counter-increment: h2;
142
145
  counter-reset: h3; }
143
146
 
144
- .backmatter h2, .backmatter h1 {
147
+ .backmatter .appendix {
145
148
  counter-increment: a2;
146
149
  counter-reset: h3; }
147
150
 
148
- .bodymatter h3, .backmatter h3, .bodymatter section h1, .backmatter section h1 {
151
+ .bodymatter h3.toc, .backmatter h3.toc, .bodymatter section h1.toc, .backmatter section h1.toc {
149
152
  counter-increment: h3;
150
153
  counter-reset: h4; }
151
154
 
152
- .bodymatter h4, .backmatter h4, .bodymatter section section h1, .backmatter section section h1 {
155
+ .bodymatter h4.toc, .backmatter h4.toc, .bodymatter section section h1.toc, .backmatter section section h1.toc {
153
156
  counter-increment: h4;
154
157
  counter-reset: h5; }
155
158
 
156
- .bodymatter h5, .backmatter h5, .bodymatter section section section h1, .backmatter section section section h1 {
159
+ .bodymatter h5.toc, .backmatter h5.toc, .bodymatter section section section h1.toc, .backmatter section section section h1.toc {
157
160
  counter-increment: h5; }
158
161
 
159
162
  h1, h2, h3, h4, h5 {