glyph 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
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,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,12 +8,14 @@
8
8
  @bottom {
9
9
  content: counter(page, decimal); } }
10
10
 
11
+ .bodymatter > :nth-child(1) {
12
+ counter-reset: page 1;
13
+ }
11
14
 
12
15
  @page frontmatter {
13
16
  @bottom {
14
17
  content: counter(page, lower-roman); } }
15
18
 
16
-
17
19
  @page backmatter {
18
20
  @bottom {
19
21
  content: counter(page, decimal); } }
@@ -134,25 +136,25 @@ div {
134
136
  h3::before, section h1:before {
135
137
  content: counter(h2) "." counter(h3) " "; } }
136
138
 
137
- .backmatter h3::before {
139
+ .backmatter h3.toc::before {
138
140
  content: counter(a2, upper-latin) "." counter(h3) " "; }
139
141
 
140
142
  .bodymatter {
141
- section section h1:before {
143
+ section section h1.toc:before {
142
144
  content: counter(a2, upper-latin) "." counter(h3) " "; }
143
- h4::before, section section h1:before {
145
+ h4.toc::before, section section h1.toc:before {
144
146
  content: counter(h2) "." counter(h3) "." counter(h4) " "; } }
145
147
 
146
- .backmatter h4::before {
148
+ .backmatter h4.toc::before {
147
149
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
148
150
 
149
151
  .bodymatter {
150
- section section section h2:before {
152
+ section section section h2.toc:before {
151
153
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " "; }
152
- h5::before, section section section section h2:before {
154
+ h5.toc::before, section section section section h2.toc:before {
153
155
  content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " "; } }
154
156
 
155
- .backmatter h5::before, .bodymatter section section section section h2:before {
157
+ .backmatter h5.toc::before, .bodymatter section section section section h2.toc:before {
156
158
  content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) "." counter(h5) " "; }
157
159
 
158
160
  h2, section h1 {
@@ -163,25 +165,23 @@ h2, section h1 {
163
165
  .halftitlepage h2, .titlepage h2 {
164
166
  page-break-before: avoid; }
165
167
 
166
- .bodymatter {
167
- h2, h1 {
168
+ .bodymatter .chapter{
168
169
  counter-increment: h2;
169
- counter-reset: h3; } }
170
+ counter-reset: h3; }
170
171
 
171
- .backmatter {
172
- h2, h1 {
172
+ .backmatter .appendix {
173
173
  counter-increment: a2;
174
- counter-reset: h3; } }
174
+ counter-reset: h3; }
175
175
 
176
- .bodymatter h3, .backmatter h3, .bodymatter section h1, .backmatter section h1 {
176
+ .bodymatter h3.toc, .backmatter h3.toc, .bodymatter section h1.toc, .backmatter section h1.toc {
177
177
  counter-increment: h3;
178
178
  counter-reset: h4; }
179
179
 
180
- .bodymatter h4, .backmatter h4, .bodymatter section section h1, .backmatter section section h1 {
180
+ .bodymatter h4.toc, .backmatter h4.toc, .bodymatter section section h1.toc, .backmatter section section h1.toc {
181
181
  counter-increment: h4;
182
182
  counter-reset: h5; }
183
183
 
184
- .bodymatter h5, .backmatter h5, .bodymatter section section section h1, .backmatter section section section h1 {
184
+ .bodymatter h5.toc, .backmatter h5.toc, .bodymatter section section section h1.toc, .backmatter section section section h1.toc {
185
185
  counter-increment: h5; }
186
186
 
187
187
  h1, h2, h3, h4, h5 {
@@ -70,7 +70,7 @@ namespace :generate do
70
70
  file = "#{Glyph['document.filename']}#{extension}"
71
71
  end
72
72
  out.mkpath
73
- file_write out/file, Glyph.document.output
73
+ file_write out/file, clean_xml_document(Glyph.document.output)
74
74
  info "'#{file}' generated successfully."
75
75
  end
76
76
 
@@ -133,7 +133,7 @@ namespace :generate do
133
133
  Glyph['system.quiet'] = true
134
134
  index_topic = Glyph::Interpreter.new("layout/#{index_layout}[]", context).document.output
135
135
  Glyph['system.quiet'] = q
136
- file_write out/"index.html", index_topic
136
+ file_write out/"index.html", clean_xml_document(index_topic)
137
137
  # Generate all topics
138
138
  Glyph.document.topics.each do |topic|
139
139
  extension = "#{Glyph["output.#{Glyph['document.output']}.extension"]}"
@@ -141,7 +141,7 @@ namespace :generate do
141
141
  file += extension unless file.match /#{Regexp.escape(extension)}$/
142
142
  info "Generating topic '#{file}'"
143
143
  (out/file).parent.mkpath
144
- file_write out/file, topic[:contents]
144
+ file_write out/file, clean_xml_document(topic[:contents])
145
145
  end
146
146
  info "Web output generated successfully."
147
147
  end
@@ -19,10 +19,7 @@ namespace :load do
19
19
  desc "Load commands"
20
20
  task :commands do
21
21
  unless Glyph.lite? then
22
- include GLI if (Glyph::PROJECT/'lib/commands').exist?
23
- load_files_from_dir(Glyph::PROJECT/'lib/commands', '.rb') do |f, contents|
24
- require f
25
- end
22
+ commands_from Glyph::PROJECT/'lib/commands'
26
23
  end
27
24
  end
28
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glyph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-04 00:00:00.000000000Z
12
+ date: 2012-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gli
16
- requirement: &71836550 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.4.0
21
+ version: 2.4.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *71836550
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.4.1
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: extlib
27
- requirement: &71835940 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: 0.9.15
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *71835940
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.9.15
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rake
38
- requirement: &71757250 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,32 +53,47 @@ dependencies:
43
53
  version: 0.9.2.2
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *71757250
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.2.2
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rspec
49
- requirement: &71756430 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
53
68
  - !ruby/object:Gem::Version
54
- version: 2.5.1
69
+ version: 2.11.0
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *71756430
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 2.11.0
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: yard
60
- requirement: &71755780 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
64
84
  - !ruby/object:Gem::Version
65
- version: 0.7.4
85
+ version: 0.8.3
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *71755780
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 0.8.3
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: directory_watcher
71
- requirement: &71754960 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,21 +101,31 @@ dependencies:
76
101
  version: 1.4.1
77
102
  type: :development
78
103
  prerelease: false
79
- version_requirements: *71754960
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.4.1
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: sass
82
- requirement: &71754120 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
86
116
  - !ruby/object:Gem::Version
87
- version: 3.1.11
117
+ version: 3.2.1
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *71754120
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: 3.2.1
91
126
  - !ruby/object:Gem::Dependency
92
127
  name: RedCloth
93
- requirement: &71753380 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
94
129
  none: false
95
130
  requirements:
96
131
  - - ! '>='
@@ -98,10 +133,15 @@ dependencies:
98
133
  version: 4.2.9
99
134
  type: :development
100
135
  prerelease: false
101
- version_requirements: *71753380
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: 4.2.9
102
142
  - !ruby/object:Gem::Dependency
103
143
  name: bluecloth
104
- requirement: &71752350 !ruby/object:Gem::Requirement
144
+ requirement: !ruby/object:Gem::Requirement
105
145
  none: false
106
146
  requirements:
107
147
  - - ! '>='
@@ -109,18 +149,28 @@ dependencies:
109
149
  version: 2.2.0
110
150
  type: :development
111
151
  prerelease: false
112
- version_requirements: *71752350
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: 2.2.0
113
158
  - !ruby/object:Gem::Dependency
114
159
  name: coderay
115
- requirement: &71751620 !ruby/object:Gem::Requirement
160
+ requirement: !ruby/object:Gem::Requirement
116
161
  none: false
117
162
  requirements:
118
163
  - - ! '>='
119
164
  - !ruby/object:Gem::Version
120
- version: 1.0.4
165
+ version: 1.0.8
121
166
  type: :development
122
167
  prerelease: false
123
- version_requirements: *71751620
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: 1.0.8
124
174
  description: Glyph is a framework for structured document authoring.
125
175
  email: h3rald@h3rald.com
126
176
  executables:
@@ -134,18 +184,18 @@ extra_rdoc_files:
134
184
  files:
135
185
  - Rakefile
136
186
  - AUTHORS.textile
137
- - CHANGELOG.textile
138
- - LICENSE.textile
139
- - README.textile
140
187
  - benchmark.rb
188
+ - CHANGELOG.textile
141
189
  - config.yml
142
190
  - document.glyph
143
- - glyph.gemspec
144
191
  - glyph-0.5.1.gem
192
+ - glyph-0.5.2.gem
193
+ - glyph.gemspec
194
+ - LICENSE.textile
195
+ - README.textile
145
196
  - bin/glyph
146
197
  - lib/glyph/analyzer.rb
147
198
  - lib/glyph/bookmark.rb
148
- - lib/glyph/commands.rb
149
199
  - lib/glyph/commands/add.rb
150
200
  - lib/glyph/commands/compile.rb
151
201
  - lib/glyph/commands/config.rb
@@ -153,9 +203,11 @@ files:
153
203
  - lib/glyph/commands/outline.rb
154
204
  - lib/glyph/commands/stats.rb
155
205
  - lib/glyph/commands/todo.rb
206
+ - lib/glyph/commands.rb
156
207
  - lib/glyph/config.rb
157
208
  - lib/glyph/document.rb
158
209
  - lib/glyph/interpreter.rb
210
+ - lib/glyph/macro.rb
159
211
  - lib/glyph/macro_validators.rb
160
212
  - lib/glyph/node.rb
161
213
  - lib/glyph/parser.rb
@@ -163,14 +215,13 @@ files:
163
215
  - lib/glyph/syntax_node.rb
164
216
  - lib/glyph/system_extensions.rb
165
217
  - lib/glyph/utils.rb
166
- - lib/glyph/macro.rb
167
218
  - lib/glyph.rb
168
- - book/document.glyph
169
219
  - book/config.yml
220
+ - book/document.glyph
170
221
  - book/lib/commands/commands.rb
171
- - book/lib/layouts/project.glyph
172
222
  - book/lib/layouts/bookindex.glyph
173
223
  - book/lib/layouts/bookpage.glyph
224
+ - book/lib/layouts/project.glyph
174
225
  - book/lib/macros/reference.rb
175
226
  - book/lib/tasks/tasks.rake
176
227
  - book/images/glyph/commands_tasks.png
@@ -179,6 +230,7 @@ files:
179
230
  - book/images/glyph/glyph.png
180
231
  - book/images/glyph/glyph.svg
181
232
  - book/text/acknowledgements.glyph
233
+ - book/text/changelog.glyph
182
234
  - book/text/compiling/compiling.glyph
183
235
  - book/text/compiling/lite_mode.glyph
184
236
  - book/text/compiling/programmatic_usage.glyph
@@ -203,11 +255,12 @@ files:
203
255
  - book/text/getting_started/create_project.glyph
204
256
  - book/text/getting_started/structure.glyph
205
257
  - book/text/introduction.glyph
258
+ - book/text/license.glyph
259
+ - book/text/macros/macros_block.glyph
206
260
  - book/text/macros/macros_core.glyph
207
261
  - book/text/macros/macros_filters.glyph
208
262
  - book/text/macros/macros_inline.glyph
209
263
  - book/text/macros/macros_structure.glyph
210
- - book/text/macros/macros_block.glyph
211
264
  - book/text/ref_commands.glyph
212
265
  - book/text/snippets.glyph
213
266
  - book/text/stats/bookmarks.glyph
@@ -236,13 +289,12 @@ files:
236
289
  - book/text/troubleshooting/errors_generic.glyph
237
290
  - book/text/troubleshooting/errors_macro.glyph
238
291
  - book/text/troubleshooting/errors_parser.glyph
239
- - book/text/license.glyph
240
- - book/text/changelog.glyph
241
292
  - book/resources/document_generation.txt
242
293
  - layouts/web/index.glyph
243
294
  - layouts/web/topic.glyph
244
295
  - layouts/web5/index.glyph
245
296
  - layouts/web5/topic.glyph
297
+ - macros/block.rb
246
298
  - macros/core.rb
247
299
  - macros/filters.rb
248
300
  - macros/inline.rb
@@ -252,7 +304,7 @@ files:
252
304
  - macros/reps/web5.rb
253
305
  - macros/structure.rb
254
306
  - macros/xml.rb
255
- - macros/block.rb
307
+ - spec/config.yml
256
308
  - spec/files/article.glyph
257
309
  - spec/files/container.textile
258
310
  - spec/files/custom_command.rb
@@ -283,20 +335,22 @@ files:
283
335
  - spec/lib/reporter_spec.rb
284
336
  - spec/lib/syntax_node_spec.rb
285
337
  - spec/macros/core_spec.rb
338
+ - spec/macros/filters_spec.rb
286
339
  - spec/macros/html5_spec.rb
287
340
  - spec/macros/macros_spec.rb
288
341
  - spec/macros/textile_spec.rb
289
342
  - spec/macros/web5_spec.rb
290
343
  - spec/macros/web_spec.rb
291
344
  - spec/macros/xml_spec.rb
292
- - spec/macros/filters_spec.rb
293
345
  - spec/spec_helper.rb
294
346
  - spec/tasks/generate_spec.rb
295
347
  - spec/tasks/load_spec.rb
296
348
  - spec/tasks/project_spec.rb
297
- - spec/config.yml
298
349
  - styles/coderay.css
350
+ - styles/coderay.scss
351
+ - styles/default.css
299
352
  - styles/default.scss
353
+ - styles/definitions.scss
300
354
  - styles/generate
301
355
  - styles/pagination.css
302
356
  - styles/pagination.scss
@@ -321,9 +375,6 @@ files:
321
375
  - styles/ultraviolet/sunburst.css
322
376
  - styles/ultraviolet/twilight.css
323
377
  - styles/ultraviolet/zenburnesque.css
324
- - styles/coderay.scss
325
- - styles/default.css
326
- - styles/definitions.scss
327
378
  - tasks/generate.rake
328
379
  - tasks/load.rake
329
380
  - tasks/project.rake
@@ -348,11 +399,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
399
  version: '0'
349
400
  requirements: []
350
401
  rubyforge_project:
351
- rubygems_version: 1.8.10
402
+ rubygems_version: 1.8.24
352
403
  signing_key:
353
404
  specification_version: 3
354
405
  summary: Glyph -- A Ruby-powered Document Authoring Framework
355
406
  test_files:
407
+ - spec/config.yml
356
408
  - spec/files/article.glyph
357
409
  - spec/files/container.textile
358
410
  - spec/files/custom_command.rb
@@ -383,16 +435,15 @@ test_files:
383
435
  - spec/lib/reporter_spec.rb
384
436
  - spec/lib/syntax_node_spec.rb
385
437
  - spec/macros/core_spec.rb
438
+ - spec/macros/filters_spec.rb
386
439
  - spec/macros/html5_spec.rb
387
440
  - spec/macros/macros_spec.rb
388
441
  - spec/macros/textile_spec.rb
389
442
  - spec/macros/web5_spec.rb
390
443
  - spec/macros/web_spec.rb
391
444
  - spec/macros/xml_spec.rb
392
- - spec/macros/filters_spec.rb
393
445
  - spec/spec_helper.rb
394
446
  - spec/tasks/generate_spec.rb
395
447
  - spec/tasks/load_spec.rb
396
448
  - spec/tasks/project_spec.rb
397
- - spec/config.yml
398
449
  has_rdoc: