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/default.css CHANGED
@@ -9,9 +9,13 @@
9
9
  html {
10
10
  background: #fff;
11
11
  }
12
- p, ol, ul {
12
+ ol, ul {
13
13
  margin: 0.3em 0;
14
14
  }
15
+ p {
16
+ margin: 1em 0;
17
+ }
18
+
15
19
  table {
16
20
  border-collapse: collapse;
17
21
  border-spacing: 0;
@@ -59,6 +63,9 @@ li {
59
63
  ol li{
60
64
  list-style-type: decimal;
61
65
  }
66
+ .contents li {
67
+ list-style-type: none;
68
+ }
62
69
  img {
63
70
  margin: 0 5px;
64
71
  padding: 2px;
@@ -70,22 +77,13 @@ dt {
70
77
  dd {
71
78
  font-style: italic;
72
79
  }
73
- p {
74
- margin: 1em 0;
75
- }
76
- ol.toc {
77
- margin-left: 1.5em;
78
- }
79
- .toc > li[class] {
80
- font-weight: bold;
81
- }
82
- .toc li {
83
- list-style-type: none;
84
- margin-left: 0;
85
- }
86
- .toc li a, .toc li a:hover {
87
- color: #000;
80
+
81
+ blockquote {
82
+ margin: 1em 1em;
83
+ font-style: italic;
84
+ color: #121212;
88
85
  }
86
+
89
87
  table {
90
88
  border: 1px solid #E6E6E6;
91
89
  }
@@ -144,6 +142,26 @@ sup {
144
142
  padding: 0.5em;
145
143
  width: 600px;
146
144
  }
145
+ .comment {
146
+ display: block;
147
+ border: 1px solid #004D00;
148
+ background: #7AFF7A;
149
+ padding: 3px;
150
+ margin: 1px;
151
+ }
152
+ .comment .comment-pre {
153
+ color: #004D00;
154
+ }
155
+ .todo {
156
+ display: block;
157
+ border: 1px solid #990000;
158
+ background: #FF9999;
159
+ padding: 3px;
160
+ margin: 1px;
161
+ }
162
+ .todo .todo-pre {
163
+ color: #990000;
164
+ }
147
165
  /* TEXT */
148
166
  body {
149
167
  color: #000;
@@ -157,12 +175,12 @@ h2 {
157
175
  }
158
176
  h3 {
159
177
  font-size: 1.6em;
160
- font-weight: normal;
178
+ font-weight: bold;
161
179
  margin: 3em 0 1em 0;
162
180
  }
163
181
  h4 {
164
182
  font-size: 1.3em;
165
- font-weight: normal;
183
+ font-weight: bold;
166
184
  margin: 3em 0 1em 0;
167
185
  }
168
186
  em {
@@ -175,16 +193,32 @@ a {
175
193
  a:hover {
176
194
  color: #CF282D;
177
195
  }
178
- code {
196
+ code, pre {
179
197
  font-size: 0.75em;
180
198
  }
199
+ pre{
200
+ margin: 1em;
201
+ padding: 1em;
202
+ }
203
+
204
+ pre>code {
205
+ font-size: 1em;
206
+ }
207
+ td p, td ul, td ol {
208
+ margin: 0;
209
+ }
210
+ td>div.code, td>code {
211
+ width: auto;
212
+ margin: 0.2em;
213
+ padding: 0.2em;
214
+ }
181
215
 
182
216
  /* FONTS */
183
217
  body {
184
218
  font-family: "Book Antiqua", "Times New Roman", "Serif";
185
219
  }
186
220
 
187
- code {
221
+ code, pre {
188
222
  font-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier", "Monospace";
189
223
  }
190
224
 
@@ -1,8 +1,26 @@
1
+ /* FONTS */
2
+
3
+ @font-face {
4
+ font-family: "Serif"
5
+ src: local("Book Antiqua")
6
+ }
7
+
8
+ @font-face {
9
+ font-family: "Monospace"
10
+ src: local("Droid Sans Mono")
11
+ }
12
+ body {
13
+ font-family: "Book Antiqua", "Times New Roman", "Serif";
14
+ }
15
+
16
+ code, pre {
17
+ font-family: "Droid Sans Mono", "Consolas", "Monaco", "Courier", "Monospace";
18
+ }
1
19
  @page {
2
20
  size: A4;
3
21
  margin: 40pt 30pt 40pt 30pt;
4
22
  @top {
5
- content: string(book-title) " · " string(book-subtitle) " – " string(chapter-title);
23
+ content: string(book-title) " - " string(chapter-title);
6
24
  font-style: italic;
7
25
  }
8
26
  @bottom { content: counter(page, decimal); }
@@ -17,23 +35,33 @@
17
35
  }
18
36
 
19
37
  @page:first {
20
- padding-top: 20%;
38
+ padding-top: 10%;
21
39
  @top { content: normal; }
22
40
  @bottom { content: normal; }
23
41
  }
24
42
 
43
+ ol.toc {
44
+ margin-left: 1.5em;
45
+ }
46
+ .toc > li[class] {
47
+ font-weight: bold;
48
+ }
49
+ .toc li {
50
+ list-style-type: none;
51
+ margin-left: 0;
52
+ }
53
+ .toc li a, .toc li a:hover {
54
+ color: #000;
55
+ }
56
+
25
57
  .toc li a::after {
26
58
  content: leader('.') target-counter(attr(href), page);
27
59
  }
28
60
 
29
- .titlepage h1 {
61
+ .titlepage h1, .halftitlepage h1 {
30
62
  string-set: book-title content();
31
63
  }
32
64
 
33
- .titlepage h2 {
34
- string-set: book-subtitle content();
35
- }
36
-
37
65
  .toc>li[class~=chapter] {
38
66
  counter-increment: toc1;
39
67
  counter-reset: toc2;
@@ -0,0 +1,114 @@
1
+ pre.active4d .DiffHeader {
2
+ background-color: #656565;
3
+ color: #FFFFFF;
4
+ }
5
+ pre.active4d .Operator {
6
+ }
7
+ pre.active4d .InheritedClass {
8
+ }
9
+ pre.active4d .TypeName {
10
+ color: #21439C;
11
+ }
12
+ pre.active4d .Number {
13
+ color: #A8017E;
14
+ }
15
+ pre.active4d .EmbeddedSource {
16
+ background-color: #ECF1FF;
17
+ }
18
+ pre.active4d {
19
+ background-color: #FFFFFF;
20
+ color: #000000;
21
+ }
22
+ pre.active4d .DiffInsertedLine {
23
+ background-color: #98FF9A;
24
+ color: #000000;
25
+ }
26
+ pre.active4d .LibraryVariable {
27
+ color: #A535AE;
28
+ }
29
+ pre.active4d .Storage {
30
+ color: #FF5600;
31
+ }
32
+ pre.active4d .InterpolatedEntity {
33
+ font-weight: bold;
34
+ color: #66CCFF;
35
+ }
36
+ pre.active4d .line-numbers {
37
+ background-color: #BAD6FD;
38
+ color: #000000;
39
+ }
40
+ pre.active4d .LocalVariable {
41
+ font-weight: bold;
42
+ color: #6392FF;
43
+ }
44
+ pre.active4d .DiffLineRange {
45
+ background-color: #1B63FF;
46
+ color: #FFFFFF;
47
+ }
48
+ pre.active4d .BlockComment {
49
+ color: #D33435;
50
+ }
51
+ pre.active4d .TagName {
52
+ color: #016CFF;
53
+ }
54
+ pre.active4d .FunctionArgument {
55
+ }
56
+ pre.active4d .BuiltInConstant {
57
+ color: #A535AE;
58
+ }
59
+ pre.active4d .LineComment {
60
+ color: #D33535;
61
+ }
62
+ pre.active4d .DiffDeletedLine {
63
+ background-color: #FF7880;
64
+ color: #000000;
65
+ }
66
+ pre.active4d .NamedConstant {
67
+ color: #B7734C;
68
+ }
69
+ pre.active4d .CommandMethod {
70
+ font-weight: bold;
71
+ color: #45AE34;
72
+ }
73
+ pre.active4d .TableField {
74
+ color: #0BB600;
75
+ }
76
+ pre.active4d .PlainXmlText {
77
+ color: #000000;
78
+ }
79
+ pre.active4d .Invalid {
80
+ background-color: #990000;
81
+ color: #FFFFFF;
82
+ }
83
+ pre.active4d .LibraryClassType {
84
+ color: #A535AE;
85
+ }
86
+ pre.active4d .TagAttribute {
87
+ color: #963DFF;
88
+ }
89
+ pre.active4d .Keyword {
90
+ font-weight: bold;
91
+ color: #006699;
92
+ }
93
+ pre.active4d .UserDefinedConstant {
94
+ }
95
+ pre.active4d .String {
96
+ color: #666666;
97
+ }
98
+ pre.active4d .DiffUnchangedLine {
99
+ color: #5E5E5E;
100
+ }
101
+ pre.active4d .TagContainer {
102
+ color: #7A7A7A;
103
+ }
104
+ pre.active4d .FunctionName {
105
+ color: #21439C;
106
+ }
107
+ pre.active4d .Variable {
108
+ font-weight: bold;
109
+ color: #0053FF;
110
+ }
111
+ pre.active4d .DateTimeLiteral {
112
+ font-weight: bold;
113
+ color: #66CCFF;
114
+ }
@@ -0,0 +1,72 @@
1
+ pre.all_hallows_eve .ClassInheritance {
2
+ font-style: italic;
3
+ }
4
+ pre.all_hallows_eve .Constant {
5
+ color: #3387CC;
6
+ }
7
+ pre.all_hallows_eve .TypeName {
8
+ text-decoration: underline;
9
+ }
10
+ pre.all_hallows_eve .TextBase {
11
+ background-color: #434242;
12
+ color: #FFFFFF;
13
+ }
14
+ pre.all_hallows_eve {
15
+ background-color: #000000;
16
+ color: #FFFFFF;
17
+ }
18
+ pre.all_hallows_eve .StringEscapesExecuted {
19
+ color: #555555;
20
+ }
21
+ pre.all_hallows_eve .line-numbers {
22
+ background-color: #73597E;
23
+ color: #FFFFFF;
24
+ }
25
+ pre.all_hallows_eve .StringExecuted {
26
+ background-color: #CCCC33;
27
+ color: #000000;
28
+ }
29
+ pre.all_hallows_eve .BlockComment {
30
+ background-color: #9B9B9B;
31
+ color: #FFFFFF;
32
+ }
33
+ pre.all_hallows_eve .TagName {
34
+ text-decoration: underline;
35
+ }
36
+ pre.all_hallows_eve .PreProcessorLine {
37
+ color: #D0D0FF;
38
+ }
39
+ pre.all_hallows_eve .SupportFunction {
40
+ color: #C83730;
41
+ }
42
+ pre.all_hallows_eve .FunctionArgument {
43
+ font-style: italic;
44
+ }
45
+ pre.all_hallows_eve .PreProcessorDirective {
46
+ }
47
+ pre.all_hallows_eve .StringEscapes {
48
+ color: #AAAAAA;
49
+ }
50
+ pre.all_hallows_eve .SourceBase {
51
+ background-color: #000000;
52
+ color: #FFFFFF;
53
+ }
54
+ pre.all_hallows_eve .TagAttribute {
55
+ }
56
+ pre.all_hallows_eve .StringLiteral {
57
+ color: #CCCC33;
58
+ }
59
+ pre.all_hallows_eve .String {
60
+ color: #66CC33;
61
+ }
62
+ pre.all_hallows_eve .Keyword {
63
+ color: #CC7833;
64
+ }
65
+ pre.all_hallows_eve .RegularExpression {
66
+ color: #CCCC33;
67
+ }
68
+ pre.all_hallows_eve .FunctionName {
69
+ }
70
+ pre.all_hallows_eve .Comment {
71
+ color: #9933CC;
72
+ }
@@ -0,0 +1,147 @@
1
+ pre.amy .PolymorphicVariants {
2
+ color: #60B0FF;
3
+ font-style: italic;
4
+ }
5
+ pre.amy .KeywordDecorator {
6
+ color: #D0D0FF;
7
+ }
8
+ pre.amy .Punctuation {
9
+ color: #805080;
10
+ }
11
+ pre.amy .InheritedClass {
12
+ }
13
+ pre.amy .InvalidDepricated {
14
+ background-color: #CC66FF;
15
+ color: #200020;
16
+ }
17
+ pre.amy .LibraryVariable {
18
+ }
19
+ pre.amy .TokenReferenceOcamlyacc {
20
+ color: #3CB0D0;
21
+ }
22
+ pre.amy .Storage {
23
+ color: #B0FFF0;
24
+ }
25
+ pre.amy .KeywordOperator {
26
+ color: #A0A0FF;
27
+ }
28
+ pre.amy .CharacterConstant {
29
+ color: #666666;
30
+ }
31
+ pre.amy .line-numbers {
32
+ background-color: #800000;
33
+ color: #000000;
34
+ }
35
+ pre.amy .ClassName {
36
+ color: #70E080;
37
+ }
38
+ pre.amy .Int64Constant {
39
+ font-style: italic;
40
+ }
41
+ pre.amy .NonTerminalReferenceOcamlyacc {
42
+ color: #C0F0F0;
43
+ }
44
+ pre.amy .TokenDefinitionOcamlyacc {
45
+ color: #3080A0;
46
+ }
47
+ pre.amy .ClassType {
48
+ color: #70E0A0;
49
+ }
50
+ pre.amy .ControlKeyword {
51
+ color: #80A0FF;
52
+ }
53
+ pre.amy .LineNumberDirectives {
54
+ text-decoration: underline;
55
+ color: #C080C0;
56
+ }
57
+ pre.amy .FloatingPointConstant {
58
+ text-decoration: underline;
59
+ }
60
+ pre.amy .Int32Constant {
61
+ font-weight: bold;
62
+ }
63
+ pre.amy .TagName {
64
+ color: #009090;
65
+ }
66
+ pre.amy .ModuleTypeDefinitions {
67
+ text-decoration: underline;
68
+ color: #B000B0;
69
+ }
70
+ pre.amy .Integer {
71
+ color: #7090B0;
72
+ }
73
+ pre.amy .Camlp4TempParser {
74
+ }
75
+ pre.amy .InvalidIllegal {
76
+ font-weight: bold;
77
+ background-color: #FFFF00;
78
+ color: #400080;
79
+ }
80
+ pre.amy .LibraryConstant {
81
+ background-color: #200020;
82
+ }
83
+ pre.amy .ModuleDefinitions {
84
+ color: #B000B0;
85
+ }
86
+ pre.amy .Variants {
87
+ color: #60B0FF;
88
+ }
89
+ pre.amy .CompilerDirectives {
90
+ color: #C080C0;
91
+ }
92
+ pre.amy .FloatingPointInfixOperator {
93
+ text-decoration: underline;
94
+ }
95
+ pre.amy .BuiltInConstant1 {
96
+ }
97
+ pre.amy {
98
+ background-color: #200020;
99
+ color: #D0D0FF;
100
+ }
101
+ pre.amy .FunctionArgument {
102
+ color: #80B0B0;
103
+ }
104
+ pre.amy .FloatingPointPrefixOperator {
105
+ text-decoration: underline;
106
+ }
107
+ pre.amy .NativeintConstant {
108
+ font-weight: bold;
109
+ }
110
+ pre.amy .BuiltInConstant {
111
+ color: #707090;
112
+ }
113
+ pre.amy .BooleanConstant {
114
+ color: #8080A0;
115
+ }
116
+ pre.amy .LibraryClassType {
117
+ }
118
+ pre.amy .TagAttribute {
119
+ }
120
+ pre.amy .Keyword {
121
+ color: #A080FF;
122
+ }
123
+ pre.amy .UserDefinedConstant {
124
+ }
125
+ pre.amy .String {
126
+ color: #999999;
127
+ }
128
+ pre.amy .Camlp4Code {
129
+ background-color: #350060;
130
+ }
131
+ pre.amy .NonTerminalDefinitionOcamlyacc {
132
+ color: #90E0E0;
133
+ }
134
+ pre.amy .FunctionName {
135
+ color: #50A0A0;
136
+ }
137
+ pre.amy .SupportModules {
138
+ color: #A00050;
139
+ }
140
+ pre.amy .Variable {
141
+ color: #008080;
142
+ }
143
+ pre.amy .Comment {
144
+ background-color: #200020;
145
+ color: #404080;
146
+ font-style: italic;
147
+ }