glyph 0.2.0 → 0.3.0
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.
- data/AUTHORS.textile +1 -1
- data/CHANGELOG.textile +119 -222
- data/LICENSE.textile +1 -1
- data/README.textile +42 -23
- data/Rakefile +1 -3
- data/VERSION +1 -1
- data/benchmark.rb +72 -0
- data/book/config.yml +4 -4
- data/book/document.glyph +90 -57
- data/book/images/document_generation.png +0 -0
- data/book/lib/macros/reference.rb +75 -22
- data/book/output/html/glyph.html +3183 -2121
- data/book/output/html/images/document_generation.png +0 -0
- data/book/output/pdf/glyph.pdf +7370 -4913
- data/book/resources/document_generation.txt +34 -0
- data/book/snippets.yml +6 -0
- data/book/text/changelog.glyph +45 -34
- data/book/text/compiling/compiling.glyph +23 -0
- data/book/text/compiling/lite_mode.glyph +23 -0
- data/book/text/compiling/programmatic_usage.glyph +77 -0
- data/book/text/extending/bookmarks_headers.glyph +21 -0
- data/book/text/extending/further_reading.glyph +13 -0
- data/book/text/extending/internals.glyph +79 -0
- data/book/text/extending/interpreting.glyph +51 -0
- data/book/text/extending/macro_def.glyph +64 -0
- data/book/text/extending/params_attrs.glyph +70 -0
- data/book/text/extending/placeholders.glyph +34 -0
- data/book/text/extending/validators.glyph +16 -0
- data/book/text/getting_started/configuration.glyph +49 -0
- data/book/text/getting_started/create_project.glyph +41 -0
- data/book/text/getting_started/structure.glyph +55 -0
- data/book/text/introduction.glyph +49 -26
- data/book/text/license.glyph +1 -1
- data/book/text/macros/macros_block.glyph +99 -0
- data/book/text/macros/macros_core.glyph +208 -0
- data/book/text/macros/macros_filters.glyph +40 -0
- data/book/text/macros/macros_inline.glyph +50 -0
- data/book/text/macros/macros_structure.glyph +100 -0
- data/book/text/ref_commands.glyph +94 -73
- data/book/text/ref_config.glyph +34 -42
- data/book/text/ref_macros.glyph +1 -373
- data/book/text/text_editing/code.glyph +51 -0
- data/book/text/text_editing/conditionals.glyph +49 -0
- data/book/text/text_editing/evaluation.glyph +13 -0
- data/book/text/text_editing/glyph_files.glyph +7 -0
- data/book/text/text_editing/images.glyph +29 -0
- data/book/text/text_editing/inclusions.glyph +44 -0
- data/book/text/text_editing/links.glyph +53 -0
- data/book/text/text_editing/macro_intro.glyph +111 -0
- data/book/text/text_editing/raw_html.glyph +112 -0
- data/book/text/text_editing/sections.glyph +63 -0
- data/book/text/text_editing/stylesheets.glyph +36 -0
- data/book/text/troubleshooting/errors_command.glyph +39 -0
- data/book/text/troubleshooting/errors_generic.glyph +29 -0
- data/book/text/troubleshooting/errors_intro.glyph +3 -0
- data/book/text/troubleshooting/errors_macro.glyph +98 -0
- data/book/text/troubleshooting/errors_parser.glyph +29 -0
- data/config.yml +77 -58
- data/document.glyph +25 -25
- data/glyph.gemspec +57 -22
- data/lib/glyph.rb +54 -13
- data/lib/glyph/commands.rb +84 -17
- data/lib/glyph/config.rb +3 -3
- data/lib/glyph/document.rb +14 -8
- data/lib/glyph/interpreter.rb +18 -58
- data/lib/glyph/macro.rb +160 -55
- data/lib/glyph/macro_validators.rb +104 -12
- data/lib/glyph/node.rb +24 -0
- data/lib/glyph/parser.rb +278 -0
- data/lib/glyph/syntax_node.rb +225 -0
- data/macros/core.rb +212 -0
- data/macros/filters.rb +66 -15
- data/macros/html/block.rb +43 -105
- data/macros/html/inline.rb +11 -12
- data/macros/html/structure.rb +123 -58
- data/macros/xml.rb +33 -0
- data/spec/files/container.textile +2 -2
- data/spec/files/document.glyph +2 -2
- data/spec/files/document_with_toc.glyph +3 -3
- data/spec/files/included.textile +1 -1
- data/spec/files/ligature.jpg +0 -0
- data/spec/files/markdown.markdown +2 -1
- data/spec/lib/commands_spec.rb +46 -3
- data/spec/lib/document_spec.rb +4 -4
- data/spec/lib/glyph_spec.rb +17 -46
- data/spec/lib/interpreter_spec.rb +6 -25
- data/spec/lib/macro_spec.rb +141 -43
- data/spec/lib/macro_validators_spec.rb +27 -5
- data/spec/lib/node_spec.rb +26 -1
- data/spec/lib/parser_spec.rb +246 -0
- data/spec/lib/syntax_node_spec.rb +111 -0
- data/spec/macros/core_spec.rb +195 -0
- data/spec/macros/filters_spec.rb +38 -4
- data/spec/macros/macros_spec.rb +20 -176
- data/spec/macros/textile_spec.rb +13 -71
- data/spec/macros/xml_spec.rb +77 -0
- data/spec/spec_helper.rb +50 -10
- data/spec/tasks/load_spec.rb +13 -2
- data/styles/default.css +18 -6
- data/styles/pagination.css +1 -19
- data/tasks/generate.rake +2 -2
- data/tasks/load.rake +27 -17
- data/tasks/project.rake +1 -1
- metadata +75 -62
- data/book/script/compile.rb +0 -8
- data/book/script/prof +0 -1
- data/book/script/prof_results.htm +0 -21079
- data/book/text/authoring.glyph +0 -548
- data/book/text/extending.glyph +0 -224
- data/book/text/getting_started.glyph +0 -158
- data/book/text/troubleshooting.glyph +0 -179
- data/lib/glyph/glyph_language.rb +0 -538
- data/lib/glyph/glyph_language.treetop +0 -27
- data/macros/common.rb +0 -160
data/Rakefile
CHANGED
@@ -31,17 +31,15 @@ begin
|
|
31
31
|
s.files.include "book/**/*"
|
32
32
|
s.add_dependency 'gli', '>= 0.3.1' # Command line interface
|
33
33
|
s.add_dependency 'extlib', '>= 0.9.12' # Extension methods
|
34
|
-
s.add_dependency 'treetop', '>= 0.4.3' # Glyph Language Parser
|
35
34
|
s.add_dependency 'rake', '>= 0.8.7' # Glyph rasks
|
36
35
|
s.add_development_dependency 'rspec', '>= 1.1.11' # Test suite
|
37
36
|
s.add_development_dependency 'yard', '>= 1.5.4' # Documentation suite
|
38
37
|
s.add_development_dependency 'jeweler', '1.4.0' # Gem management
|
39
38
|
s.add_development_dependency 'directory_watcher', ">= 1.3.2" # Auto-regeneration
|
40
|
-
s.add_development_dependency 'haml', ">=
|
39
|
+
s.add_development_dependency 'haml', ">= 3.0.6" # Sass filter
|
41
40
|
s.add_development_dependency 'RedCloth', ">= 4.2.3" # Textile filter
|
42
41
|
s.add_development_dependency 'bluecloth', ">= 2.0.7" # Markdown filter
|
43
42
|
s.add_development_dependency 'coderay', ">= 0.9.3" # Syntax Highlighting
|
44
|
-
s.add_development_dependency 'ruby-prof', ">= 0.8.1" # Code profiling
|
45
43
|
end
|
46
44
|
Jeweler::GemcutterTasks.new
|
47
45
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/benchmark.rb
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'pathname'
|
3
|
+
require 'extlib'
|
4
|
+
require 'bluecloth'
|
5
|
+
require 'redcloth'
|
6
|
+
require 'benchmark'
|
7
|
+
require Pathname.new(__FILE__).parent/"lib/glyph.rb"
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
def macro_exec(text)
|
12
|
+
Glyph::Interpreter.new(text).document.output
|
13
|
+
end
|
14
|
+
|
15
|
+
def sep
|
16
|
+
puts "="*100
|
17
|
+
end
|
18
|
+
|
19
|
+
N = 50
|
20
|
+
|
21
|
+
def rep(x, title, &block)
|
22
|
+
x.report(title.to_s) { N.times(&block) }
|
23
|
+
end
|
24
|
+
|
25
|
+
def reset_glyph
|
26
|
+
Glyph.lite_mode = true
|
27
|
+
Glyph['system.quiet'] = true
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
text = %{
|
32
|
+
Lorem ipsum dolor sit amet, consectetur _adipisicing elit_, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
33
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
34
|
+
* Duis aute irure dolor in *reprehenderit* in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
35
|
+
* Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
36
|
+
}
|
37
|
+
html = %{
|
38
|
+
p[Lorem ipsum dolor sit amet, consectetur em[adipisicing elit], sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]
|
39
|
+
p[Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.]
|
40
|
+
ul[
|
41
|
+
li[Duis aute irure dolor in strong[reprehenderit] in voluptate velit esse cillum dolore eu fugiat nulla pariatur.]
|
42
|
+
li[Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]
|
43
|
+
]
|
44
|
+
}
|
45
|
+
|
46
|
+
reset_glyph
|
47
|
+
Glyph.run! 'load:all'
|
48
|
+
Glyph::SNIPPETS[:test] = text
|
49
|
+
Benchmark.bm(30) do |x|
|
50
|
+
|
51
|
+
sep
|
52
|
+
puts " => Core Classes"
|
53
|
+
rep(x, "Glyph::Interpreter.new.parse") {Glyph::Interpreter.new(text).parse}
|
54
|
+
rep(x, "Glyph::Parser.new(text).parse") {Glyph::Parser.new(text).parse}
|
55
|
+
sep
|
56
|
+
puts " => Macro Set: Glyph"
|
57
|
+
sep
|
58
|
+
rep(x, "section[...]") { macro_exec "section[#{text}]" }
|
59
|
+
rep(x, "snippet[...]") { macro_exec "snippet[test]" }
|
60
|
+
rep(x, "textile[...]") { macro_exec "textile[#{text}]" }
|
61
|
+
rep(x, "markdown[...]") { macro_exec "markdown[#{text}]" }
|
62
|
+
rep(x, "HTML text") { macro_exec html }
|
63
|
+
sep
|
64
|
+
rep(x, "Markdown (BlueCloth)") {BlueCloth.new(text).to_html }
|
65
|
+
rep(x, "Textile (RedCloth)") {RedCloth.new(text).to_html }
|
66
|
+
sep
|
67
|
+
puts " => Macro Set: XML"
|
68
|
+
reset_glyph
|
69
|
+
Glyph['language.set'] = 'xml'
|
70
|
+
Glyph.run! 'load:all'
|
71
|
+
rep(x, "HTML text") { macro_exec html }
|
72
|
+
end
|
data/book/config.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
---
|
2
|
-
:highlighters:
|
3
|
-
:current: ultraviolet
|
4
|
-
:ultraviolet:
|
5
|
-
:theme: blackboard
|
6
2
|
:document:
|
7
3
|
:output: html
|
8
4
|
:title: Glyph
|
9
5
|
:subtitle: Rapid Document Authoring Framework
|
10
6
|
:author: Fabio Cevasco
|
7
|
+
:revision: "v0.3.0"
|
11
8
|
:filename: glyph
|
9
|
+
:draft: true
|
10
|
+
:filters:
|
11
|
+
:highlighter: ultraviolet
|
data/book/document.glyph
CHANGED
@@ -1,66 +1,99 @@
|
|
1
|
-
|
2
|
-
head[
|
1
|
+
book[
|
2
|
+
@head[
|
3
3
|
style[default.css]
|
4
4
|
?[eq[$[document.output]|pdf]|style[pagination.css]]
|
5
|
-
?[eq[$[
|
6
|
-
?[eq[$[
|
5
|
+
?[eq[$[filters.highlighter]|coderay]|style[coderay.css]]
|
6
|
+
?[eq[$[filters.highlighter]|ultraviolet]|style[ultraviolet/lazy.css]]
|
7
7
|
]
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
introduction[header[Introduction]
|
21
|
-
textile[@[introduction.glyph]]
|
22
|
-
section[header[License]
|
23
|
-
textile[@[license.glyph]]
|
24
|
-
]
|
25
|
-
]
|
26
|
-
acknowledgement[header[Acknowledgement]
|
27
|
-
textile[@[acknowledgement.glyph]]
|
8
|
+
@pre-title[
|
9
|
+
?[eq[$[document.output]|pdf]|image[@width[20%]@height[20%]glyph.svg]]
|
10
|
+
?[eq[$[document.output]|html]|image[@width[20%]@height[20%]glyph.png]]
|
11
|
+
]
|
12
|
+
@frontmatter[
|
13
|
+
toc[3]
|
14
|
+
introduction[
|
15
|
+
@title[Introduction]
|
16
|
+
textile[include[introduction]]
|
17
|
+
section[
|
18
|
+
@title[License]
|
19
|
+
textile[include[license]]
|
28
20
|
]
|
29
21
|
]
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
textile[@[getting_started.glyph]]
|
34
|
-
]
|
35
|
-
chapter[
|
36
|
-
header[Authoring Documents]
|
37
|
-
textile[@[authoring.glyph]]
|
38
|
-
]
|
39
|
-
chapter[
|
40
|
-
header[Extending Glyph|extending]
|
41
|
-
textile[@[extending.glyph]]
|
42
|
-
]
|
43
|
-
chapter[
|
44
|
-
header[Troubleshooting]
|
45
|
-
textile[@[troubleshooting.glyph]]
|
46
|
-
]
|
22
|
+
acknowledgement[
|
23
|
+
@title[Acknowledgement]
|
24
|
+
textile[include[acknowledgement]]
|
47
25
|
]
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
]
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
]
|
61
|
-
|
62
|
-
|
63
|
-
]
|
26
|
+
]
|
27
|
+
@bodymatter[
|
28
|
+
chapter[
|
29
|
+
@title[Getting Started]
|
30
|
+
include[getting_started/create_project]
|
31
|
+
include[getting_started/structure]
|
32
|
+
include[getting_started/configuration]
|
33
|
+
]
|
34
|
+
chapter[
|
35
|
+
@title[Authoring Documents]
|
36
|
+
include[text_editing/glyph_files]
|
37
|
+
include[text_editing/macro_intro]
|
38
|
+
include[text_editing/sections]
|
39
|
+
include[text_editing/links]
|
40
|
+
include[text_editing/images]
|
41
|
+
include[text_editing/code]
|
42
|
+
include[text_editing/raw_html]
|
43
|
+
include[text_editing/stylesheets]
|
44
|
+
include[text_editing/inclusions]
|
45
|
+
include[text_editing/evaluation]
|
46
|
+
include[text_editing/conditionals]
|
47
|
+
]
|
48
|
+
chapter[
|
49
|
+
@title[Generating Output Files]
|
50
|
+
include[compiling/compiling]
|
51
|
+
include[compiling/lite_mode]
|
52
|
+
include[compiling/programmatic_usage]
|
53
|
+
]
|
54
|
+
chapter[
|
55
|
+
@title[Extending Glyph]
|
56
|
+
@id[extending]
|
57
|
+
include[extending/internals]
|
58
|
+
include[extending/macro_def]
|
59
|
+
include[extending/params_attrs]
|
60
|
+
include[extending/bookmarks_headers]
|
61
|
+
include[extending/placeholders]
|
62
|
+
include[extending/validators]
|
63
|
+
include[extending/interpreting]
|
64
|
+
include[extending/further_reading]
|
65
|
+
]
|
66
|
+
chapter[
|
67
|
+
@title[Troubleshooting]
|
68
|
+
include[troubleshooting/errors_intro]
|
69
|
+
include[troubleshooting/errors_generic]
|
70
|
+
include[troubleshooting/errors_parser]
|
71
|
+
include[troubleshooting/errors_command]
|
72
|
+
include[troubleshooting/errors_macro]
|
73
|
+
]
|
74
|
+
]
|
75
|
+
@backmatter[
|
76
|
+
appendix[
|
77
|
+
@title[Command Reference]
|
78
|
+
@id[cmd_ref]
|
79
|
+
include[ref_commands]
|
80
|
+
]
|
81
|
+
appendix[
|
82
|
+
@title[Macro Reference]
|
83
|
+
@id[macro_ref]
|
84
|
+
include[macros/macros_core]
|
85
|
+
include[macros/macros_block]
|
86
|
+
include[macros/macros_inline]
|
87
|
+
include[macros/macros_filters]
|
88
|
+
include[macros/macros_structure]
|
89
|
+
]
|
90
|
+
appendix[
|
91
|
+
@title[Configuration Reference]
|
92
|
+
@id[cfg_ref]
|
93
|
+
include[ref_config]
|
94
|
+
]
|
95
|
+
appendix[@title[Changelog]
|
96
|
+
include[changelog]
|
64
97
|
]
|
65
98
|
]
|
66
99
|
]
|
Binary file
|
@@ -6,7 +6,7 @@ macro :error_table do
|
|
6
6
|
<th style="width:30%">Error Message</th>
|
7
7
|
<th>Description</th>
|
8
8
|
</tr>
|
9
|
-
#{
|
9
|
+
#{value}
|
10
10
|
</table>
|
11
11
|
}
|
12
12
|
end
|
@@ -22,42 +22,45 @@ macro :ref_error do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
macro :"%>" do
|
25
|
-
interpret "=>[#m_#{
|
25
|
+
interpret "=>[#m_#{value.gsub(/[^a-z0-1_-]/, '_')}|#{value}] macro"
|
26
26
|
end
|
27
27
|
|
28
28
|
macro :"#>" do
|
29
|
-
interpret "=>[#c_
|
29
|
+
interpret "=>[#c_#{value}|#{value}] command"
|
30
30
|
end
|
31
31
|
|
32
32
|
macro :"$>" do
|
33
|
-
val =
|
34
|
-
interpret "=>[#s_#{val}
|
33
|
+
val = value.gsub /\./, "_"
|
34
|
+
interpret "=>[#s_#{val}|#{value}] setting"
|
35
35
|
end
|
36
36
|
|
37
37
|
macro :default do
|
38
|
-
%{
|
38
|
+
%{<strong>Default Value:</strong> <code>#{value}</code>}
|
39
39
|
end
|
40
40
|
|
41
|
-
macro :
|
41
|
+
macro :parameters do
|
42
42
|
interpret %{
|
43
|
-
section[
|
43
|
+
section[
|
44
|
+
@title[#{@name.to_s[0..0].upcase+@name.to_s[1..@name.to_s.length-1]}]
|
45
|
+
@notoc[true]
|
44
46
|
|
45
47
|
<table style="width:100%;">
|
46
48
|
<tr>
|
47
49
|
<th style="width:30%">#{@name.to_s[0..0].upcase+@name.to_s[1..@name.to_s.length-2]}</th>
|
48
50
|
<th>Description</th>
|
49
51
|
</tr>
|
50
|
-
#{
|
52
|
+
#{value}
|
51
53
|
</table>
|
52
54
|
]
|
53
55
|
}
|
54
56
|
end
|
55
57
|
|
56
58
|
macro :option do
|
57
|
-
ident
|
59
|
+
ident = param(0)
|
60
|
+
desc = param(1)
|
58
61
|
%{
|
59
62
|
<tr>
|
60
|
-
<td><
|
63
|
+
<td><code>-#{ident[0..0]}</code> (<code>--#{ident}</code>)</td>
|
61
64
|
<td>
|
62
65
|
#{desc}
|
63
66
|
</td>
|
@@ -66,40 +69,79 @@ macro :option do
|
|
66
69
|
end
|
67
70
|
|
68
71
|
macro :values do
|
69
|
-
%{*Possible Values:*
|
72
|
+
%{*Possible Values:* @#{value}@}
|
70
73
|
end
|
71
74
|
|
72
75
|
macro :example do
|
73
|
-
%{
|
76
|
+
%{<p><strong>Example:</strong> <code>#{value}</code></p>}
|
77
|
+
end
|
78
|
+
|
79
|
+
macro :block_example do
|
80
|
+
interpret %{
|
81
|
+
div[@class[example]
|
82
|
+
p[strong[Example]]
|
83
|
+
highlight[=html|
|
84
|
+
#{value}
|
85
|
+
=]
|
86
|
+
]
|
87
|
+
}
|
74
88
|
end
|
75
89
|
|
76
90
|
macro :examples do
|
77
91
|
%{
|
78
|
-
|
79
|
-
|
92
|
+
<div class="examples">
|
93
|
+
<p><strong>Examples:</strong></p>
|
94
|
+
#{value.split("\n").map{|i| "<code>#{i}</code><br />"}.to_s}
|
95
|
+
</div>
|
80
96
|
}
|
81
97
|
end
|
82
98
|
|
83
99
|
macro :aliases do
|
84
|
-
%{
|
100
|
+
%{<strong>Aliases:</strong> <code>#{value}</code>}
|
85
101
|
end
|
86
102
|
|
87
103
|
macro :ref_macro do
|
88
|
-
m_name
|
104
|
+
m_name = raw_attr(:n)
|
105
|
+
m_value = raw_attr(:desc)
|
106
|
+
m_params = "parameters[#{raw_attr(:params)}]" if raw_attr(:params)
|
107
|
+
m_attrs = "attributes[#{raw_attr(:attrs)}]" if raw_attr(:attrs)
|
108
|
+
m_examples = "examples[#{raw_attr(:examples)}]" if raw_attr(:examples)
|
109
|
+
m_example = "example[#{raw_attr(:example)}]" if raw_attr(:example)
|
110
|
+
m_block_example = "block_example[#{raw_attr(:block_example)}]" if raw_attr(:block_example)
|
111
|
+
m_aliases = "aliases[#{raw_attr(:aliases)}]" if raw_attr(:aliases)
|
112
|
+
m_remarks = %{section[
|
113
|
+
@title[Remarks]
|
114
|
+
@notoc[:true]
|
115
|
+
txt[
|
116
|
+
#{raw_attr(:remarks)}
|
117
|
+
]
|
118
|
+
]} if raw_attr(:remarks)
|
89
119
|
interpret %{
|
90
|
-
section[
|
120
|
+
section[
|
121
|
+
@title[<code>#{m_name}</code>]
|
122
|
+
@id[m_#{m_name.gsub(/[^a-z0-1_-]/, '_')}]
|
123
|
+
txt[
|
91
124
|
#{m_value}
|
125
|
+
]
|
126
|
+
#{m_aliases}
|
127
|
+
#{m_example}
|
128
|
+
#{m_block_example}
|
129
|
+
#{m_examples}
|
130
|
+
#{m_params}
|
131
|
+
#{m_attrs}
|
132
|
+
#{m_remarks}
|
92
133
|
]
|
93
134
|
}
|
94
135
|
end
|
95
136
|
|
96
137
|
macro :ref_config do
|
97
|
-
m_name
|
138
|
+
m_name = param(0)
|
139
|
+
m_value = param(1)
|
98
140
|
default = Glyph::SYSTEM_CONFIG.get(m_name).to_yaml.gsub(/^---/, '')
|
99
141
|
default = "nil" if default.blank?
|
100
142
|
interpret %{tr[
|
101
|
-
td[
|
102
|
-
td[#{m_value}]
|
143
|
+
td[code[#{m_name}] #[s_#{m_name.gsub(/\./, '_').gsub(/\*/,'')}]]
|
144
|
+
td[txt[#{m_value}]]
|
103
145
|
td[
|
104
146
|
code[=
|
105
147
|
#{default}
|
@@ -115,11 +157,22 @@ macro :config_table do
|
|
115
157
|
th[Description]
|
116
158
|
th[Default (YAML)]
|
117
159
|
]
|
118
|
-
|
160
|
+
#{value}
|
119
161
|
]}
|
120
162
|
end
|
121
163
|
|
164
|
+
macro :class do
|
165
|
+
if value.match /Glyph::/ then
|
166
|
+
path = "Glyph/#{value.gsub /Glyph::/, ''}"
|
167
|
+
else
|
168
|
+
path = value
|
169
|
+
end
|
170
|
+
interpret %{=>[&[yardoc]/#{path}|code[#{value}]]}
|
171
|
+
end
|
172
|
+
|
122
173
|
|
123
174
|
macro_alias :options => :parameters
|
175
|
+
macro_alias :attributes => :parameters
|
124
176
|
macro_alias '-p' => :ref_error
|
177
|
+
macro_alias '-a' => :ref_error
|
125
178
|
macro_alias '-o' => :option
|