glyph 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,214 @@
1
+ @page {
2
+ size: A4;
3
+ margin: 40pt 30pt 40pt 30pt;
4
+ @top {
5
+ content: string(book-title) " - " string(chapter-title);
6
+ font-style: italic; }
7
+
8
+ @bottom {
9
+ content: counter(page, decimal); } }
10
+
11
+
12
+ @page frontmatter {
13
+ @bottom {
14
+ content: counter(page, lower-roman); } }
15
+
16
+
17
+ @page backmatter {
18
+ @bottom {
19
+ content: counter(page, decimal); } }
20
+
21
+
22
+ @page :first {
23
+ padding-top: 10%;
24
+ @top {
25
+ content: normal; }
26
+
27
+ @bottom {
28
+ content: normal; } }
29
+
30
+
31
+ ol.toc {
32
+ margin-left: 1.5em; }
33
+
34
+ .toc {
35
+ > li[class] {
36
+ font-weight: bold; }
37
+ li {
38
+ list-style-type: none;
39
+ margin-left: 0;
40
+ a {
41
+ color: #000;
42
+ &:hover {
43
+ color: #000; }
44
+ &::after {
45
+ content: leader(".") target-counter(attr(href), page); } } } }
46
+
47
+ .titlepage h1, .halftitlepage h1 {
48
+ string-set: book-title content(); }
49
+
50
+ /* TOC Counters */
51
+
52
+ .toc {
53
+ > li {
54
+ &[class~=chapter] {
55
+ counter-increment: toc1;
56
+ counter-reset: toc2; }
57
+ &[class~=appendix] {
58
+ counter-increment: appendix1;
59
+ counter-reset: toc2; } }
60
+ ol {
61
+ li[class] {
62
+ counter-increment: toc2;
63
+ counter-reset: toc3; }
64
+ ol {
65
+ li[class] {
66
+ counter-increment: toc3;
67
+ counter-reset: toc4; }
68
+ ol {
69
+ li[class] {
70
+ counter-increment: toc4;
71
+ counter-reset: toc5; }
72
+ ol li[class] {
73
+ counter-increment: toc5; } } } }
74
+ > li {
75
+ &[class~=chapter]::before {
76
+ content: counter(toc1) ". "; }
77
+ &[class~=appendix]::before {
78
+ content: counter(appendix1, upper-latin) ". "; }
79
+ &[class] {
80
+ margin: 1em 0; } }
81
+ ol {
82
+ li[class]::before {
83
+ margin-left: 1em; }
84
+ ol {
85
+ li[class]::before {
86
+ margin-left: 2em; }
87
+ ol {
88
+ li[class]::before {
89
+ margin-left: 3em; }
90
+ ol li[class]::before {
91
+ margin-left: 4em; } } }
92
+ li {
93
+ &[class~=frontmatter]::before {
94
+ content: " "; }
95
+ &[class~=bodymatter]::before {
96
+ content: counter(toc1) "." counter(toc2) " "; }
97
+ &[class~=appendix]::before {
98
+ content: counter(appendix1, upper-latin) "." counter(toc2) " "; } }
99
+ ol {
100
+ li {
101
+ &[class~=bodymatter]::before {
102
+ content: counter(toc1) "." counter(toc2) "." counter(toc3) " "; }
103
+ &[class~=appendix]::before {
104
+ content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) " "; } }
105
+ ol {
106
+ li {
107
+ &[class~=bodymatter]::before {
108
+ content: counter(toc1) "." counter(toc2) "." counter(toc3) "." counter(toc4) " "; }
109
+ &[class~=appendix]::before {
110
+ content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) "." counter(toc4) " "; } }
111
+ ol li {
112
+ &[class~=bodymatter]::before {
113
+ content: counter(toc1) "." counter(toc2) "." counter(toc3) "." counter(toc4) "." counter(toc5) " "; }
114
+ &[class~=appendix]::before {
115
+ content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) "." counter(toc4) "." counter(toc5) " "; } } } } } }
116
+
117
+ div {
118
+ &.frontmatter {
119
+ page: frontmatter; }
120
+ &.backmatter {
121
+ page: backmatter; } }
122
+
123
+ .bodymatter {
124
+ h2::before, h1:before {
125
+ content: "Chapter " counter(h2, upper-roman) ": ";
126
+ counter-reset: footnote; } }
127
+
128
+ .backmatter h2::before {
129
+ content: "Appendix " counter(a2, upper-latin) ": "; }
130
+
131
+ .bodymatter {
132
+ section h1:before {
133
+ content: "Appendix " counter(a2, upper-latin) ": "; }
134
+ h3::before, section h1:before {
135
+ content: counter(h2) "." counter(h3) " "; } }
136
+
137
+ .backmatter h3::before {
138
+ content: counter(a2, upper-latin) "." counter(h3) " "; }
139
+
140
+ .bodymatter {
141
+ section section h1:before {
142
+ content: counter(a2, upper-latin) "." counter(h3) " "; }
143
+ h4::before, section section h1:before {
144
+ content: counter(h2) "." counter(h3) "." counter(h4) " "; } }
145
+
146
+ .backmatter h4::before {
147
+ content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
148
+
149
+ .bodymatter {
150
+ section section section h2:before {
151
+ content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
152
+ h5::before, section section section section h2:before {
153
+ content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "; } }
154
+
155
+ .backmatter h5::before, .bodymatter section section section section h2:before {
156
+ content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) "." counter(h5) " "; }
157
+
158
+ h2, section h1 {
159
+ padding-top: 2em;
160
+ string-set: chapter-title content();
161
+ page-break-before: always; }
162
+
163
+ .halftitlepage h2, .titlepage h2 {
164
+ page-break-before: avoid; }
165
+
166
+ .bodymatter {
167
+ h2, h1 {
168
+ counter-increment: h2;
169
+ counter-reset: h3; } }
170
+
171
+ .backmatter {
172
+ h2, h1 {
173
+ counter-increment: a2;
174
+ counter-reset: h3; } }
175
+
176
+ .bodymatter h3, .backmatter h3, .bodymatter section h1, .backmatter section h1 {
177
+ counter-increment: h3;
178
+ counter-reset: h4; }
179
+
180
+ .bodymatter h4, .backmatter h4, .bodymatter section section h1, .backmatter section section h1 {
181
+ counter-increment: h4;
182
+ counter-reset: h5; }
183
+
184
+ .bodymatter h5, .backmatter h5, .bodymatter section section section h1, .backmatter section section section h1 {
185
+ counter-increment: h5; }
186
+
187
+ h1, h2, h3, h4, h5 {
188
+ page-break-after: avoid; }
189
+
190
+ .box, .note, .important, .tip, .caution, .code {
191
+ page-break-inside: avoid; }
192
+
193
+ /* Footnotes */
194
+
195
+ @page {
196
+ @footnotes {
197
+ border-top: 1px solid #000; } }
198
+
199
+
200
+ .fn {
201
+ font-size: 85%;
202
+ margin-left: 1.5em;
203
+ display: prince-footnote;
204
+ counter-increment: footnote;
205
+ &:footnote-call {
206
+ content: counter(footnote);
207
+ font-size: 85%;
208
+ vertical-align: super;
209
+ line-height: none;
210
+ font-weight: bold;
211
+ margin-left: 1pt; }
212
+ &:footnote-marker {
213
+ font-weight: bold;
214
+ margin-right: 0.5em; } }
data/tasks/generate.rake CHANGED
@@ -91,7 +91,7 @@ namespace :generate do
91
91
  index_layout = Glyph["output.#{Glyph['document.output']}.layouts.index"] || :index
92
92
  # Generate index topic
93
93
  context = {}
94
- context[:document] = Glyph::Document.new(Glyph::DocumentNode.new).inherit_from(Glyph.document)
94
+ context[:document] = Glyph::Document.new(Glyph::DocumentNode.new).inherit_from(Glyph.document, :topics => false)
95
95
  context[:source] = {:name => "layout:#{index_layout}", :file => "layouts/#{index_layout}.glyph"}
96
96
  # Do not display errors (already displayed when document is finalized).
97
97
  q = Glyph['system.quiet']
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glyph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Fabio Cevasco
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-03 00:00:00 +02:00
18
+ date: 2010-09-23 00:00:00 -06:00
19
19
  default_executable: glyph
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -337,6 +337,7 @@ files:
337
337
  - spec/files/markdown.markdown
338
338
  - spec/files/references.glyph
339
339
  - spec/files/test.sass
340
+ - spec/files/test.scss
340
341
  - spec/files/web1.glyph
341
342
  - spec/files/web2.glyph
342
343
  - spec/files/web_doc.glyph
@@ -366,8 +367,13 @@ files:
366
367
  - spec/tasks/load_spec.rb
367
368
  - spec/tasks/project_spec.rb
368
369
  - styles/coderay.css
370
+ - styles/coderay.scss
369
371
  - styles/default.css
372
+ - styles/default.scss
373
+ - styles/definitions.scss
374
+ - styles/generate
370
375
  - styles/pagination.css
376
+ - styles/pagination.scss
371
377
  - styles/ultraviolet/active4d.css
372
378
  - styles/ultraviolet/all_hallows_eve.css
373
379
  - styles/ultraviolet/amy.css
@@ -427,29 +433,29 @@ signing_key:
427
433
  specification_version: 3
428
434
  summary: Glyph -- A Ruby-powered Document Authoring Framework
429
435
  test_files:
430
- - spec/macros/core_spec.rb
431
- - spec/macros/web_spec.rb
432
- - spec/macros/html5_spec.rb
433
- - spec/macros/filters_spec.rb
434
436
  - spec/macros/web5_spec.rb
437
+ - spec/macros/web_spec.rb
438
+ - spec/macros/macros_spec.rb
435
439
  - spec/macros/textile_spec.rb
440
+ - spec/macros/filters_spec.rb
436
441
  - spec/macros/xml_spec.rb
437
- - spec/macros/macros_spec.rb
438
- - spec/lib/interpreter_spec.rb
439
- - spec/lib/analyzer_spec.rb
440
- - spec/lib/commands_spec.rb
441
- - spec/lib/node_spec.rb
442
- - spec/lib/bookmark_spec.rb
442
+ - spec/macros/core_spec.rb
443
+ - spec/macros/html5_spec.rb
444
+ - spec/files/custom_command.rb
445
+ - spec/lib/parser_spec.rb
443
446
  - spec/lib/macro_spec.rb
444
- - spec/lib/macro_validators_spec.rb
445
447
  - spec/lib/config_spec.rb
448
+ - spec/lib/reporter_spec.rb
449
+ - spec/lib/analyzer_spec.rb
450
+ - spec/lib/macro_validators_spec.rb
451
+ - spec/lib/interpreter_spec.rb
446
452
  - spec/lib/glyph_spec.rb
447
- - spec/lib/parser_spec.rb
448
- - spec/lib/syntax_node_spec.rb
453
+ - spec/lib/bookmark_spec.rb
449
454
  - spec/lib/document_spec.rb
450
- - spec/lib/reporter_spec.rb
455
+ - spec/lib/syntax_node_spec.rb
456
+ - spec/lib/node_spec.rb
457
+ - spec/lib/commands_spec.rb
458
+ - spec/spec_helper.rb
451
459
  - spec/tasks/load_spec.rb
452
- - spec/tasks/generate_spec.rb
453
460
  - spec/tasks/project_spec.rb
454
- - spec/files/custom_command.rb
455
- - spec/spec_helper.rb
461
+ - spec/tasks/generate_spec.rb