glyph 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/AUTHORS.textile +8 -0
  2. data/CHANGELOG.textile +260 -0
  3. data/LICENSE.textile +26 -0
  4. data/README.textile +49 -21
  5. data/Rakefile +17 -7
  6. data/VERSION +1 -1
  7. data/book/config.yml +11 -5
  8. data/book/document.glyph +24 -13
  9. data/book/lib/macros/reference.rb +41 -14
  10. data/book/output/html/glyph.html +2298 -687
  11. data/book/output/pdf/glyph.pdf +6218 -2698
  12. data/book/script/authors +1 -0
  13. data/book/script/changelog +1 -0
  14. data/book/script/compile.rb +8 -0
  15. data/book/script/license +1 -0
  16. data/book/script/prof +1 -0
  17. data/book/script/prof_results.htm +21079 -0
  18. data/book/script/readme +1 -0
  19. data/book/snippets.yml +3 -4
  20. data/book/text/acknowledgement.glyph +8 -0
  21. data/book/text/authoring.glyph +548 -0
  22. data/book/text/changelog.glyph +76 -0
  23. data/book/text/extending.glyph +224 -0
  24. data/book/text/{getting_started.textile → getting_started.glyph} +30 -24
  25. data/book/text/{introduction.textile → introduction.glyph} +22 -12
  26. data/book/text/license.glyph +21 -0
  27. data/book/text/{ref_commands.textile → ref_commands.glyph} +30 -8
  28. data/book/text/ref_config.glyph +108 -0
  29. data/book/text/ref_macros.glyph +378 -0
  30. data/book/text/troubleshooting.glyph +179 -0
  31. data/config.yml +16 -4
  32. data/glyph.gemspec +83 -22
  33. data/lib/glyph.rb +164 -31
  34. data/lib/glyph/commands.rb +98 -23
  35. data/lib/glyph/document.rb +13 -7
  36. data/lib/glyph/glyph_language.rb +9 -1
  37. data/lib/glyph/glyph_language.treetop +1 -1
  38. data/lib/glyph/interpreter.rb +19 -9
  39. data/lib/glyph/macro.rb +88 -11
  40. data/lib/glyph/macro_validators.rb +48 -0
  41. data/lib/glyph/node.rb +13 -1
  42. data/lib/glyph/system_extensions.rb +0 -28
  43. data/macros/common.rb +125 -31
  44. data/macros/filters.rb +19 -13
  45. data/macros/html/block.rb +119 -68
  46. data/macros/html/inline.rb +29 -3
  47. data/macros/html/structure.rb +40 -40
  48. data/spec/files/article.glyph +5 -0
  49. data/spec/lib/commands_spec.rb +98 -3
  50. data/spec/lib/document_spec.rb +15 -2
  51. data/spec/lib/glyph_spec.rb +39 -10
  52. data/spec/lib/interpreter_spec.rb +8 -2
  53. data/spec/lib/macro_spec.rb +54 -6
  54. data/spec/lib/macro_validators_spec.rb +33 -0
  55. data/spec/lib/node_spec.rb +11 -3
  56. data/spec/macros/filters_spec.rb +5 -5
  57. data/spec/macros/macros_spec.rb +185 -8
  58. data/spec/macros/textile_spec.rb +217 -0
  59. data/spec/spec_helper.rb +25 -15
  60. data/spec/tasks/generate_spec.rb +3 -3
  61. data/spec/tasks/load_spec.rb +11 -1
  62. data/spec/tasks/project_spec.rb +0 -3
  63. data/styles/coderay.css +121 -0
  64. data/styles/default.css +54 -20
  65. data/{book/styles/css3.css → styles/pagination.css} +35 -7
  66. data/styles/ultraviolet/active4d.css +114 -0
  67. data/styles/ultraviolet/all_hallows_eve.css +72 -0
  68. data/styles/ultraviolet/amy.css +147 -0
  69. data/styles/ultraviolet/blackboard.css +88 -0
  70. data/styles/ultraviolet/brilliance_black.css +605 -0
  71. data/styles/ultraviolet/brilliance_dull.css +599 -0
  72. data/styles/ultraviolet/cobalt.css +149 -0
  73. data/styles/ultraviolet/dawn.css +121 -0
  74. data/styles/ultraviolet/eiffel.css +121 -0
  75. data/styles/ultraviolet/espresso_libre.css +109 -0
  76. data/styles/ultraviolet/idle.css +62 -0
  77. data/styles/ultraviolet/iplastic.css +80 -0
  78. data/styles/ultraviolet/lazy.css +73 -0
  79. data/styles/ultraviolet/mac_classic.css +123 -0
  80. data/styles/ultraviolet/magicwb_amiga.css +104 -0
  81. data/styles/ultraviolet/pastels_on_dark.css +188 -0
  82. data/styles/ultraviolet/slush_poppies.css +85 -0
  83. data/styles/ultraviolet/spacecadet.css +51 -0
  84. data/styles/ultraviolet/sunburst.css +180 -0
  85. data/styles/ultraviolet/twilight.css +137 -0
  86. data/styles/ultraviolet/zenburnesque.css +91 -0
  87. data/tasks/generate.rake +45 -26
  88. data/tasks/load.rake +21 -18
  89. data/tasks/project.rake +3 -1
  90. metadata +210 -41
  91. data/book/styles/default.css +0 -190
  92. data/book/text/authoring.textile +0 -351
  93. data/book/text/extending.textile +0 -148
  94. data/book/text/ref_config.textile +0 -0
  95. data/book/text/ref_macros.textile +0 -256
  96. data/book/text/troubleshooting.textile +0 -118
  97. data/styles/css3.css +0 -220
data/styles/css3.css DELETED
@@ -1,220 +0,0 @@
1
- @page {
2
- size: A4;
3
- margin: 40pt 30pt 40pt 30pt;
4
- @top {
5
- content: string(book-title) " · " string(book-subtitle) " – " string(chapter-title);
6
- font-style: italic;
7
- }
8
- @bottom { content: counter(page, decimal); }
9
- }
10
-
11
- @page frontmatter {
12
- @bottom { content: counter(page, lower-roman); }
13
- }
14
-
15
- @page backmatter {
16
- @bottom { content: counter(page, decimal); }
17
- }
18
-
19
- @page:first {
20
- padding-top: 20%;
21
- @top { content: normal; }
22
- @bottom { content: normal; }
23
- }
24
-
25
- .toc li a::after {
26
- content: leader('.') target-counter(attr(href), page);
27
- }
28
-
29
- .titlepage h1 {
30
- string-set: book-title content();
31
- }
32
-
33
- .titlepage h2 {
34
- string-set: book-subtitle content();
35
- }
36
-
37
- .toc>li[class~=chapter] {
38
- counter-increment: toc1;
39
- counter-reset: toc2;
40
- }
41
-
42
- .toc>li[class~=appendix] {
43
- counter-increment: appendix1;
44
- counter-reset: toc2;
45
- }
46
-
47
- .toc ol li[class] {
48
- counter-increment: toc2;
49
- counter-reset: toc3;
50
- }
51
-
52
- .toc ol ol li[class] {
53
- counter-increment: toc3;
54
- counter-reset: toc4;
55
- }
56
-
57
- .toc ol ol ol li[class] {
58
- counter-increment: toc4;
59
- counter-reset: toc5;
60
- }
61
-
62
- .toc ol ol ol ol li[class] {
63
- counter-increment: toc5;
64
- }
65
-
66
- .toc>li[class~=chapter]::before {
67
- content: counter(toc1) ". ";
68
- }
69
-
70
-
71
- .toc>li[class~=appendix]::before {
72
- content: counter(appendix1, upper-latin) ". ";
73
- }
74
-
75
- .toc>li[class] {
76
- margin: 1em 0;
77
- }
78
-
79
- .toc ol li[class~=bodymatter]::before {
80
- margin-left: 1em;
81
- content: counter(toc1) "." counter(toc2) " ";
82
- }
83
- .toc ol li[class~=appendix]::before {
84
- margin-left: 1em;
85
- content: counter(appendix1, upper-latin) "." counter(toc2) " ";
86
- }
87
-
88
-
89
- .toc ol ol li[class~=bodymatter]::before {
90
- margin-left: 1em;
91
- content: counter(toc1) "." counter(toc2) "." counter(toc3) " ";
92
- }
93
- .toc ol ol li[class~=appendix]::before {
94
- margin-left: 1em;
95
- content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) " ";
96
- }
97
-
98
- .toc ol ol ol li[class~=bodymatter]::before {
99
- margin-left: 1em;
100
- content: counter(toc1) "." counter(toc2) "." counter(toc3) "." counter(toc4) " ";
101
- }
102
- .toc ol ol ol li[class~=appendix]::before {
103
- margin-left: 1em;
104
- content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) "." counter(toc4) " ";
105
- }
106
-
107
- .toc ol ol ol ol li[class~=bodymatter]::before {
108
- margin-left: 1em;
109
- content: counter(toc1) "." counter(toc2) "." counter(toc3) "." counter(toc4) "." counter(toc5) " ";
110
- }
111
- .toc ol ol ol ol li[class~=appendix]::before {
112
- margin-left: 1em;
113
- content: counter(appendix1, upper-latin) "." counter(toc2) "." counter(toc3) "." counter(toc4) "." counter(toc5) " ";
114
- }
115
-
116
- div.frontmatter{
117
- page: frontmatter;
118
- }
119
-
120
- div.backmatter{
121
- page: backmatter;
122
- }
123
-
124
- .bodymatter h2::before {
125
- content: "Chapter " counter(h2, upper-roman) " – ";
126
- counter-reset: footnote;
127
- }
128
-
129
- .backmatter h2::before {
130
- content: "Appendix " counter(a2, upper-latin) " – ";
131
- }
132
-
133
- .bodymatter h3::before {
134
- content: counter(h2) "." counter(h3) " ";
135
- }
136
-
137
- .backmatter h3::before {
138
- content: counter(a2, upper-latin) "." counter(h3) " ";
139
- }
140
-
141
- .bodymatter h4::before {
142
- content: counter(h2) "." counter(h3) "." counter(h4) " ";
143
- }
144
-
145
- .backmatter h4::before {
146
- content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) " ";
147
- }
148
-
149
- .bodymatter h5::before {
150
- content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) " ";
151
- }
152
-
153
- .backmatter h5::before {
154
- content: counter(a2, upper-latin) "." counter(h3) "." counter(h4) "." counter(h5) " ";
155
- }
156
-
157
- h2 {
158
- string-set: chapter-title content();
159
- page-break-before: always;
160
- }
161
-
162
- .titlepage h2 {
163
- page-break-before: avoid;
164
- }
165
-
166
- .bodymatter h2{
167
- counter-increment: h2;
168
- counter-reset: h3;
169
- }
170
-
171
- .backmatter h2{
172
- counter-increment: a2;
173
- counter-reset: h3;
174
- }
175
-
176
- .bodymatter h3, .backmatter h3 {
177
- counter-increment: h3;
178
- counter-reset: h4;
179
- }
180
-
181
- .bodymatter h4, .backmatter h4 {
182
- counter-increment: h4;
183
- counter-reset: h5;
184
- }
185
-
186
- .bodymatter h5, .backmatter h5 {
187
- counter-increment: h5;
188
- }
189
-
190
- h2, h3, h4, h5 { page-break-after: avoid }
191
- table, .box, .note, .important, .tip, .caution, .code { page-break-inside: avoid }
192
-
193
- /* Footnotes */
194
-
195
- @page {
196
- @footnotes {
197
- border-top: 1px solid #000;
198
- }
199
- }
200
-
201
- .fn {
202
- font-size: 85%;
203
- margin-left: 1.5em;
204
- display: prince-footnote;
205
- counter-increment: footnote;
206
- }
207
-
208
- .fn::footnote-call {
209
- content: counter(footnote);
210
- font-size: 85%;
211
- vertical-align: super;
212
- line-height: none;
213
- font-weight: bold;
214
- margin-left: 1pt;
215
- }
216
-
217
- .fn::footnote-marker {
218
- font-weight: bold;
219
- margin-right: 0.5em;
220
- }