erbook 7.0.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. data/CREDITS +3 -0
  2. data/bin/erbook +2 -2
  3. data/doc/HelloWorld.input +1 -1
  4. data/doc/api/classes/ERBook/Document.html +153 -150
  5. data/doc/api/classes/ERBook/Document/Node.html +7 -7
  6. data/doc/api/classes/ERBook/Template.html +24 -24
  7. data/doc/api/classes/ERBook/Template/Sandbox.html +6 -6
  8. data/doc/api/classes/RDoc/AnyMethod.html +32 -28
  9. data/doc/api/classes/RDoc/TopLevel.html +47 -47
  10. data/doc/api/classes/String.html +14 -14
  11. data/doc/api/created.rid +1 -1
  12. data/doc/api/files/CREDITS.html +68 -0
  13. data/doc/api/files/lib/erbook/document_rb.html +1 -3
  14. data/doc/api/files/lib/erbook/rdoc_rb.html +1 -1
  15. data/doc/api/files/lib/erbook/template_rb.html +1 -1
  16. data/doc/api/files/lib/erbook/to_xhtml_rb.html +3 -3
  17. data/doc/api/files/lib/erbook_rb.html +3 -1
  18. data/doc/api/panel/search_index.js +1 -1
  19. data/doc/api/panel/tree.js +1 -1
  20. data/doc/formats.erb +129 -8
  21. data/doc/history.erb +136 -2
  22. data/doc/index.erb +2 -2
  23. data/doc/index.xhtml +1867 -610
  24. data/doc/intro.erb +29 -13
  25. data/doc/setup.erb +9 -2
  26. data/doc/theory.erb +24 -3
  27. data/doc/usage.erb +11 -2
  28. data/fmt/xhtml.yaml +913 -707
  29. data/fmt/{xhtml.icons → xhtml/icons}/index.yaml +2 -2
  30. data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/COPYING +0 -0
  31. data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/README +0 -0
  32. data/fmt/{xhtml.icons → xhtml/icons}/mediawiki-1.13.2/skins/simple/external.png +0 -0
  33. data/fmt/{xhtml.icons → xhtml/icons}/rakefile +4 -6
  34. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/16x16/places/start-here.png +0 -0
  35. data/fmt/xhtml/icons/tango-icon-theme-0.8.90/32x32/actions/go-next.png +0 -0
  36. data/fmt/xhtml/icons/tango-icon-theme-0.8.90/32x32/actions/go-previous.png +0 -0
  37. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/32x32/places/start-here.png +0 -0
  38. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/32x32/status/software-update-available.png +0 -0
  39. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/apps/accessories-text-editor.png +0 -0
  40. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/apps/internet-group-chat.png +0 -0
  41. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/emblems/emblem-important.png +0 -0
  42. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-error.png +0 -0
  43. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-information.png +0 -0
  44. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/48x48/status/dialog-warning.png +0 -0
  45. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/COPYING +0 -0
  46. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/README +0 -0
  47. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/bookmark-new.svg +0 -0
  48. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/go-home.svg +0 -0
  49. data/fmt/xhtml/icons/tango-icon-theme-0.8.90/scalable/actions/go-next.svg +191 -0
  50. data/fmt/xhtml/icons/tango-icon-theme-0.8.90/scalable/actions/go-previous.svg +852 -0
  51. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/actions/view-refresh.svg +0 -0
  52. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/apps/accessories-text-editor.svg +0 -0
  53. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/apps/internet-group-chat.svg +0 -0
  54. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/emblems/emblem-favorite.svg +0 -0
  55. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/emblems/emblem-important.svg +0 -0
  56. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/mimetypes/application-certificate.svg +0 -0
  57. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/places/start-here.svg +0 -0
  58. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-error.svg +0 -0
  59. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg +0 -0
  60. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/dialog-warning.svg +0 -0
  61. data/fmt/{xhtml.icons → xhtml/icons}/tango-icon-theme-0.8.90/scalable/status/software-update-available.svg +0 -0
  62. data/fmt/xhtml/jquery/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  63. data/fmt/xhtml/jquery/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  64. data/fmt/xhtml/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  65. data/fmt/xhtml/jquery/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  66. data/fmt/xhtml/jquery/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  67. data/fmt/xhtml/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  68. data/fmt/xhtml/jquery/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  69. data/fmt/xhtml/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  70. data/fmt/xhtml/jquery/images/ui-icons_222222_256x240.png +0 -0
  71. data/fmt/xhtml/jquery/images/ui-icons_2e83ff_256x240.png +0 -0
  72. data/fmt/xhtml/jquery/images/ui-icons_454545_256x240.png +0 -0
  73. data/fmt/xhtml/jquery/images/ui-icons_888888_256x240.png +0 -0
  74. data/fmt/xhtml/jquery/images/ui-icons_cd0a0a_256x240.png +0 -0
  75. data/fmt/{xhtml.scripts → xhtml/jquery}/jquery-1.3.2.min.js +0 -0
  76. data/fmt/xhtml/jquery/jquery-ui-1.7.2.custom.css +406 -0
  77. data/fmt/xhtml/jquery/jquery-ui-1.7.2.custom.min.js +43 -0
  78. data/lang/de.yaml +13 -2
  79. data/lang/el.yaml +13 -2
  80. data/lang/es.yaml +13 -2
  81. data/lang/fr.yaml +13 -2
  82. data/lang/it.yaml +13 -2
  83. data/lang/ja.yaml +13 -2
  84. data/lang/ko.yaml +13 -2
  85. data/lang/nl.yaml +13 -2
  86. data/lang/phrases.yaml +15 -4
  87. data/lang/pt.yaml +13 -2
  88. data/lang/ru.yaml +13 -2
  89. data/lang/zh.yaml +13 -2
  90. data/lang/zt.yaml +13 -2
  91. data/lib/erbook.rb +10 -8
  92. data/lib/erbook/document.rb +144 -139
  93. data/lib/erbook/rdoc.rb +29 -7
  94. data/lib/erbook/template.rb +2 -2
  95. data/lib/erbook/to_xhtml.rb +6 -2
  96. metadata +78 -45
  97. data/doc/api/files/ANN_eml.html +0 -276
  98. data/doc/api/files/ANN_html.html +0 -407
  99. data/doc/api/files/ANN_txt.html +0 -271
  100. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-down.png +0 -0
  101. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-up.png +0 -0
  102. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-down.svg +0 -200
  103. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-up.svg +0 -196
  104. data/fmt/xhtml.scripts/jquery.localscroll-1.2.7-min.js +0 -9
  105. data/fmt/xhtml.scripts/jquery.scrollTo-1.4.1-min.js +0 -11
data/CREDITS ADDED
@@ -0,0 +1,3 @@
1
+ * Jens Vierbuchen
2
+ * Maunika Gosike
3
+ * [Zhang Chiyuan](http://lifegoo.pluskid.org)
data/bin/erbook CHANGED
@@ -14,8 +14,8 @@
14
14
  #
15
15
 
16
16
  #--
17
- # Copyright 2007 Suraj N. Kurapati
18
- # See the LICENSE file for details.
17
+ # Copyright protects this work.
18
+ # See LICENSE file for details.
19
19
  #++
20
20
 
21
21
  require 'rubygems'
data/doc/HelloWorld.input CHANGED
@@ -1,4 +1,4 @@
1
- <% $style = "border-left: thick dotted LightGrey; padding-left: 1em;" %>
1
+ <% $style = "border-left: thick dotted #D3D3D3; padding-left: 1em;" %>
2
2
  <% hello "Pretentious", 1, 2, 3 do %>
3
3
  <big>I'm</big> the very first node, oh _yes_ I am! *sneer*
4
4
 
@@ -49,7 +49,7 @@
49
49
  <dd>
50
50
  <ul>
51
51
 
52
- <li><a href="#M000042">new</a></li>
52
+ <li><a href="#M000048">new</a></li>
53
53
 
54
54
  </ul>
55
55
  </dd>
@@ -58,7 +58,7 @@
58
58
  <dd>
59
59
  <ul>
60
60
 
61
- <li><a href="#M000055">to_s</a></li>
61
+ <li><a href="#M000061">to_s</a></li>
62
62
 
63
63
  </ul>
64
64
  </dd>
@@ -132,9 +132,9 @@ All nodes in the document arranged by node type.
132
132
  <div class="sectiontitle">Class Public methods</div>
133
133
 
134
134
  <div class="method">
135
- <div class="title" id="M000042">
135
+ <div class="title" id="M000048">
136
136
 
137
- <a name="M000042"></a><b>new</b>(format_name, input_text, input_file, options = {})
137
+ <a name="M000048"></a><b>new</b>(format_name, input_text, input_file, options = {})
138
138
 
139
139
  </div>
140
140
 
@@ -166,16 +166,16 @@ specification file.
166
166
 
167
167
  <div class="sourcecode">
168
168
  <p class="source-link">
169
- Source: <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show</a>
169
+ Source: <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show</a>
170
170
 
171
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/document.rb#L42" target="_blank" class="github_url">on GitHub</a>
171
+ | <a href="http://github.com/sunaku/erbook/blob/9c3f6ad5c94f67d3f20e896873dbc7b127036c44/lib/erbook/document.rb#L42" target="_blank" class="github_url">on GitHub</a>
172
172
 
173
173
  </p>
174
- <div id="M000042_source" class="dyn-source">
174
+ <div id="M000048_source" class="dyn-source">
175
175
  <pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 42</span>
176
176
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">format_name</span>, <span class="ruby-identifier">input_text</span>, <span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">options</span> = {}
177
177
  <span class="ruby-comment cmt"># process format specification</span>
178
- <span class="ruby-ivar">@format_file</span> = <span class="ruby-identifier">format_name</span>.<span class="ruby-identifier">to_s</span>
178
+ <span class="ruby-ivar">@format_file</span> = <span class="ruby-identifier">format_name</span>.<span class="ruby-identifier">to_s</span>
179
179
 
180
180
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span> <span class="ruby-ivar">@format_file</span> <span class="ruby-keyword kw">or</span>
181
181
  <span class="ruby-ivar">@format_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ERBook</span><span class="ruby-operator">::</span><span class="ruby-constant">FORMATS_DIR</span>, <span class="ruby-ivar">@format_file</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'.yaml'</span>)
@@ -196,160 +196,163 @@ specification file.
196
196
  <span class="ruby-ivar">@node_defs</span> = <span class="ruby-ivar">@format</span>[<span class="ruby-value str">'nodes'</span>]
197
197
 
198
198
  <span class="ruby-comment cmt"># process input document</span>
199
- <span class="ruby-keyword kw">begin</span>
200
- <span class="ruby-comment cmt"># create sandbox for input evaluation</span>
201
- <span class="ruby-identifier">template</span> = <span class="ruby-constant">Template</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">input_text</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:unindent</span>])
202
- <span class="ruby-identifier">sandbox</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">sandbox</span>
203
-
204
- <span class="ruby-ivar">@template_vars</span> = {
205
- <span class="ruby-identifier">:@format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@format</span>,
206
- <span class="ruby-identifier">:@roots</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@roots</span> = [], <span class="ruby-comment cmt"># root nodes of all trees</span>
207
- <span class="ruby-identifier">:@nodes</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@nodes</span> = [], <span class="ruby-comment cmt"># all nodes in the forest</span>
208
- <span class="ruby-identifier">:@nodes_by_type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@nodes_by_type</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] },
209
- <span class="ruby-identifier">:@stack</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-comment cmt"># stack for all nodes</span>
210
- }.<span class="ruby-identifier">each_pair</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sandbox</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>) }
211
-
212
- <span class="ruby-comment cmt"># Handles the method call from a node</span>
213
- <span class="ruby-comment cmt"># placeholder in the input document.</span>
214
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sandbox</span>.<span class="ruby-identifier">__node_impl__</span> <span class="ruby-identifier">node_type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">node_args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">node_content</span>
215
- <span class="ruby-identifier">node</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(
216
- <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">node_type</span>,
217
- <span class="ruby-identifier">:defn</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@format</span>[<span class="ruby-value str">'nodes'</span>][<span class="ruby-identifier">node_type</span>],
218
- <span class="ruby-identifier">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">node_args</span>,
219
- <span class="ruby-identifier">:children</span> =<span class="ruby-operator">&gt;</span> [],
220
-
221
- <span class="ruby-comment cmt"># omit erbook internals from the stack trace</span>
222
- <span class="ruby-identifier">:trace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
223
- [<span class="ruby-identifier">$0</span>, <span class="ruby-constant">ERBook</span><span class="ruby-operator">::</span><span class="ruby-constant">INSTALL</span>].<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> }
224
- }
225
- )
226
- <span class="ruby-ivar">@nodes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
227
- <span class="ruby-ivar">@nodes_by_type</span>[<span class="ruby-identifier">node</span>.<span class="ruby-identifier">type</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
228
-
229
- <span class="ruby-comment cmt"># calculate occurrence number for this node</span>
230
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'number'</span>]
231
- <span class="ruby-ivar">@count</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = []}
232
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">number</span> = (<span class="ruby-ivar">@count</span>[<span class="ruby-identifier">node</span>.<span class="ruby-identifier">type</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>).<span class="ruby-identifier">length</span>
233
- <span class="ruby-keyword kw">end</span>
199
+ <span class="ruby-keyword kw">begin</span>
200
+ <span class="ruby-comment cmt"># create sandbox for input evaluation</span>
201
+ <span class="ruby-identifier">template</span> = <span class="ruby-constant">Template</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">input_file</span>, <span class="ruby-identifier">input_text</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:unindent</span>])
202
+ <span class="ruby-identifier">sandbox</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">sandbox</span>
203
+
204
+ <span class="ruby-ivar">@template_vars</span> = {
205
+ <span class="ruby-identifier">:@format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@format</span>,
206
+ <span class="ruby-identifier">:@roots</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@roots</span> = [], <span class="ruby-comment cmt"># root nodes of all trees</span>
207
+ <span class="ruby-identifier">:@nodes</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@nodes</span> = [], <span class="ruby-comment cmt"># all nodes in the forest</span>
208
+ <span class="ruby-identifier">:@nodes_by_type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@nodes_by_type</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] },
209
+ <span class="ruby-identifier">:@stack</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-comment cmt"># stack for all nodes</span>
210
+ }.<span class="ruby-identifier">each_pair</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sandbox</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span>) }
211
+
212
+ <span class="ruby-comment cmt">##</span>
213
+ <span class="ruby-comment cmt"># Handles the method call from a node</span>
214
+ <span class="ruby-comment cmt"># placeholder in the input document.</span>
215
+ <span class="ruby-comment cmt">#</span>
216
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sandbox</span>.<span class="ruby-identifier">__node_impl__</span> <span class="ruby-identifier">node_type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">node_args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">node_content</span>
217
+ <span class="ruby-identifier">node</span> = <span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(
218
+ <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">node_type</span>,
219
+ <span class="ruby-identifier">:defn</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@format</span>[<span class="ruby-value str">'nodes'</span>][<span class="ruby-identifier">node_type</span>],
220
+ <span class="ruby-identifier">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">node_args</span>,
221
+ <span class="ruby-identifier">:children</span> =<span class="ruby-operator">&gt;</span> [],
222
+
223
+ <span class="ruby-comment cmt"># omit erbook internals from the stack trace</span>
224
+ <span class="ruby-identifier">:trace</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
225
+ [<span class="ruby-identifier">$0</span>, <span class="ruby-constant">ERBook</span><span class="ruby-operator">::</span><span class="ruby-constant">INSTALL</span>].<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> }
226
+ }
227
+ )
228
+ <span class="ruby-ivar">@nodes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
229
+ <span class="ruby-ivar">@nodes_by_type</span>[<span class="ruby-identifier">node</span>.<span class="ruby-identifier">type</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
230
+
231
+ <span class="ruby-comment cmt"># calculate occurrence number for this node</span>
232
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'number'</span>]
233
+ <span class="ruby-ivar">@count</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = []}
234
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">number</span> = (<span class="ruby-ivar">@count</span>[<span class="ruby-identifier">node</span>.<span class="ruby-identifier">type</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>).<span class="ruby-identifier">length</span>
235
+ <span class="ruby-keyword kw">end</span>
234
236
 
235
- <span class="ruby-comment cmt"># assign node family</span>
236
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">last</span>
237
- <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
238
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-identifier">parent</span>
239
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> = <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">depth</span>
240
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'depth'</span>]
237
+ <span class="ruby-comment cmt"># assign node family</span>
238
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">parent</span> = <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">last</span>
239
+ <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
240
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-identifier">parent</span>
241
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> = <span class="ruby-identifier">parent</span>.<span class="ruby-identifier">depth</span>
242
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'depth'</span>]
241
243
 
242
- <span class="ruby-comment cmt"># calculate latex-style index number for this node</span>
243
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>]
244
- <span class="ruby-identifier">ancestry</span> = <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>] }.<span class="ruby-identifier">index</span>
245
- <span class="ruby-identifier">branches</span> = <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">index</span> }
244
+ <span class="ruby-comment cmt"># calculate latex-style index number for this node</span>
245
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>]
246
+ <span class="ruby-identifier">ancestry</span> = <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>] }.<span class="ruby-identifier">index</span>
247
+ <span class="ruby-identifier">branches</span> = <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">index</span> }
246
248
 
247
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">index</span> = [<span class="ruby-identifier">ancestry</span>, <span class="ruby-identifier">branches</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)
248
- <span class="ruby-keyword kw">end</span>
249
- <span class="ruby-keyword kw">else</span>
250
- <span class="ruby-ivar">@roots</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
251
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-keyword kw">nil</span>
252
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> = <span class="ruby-value">0</span>
253
-
254
- <span class="ruby-comment cmt"># calculate latex-style index number for this node</span>
255
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>]
256
- <span class="ruby-identifier">branches</span> = <span class="ruby-ivar">@roots</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">index</span> }
257
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">index</span> = (<span class="ruby-identifier">branches</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
258
- <span class="ruby-keyword kw">end</span>
249
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">index</span> = [<span class="ruby-identifier">ancestry</span>, <span class="ruby-identifier">branches</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)
259
250
  <span class="ruby-keyword kw">end</span>
260
-
261
- <span class="ruby-comment cmt"># assign node content</span>
262
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
263
- <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">node</span>
264
- <span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span> = <span class="ruby-identifier">__block_content__</span>(<span class="ruby-identifier">node</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">node_content</span>)
265
- <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">pop</span>
251
+ <span class="ruby-keyword kw">else</span>
252
+ <span class="ruby-ivar">@roots</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
253
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">parent</span> = <span class="ruby-keyword kw">nil</span>
254
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">depth</span> = <span class="ruby-value">0</span>
255
+
256
+ <span class="ruby-comment cmt"># calculate latex-style index number for this node</span>
257
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'index'</span>]
258
+ <span class="ruby-identifier">branches</span> = <span class="ruby-ivar">@roots</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">index</span> }
259
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">index</span> = (<span class="ruby-identifier">branches</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
266
260
  <span class="ruby-keyword kw">end</span>
267
-
268
- <span class="ruby-ivar">@buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
269
-
270
- <span class="ruby-keyword kw">nil</span>
271
261
  <span class="ruby-keyword kw">end</span>
272
262
 
273
- <span class="ruby-ivar">@node_defs</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
274
- <span class="ruby-comment cmt"># XXX: using a string because define_method()</span>
275
- <span class="ruby-comment cmt"># does not accept a block until Ruby 1.9</span>
276
- <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span> = <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>; <span class="ruby-identifier">eval</span> <span class="ruby-node">%{
277
- def sandbox.#{type} *node_args, &amp;node_content
278
- __node_impl__ #{type.inspect}, *node_args, &amp;node_content
279
- end
280
- }</span>, <span class="ruby-identifier">binding</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>
263
+ <span class="ruby-comment cmt"># assign node content</span>
264
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
265
+ <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">push</span> <span class="ruby-identifier">node</span>
266
+ <span class="ruby-identifier">node</span>.<span class="ruby-identifier">content</span> = <span class="ruby-identifier">__block_content__</span>(<span class="ruby-identifier">node</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">node_content</span>)
267
+ <span class="ruby-ivar">@stack</span>.<span class="ruby-identifier">pop</span>
281
268
  <span class="ruby-keyword kw">end</span>
282
269
 
283
- <span class="ruby-comment cmt"># evaluate the input &amp; build the document tree</span>
284
- <span class="ruby-identifier">template</span>.<span class="ruby-identifier">render</span>
285
- <span class="ruby-ivar">@processed_document</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">buffer</span>
270
+ <span class="ruby-ivar">@buffer</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
286
271
 
287
- <span class="ruby-comment cmt"># chain block-level nodes together for local navigation</span>
288
- <span class="ruby-identifier">block_nodes</span> = <span class="ruby-ivar">@nodes</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'bypass'</span>] <span class="ruby-operator">||</span>
289
- <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'inline'</span>] }
272
+ <span class="ruby-keyword kw">nil</span>
273
+ <span class="ruby-keyword kw">end</span>
290
274
 
291
- <span class="ruby-identifier">require</span> <span class="ruby-value str">'enumerator'</span>
292
- <span class="ruby-identifier">block_nodes</span>.<span class="ruby-identifier">each_cons</span>(<span class="ruby-value">2</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
293
- <span class="ruby-identifier">a</span>.<span class="ruby-identifier">next_node</span> = <span class="ruby-identifier">b</span>
294
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">prev_node</span> = <span class="ruby-identifier">a</span>
295
- <span class="ruby-keyword kw">end</span>
275
+ <span class="ruby-ivar">@node_defs</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">type</span><span class="ruby-operator">|</span>
276
+ <span class="ruby-comment cmt"># XXX: using a string because define_method()</span>
277
+ <span class="ruby-comment cmt"># does not accept a block until Ruby 1.9</span>
278
+ <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span> = <span class="ruby-keyword kw">__FILE__</span>, <span class="ruby-keyword kw">__LINE__</span>; <span class="ruby-identifier">eval</span> <span class="ruby-node">%{
279
+ def sandbox.#{type} *node_args, &amp;node_content
280
+ __node_impl__ #{type.inspect}, *node_args, &amp;node_content
281
+ end
282
+ }</span>, <span class="ruby-identifier">binding</span>, <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>
283
+ <span class="ruby-keyword kw">end</span>
296
284
 
297
- <span class="ruby-comment cmt"># calculate output for all nodes</span>
298
- <span class="ruby-identifier">actual_output_by_node</span> = {}
299
-
300
- <span class="ruby-identifier">visitor</span> = <span class="ruby-identifier">lambda</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
301
- <span class="ruby-comment cmt">#</span>
302
- <span class="ruby-comment cmt"># allow child nodes to calculate their actual</span>
303
- <span class="ruby-comment cmt"># output and to set their identifier as Node#output</span>
304
- <span class="ruby-comment cmt">#</span>
305
- <span class="ruby-comment cmt"># we do this nodes first because this node's</span>
306
- <span class="ruby-comment cmt"># content contains the child nodes' output</span>
307
- <span class="ruby-comment cmt">#</span>
308
- <span class="ruby-identifier">n</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">visitor</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">c</span> }
309
-
310
- <span class="ruby-comment cmt"># calculate the output for this node</span>
311
- <span class="ruby-identifier">actual_output</span> = <span class="ruby-constant">Template</span>.<span class="ruby-identifier">new</span>(
312
- <span class="ruby-node">&quot;#{@format_file}:nodes:#{n.type}:output&quot;</span>,
313
- <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'output'</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">chomp</span>
314
- ).<span class="ruby-identifier">render_with</span>(<span class="ruby-ivar">@template_vars</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">:@node</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">n</span>))
315
-
316
- <span class="ruby-comment cmt"># reveal child nodes' actual output in this node's actual output</span>
317
- <span class="ruby-identifier">n</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
318
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'inline'</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">c</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'bypass'</span>]
319
- <span class="ruby-identifier">actual_output</span>[<span class="ruby-identifier">c</span>.<span class="ruby-identifier">output</span>] = <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">c</span>]
320
-
321
- <span class="ruby-keyword kw">else</span>
322
- <span class="ruby-comment cmt"># pull block-level node out of paragraph tag added by Maruku</span>
323
- <span class="ruby-identifier">actual_output</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-node">%r/(&lt;p&gt;\s*)?#{Regexp.quote c.output}/</span> <span class="ruby-keyword kw">do</span>
324
- <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">c</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">to_s</span>
325
- <span class="ruby-keyword kw">end</span>
285
+ <span class="ruby-comment cmt"># evaluate the input &amp; build the document tree</span>
286
+ <span class="ruby-identifier">template</span>.<span class="ruby-identifier">render</span>
287
+ <span class="ruby-ivar">@processed_document</span> = <span class="ruby-identifier">template</span>.<span class="ruby-identifier">buffer</span>
288
+
289
+ <span class="ruby-comment cmt"># chain block-level nodes together for local navigation</span>
290
+ <span class="ruby-identifier">block_nodes</span> = <span class="ruby-ivar">@nodes</span>.<span class="ruby-identifier">reject</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
291
+ <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'bypass'</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'inline'</span>]
292
+ <span class="ruby-keyword kw">end</span>
293
+
294
+ <span class="ruby-identifier">require</span> <span class="ruby-value str">'enumerator'</span>
295
+ <span class="ruby-identifier">block_nodes</span>.<span class="ruby-identifier">each_cons</span>(<span class="ruby-value">2</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
296
+ <span class="ruby-identifier">a</span>.<span class="ruby-identifier">next_node</span> = <span class="ruby-identifier">b</span>
297
+ <span class="ruby-identifier">b</span>.<span class="ruby-identifier">prev_node</span> = <span class="ruby-identifier">a</span>
298
+ <span class="ruby-keyword kw">end</span>
299
+
300
+ <span class="ruby-comment cmt"># calculate output for all nodes</span>
301
+ <span class="ruby-identifier">actual_output_by_node</span> = {}
302
+
303
+ <span class="ruby-identifier">visitor</span> = <span class="ruby-identifier">lambda</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
304
+ <span class="ruby-comment cmt">#</span>
305
+ <span class="ruby-comment cmt"># allow child nodes to calculate their actual</span>
306
+ <span class="ruby-comment cmt"># output and to set their identifier as Node#output</span>
307
+ <span class="ruby-comment cmt">#</span>
308
+ <span class="ruby-comment cmt"># we do this nodes first because this node's</span>
309
+ <span class="ruby-comment cmt"># content contains the child nodes' output</span>
310
+ <span class="ruby-comment cmt">#</span>
311
+ <span class="ruby-identifier">n</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">visitor</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">c</span> }
312
+
313
+ <span class="ruby-comment cmt"># calculate the output for this node</span>
314
+ <span class="ruby-identifier">actual_output</span> = <span class="ruby-constant">Template</span>.<span class="ruby-identifier">new</span>(
315
+ <span class="ruby-node">&quot;#{@format_file}:nodes:#{n.type}:output&quot;</span>,
316
+ <span class="ruby-identifier">n</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'output'</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">chomp</span>
317
+ ).<span class="ruby-identifier">render_with</span>(<span class="ruby-ivar">@template_vars</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">:@node</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">n</span>))
318
+
319
+ <span class="ruby-comment cmt"># reveal child nodes' actual output in this node's actual output</span>
320
+ <span class="ruby-identifier">n</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
321
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'inline'</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">c</span>.<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'bypass'</span>]
322
+ <span class="ruby-identifier">actual_output</span>[<span class="ruby-identifier">c</span>.<span class="ruby-identifier">output</span>] = <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">c</span>]
323
+
324
+ <span class="ruby-keyword kw">else</span>
325
+ <span class="ruby-comment cmt"># pull block-level node out of paragraph tag added by Maruku</span>
326
+ <span class="ruby-identifier">actual_output</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-node">%r/(&lt;p&gt;\s*)?#{Regexp.quote c.output}/</span> <span class="ruby-keyword kw">do</span>
327
+ <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">c</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">to_s</span>
326
328
  <span class="ruby-keyword kw">end</span>
327
329
  <span class="ruby-keyword kw">end</span>
328
-
329
- <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">n</span>] = <span class="ruby-identifier">actual_output</span>
330
-
331
- <span class="ruby-comment cmt">#</span>
332
- <span class="ruby-comment cmt"># allow the parent node to calculate its actual</span>
333
- <span class="ruby-comment cmt"># output without interference from the output of</span>
334
- <span class="ruby-comment cmt"># this node (Node#to_s is aliased to Node#output)</span>
335
- <span class="ruby-comment cmt">#</span>
336
- <span class="ruby-comment cmt"># this assumes that having this node's string</span>
337
- <span class="ruby-comment cmt"># representation be a consecutive sequence of digits</span>
338
- <span class="ruby-comment cmt"># will not interfere with the text-to-whatever</span>
339
- <span class="ruby-comment cmt"># transformation defined by the format specification</span>
340
- <span class="ruby-comment cmt">#</span>
341
- <span class="ruby-identifier">n</span>.<span class="ruby-identifier">output</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'I*'</span>).<span class="ruby-identifier">join</span>
342
330
  <span class="ruby-keyword kw">end</span>
343
331
 
344
- <span class="ruby-ivar">@roots</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">visitor</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">n</span> }
332
+ <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">n</span>] = <span class="ruby-identifier">actual_output</span>
333
+
334
+ <span class="ruby-comment cmt">#</span>
335
+ <span class="ruby-comment cmt"># allow the parent node to calculate its actual</span>
336
+ <span class="ruby-comment cmt"># output without interference from the output of</span>
337
+ <span class="ruby-comment cmt"># this node (Node#to_s is aliased to Node#output)</span>
338
+ <span class="ruby-comment cmt">#</span>
339
+ <span class="ruby-comment cmt"># this assumes that having this node's string</span>
340
+ <span class="ruby-comment cmt"># representation be a consecutive sequence of digits</span>
341
+ <span class="ruby-comment cmt"># will not interfere with the text-to-whatever</span>
342
+ <span class="ruby-comment cmt"># transformation defined by the format specification</span>
343
+ <span class="ruby-comment cmt">#</span>
344
+ <span class="ruby-identifier">n</span>.<span class="ruby-identifier">output</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-identifier">n</span>.<span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'I*'</span>).<span class="ruby-identifier">join</span>
345
+ <span class="ruby-keyword kw">end</span>
346
+
347
+ <span class="ruby-ivar">@roots</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">visitor</span>.<span class="ruby-identifier">call</span> <span class="ruby-identifier">n</span> }
345
348
 
346
- <span class="ruby-comment cmt"># replace the temporary identifier with each node's actual output</span>
347
- <span class="ruby-ivar">@nodes</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">output</span> = <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">n</span>] }
349
+ <span class="ruby-comment cmt"># replace the temporary identifier with each node's actual output</span>
350
+ <span class="ruby-ivar">@nodes</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> <span class="ruby-identifier">n</span>.<span class="ruby-identifier">output</span> = <span class="ruby-identifier">actual_output_by_node</span>[<span class="ruby-identifier">n</span>] }
348
351
 
349
- <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
350
- <span class="ruby-identifier">puts</span> <span class="ruby-identifier">input_text</span> <span class="ruby-comment cmt"># so the user can debug line numbers in stack trace</span>
351
- <span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Could not process input document #{input_file.inspect}&quot;</span>
352
- <span class="ruby-keyword kw">end</span>
352
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
353
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">input_text</span> <span class="ruby-comment cmt"># so the user can debug line numbers in stack trace</span>
354
+ <span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Could not process input document #{input_file.inspect}&quot;</span>
355
+ <span class="ruby-keyword kw">end</span>
353
356
  <span class="ruby-keyword kw">end</span></pre>
354
357
  </div>
355
358
  </div>
@@ -359,9 +362,9 @@ specification file.
359
362
  <div class="sectiontitle">Instance Public methods</div>
360
363
 
361
364
  <div class="method">
362
- <div class="title" id="M000055">
365
+ <div class="title" id="M000061">
363
366
 
364
- <a name="M000055"></a><b>to_s</b>()
367
+ <a name="M000061"></a><b>to_s</b>()
365
368
 
366
369
  </div>
367
370
 
@@ -377,13 +380,13 @@ Returns the output of this document.
377
380
 
378
381
  <div class="sourcecode">
379
382
  <p class="source-link">
380
- Source: <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show</a>
383
+ Source: <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show</a>
381
384
 
382
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/document.rb#L224" target="_blank" class="github_url">on GitHub</a>
385
+ | <a href="http://github.com/sunaku/erbook/blob/9c3f6ad5c94f67d3f20e896873dbc7b127036c44/lib/erbook/document.rb#L227" target="_blank" class="github_url">on GitHub</a>
383
386
 
384
387
  </p>
385
- <div id="M000055_source" class="dyn-source">
386
- <pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 224</span>
388
+ <div id="M000061_source" class="dyn-source">
389
+ <pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 227</span>
387
390
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span><span class="ruby-identifier">to_s</span>
388
391
  <span class="ruby-constant">Template</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{@format_file}:output&quot;</span>, <span class="ruby-ivar">@format</span>[<span class="ruby-value str">'output'</span>].<span class="ruby-identifier">to_s</span>).
389
392
  <span class="ruby-identifier">render_with</span>(<span class="ruby-ivar">@template_vars</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">:@content</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@processed_document</span>.<span class="ruby-identifier">join</span>))
@@ -49,7 +49,7 @@
49
49
  <dd>
50
50
  <ul>
51
51
 
52
- <li><a href="#M000056">to_s</a></li>
52
+ <li><a href="#M000062">to_s</a></li>
53
53
 
54
54
  </ul>
55
55
  </dd>
@@ -71,9 +71,9 @@
71
71
  <div class="sectiontitle">Instance Public methods</div>
72
72
 
73
73
  <div class="method">
74
- <div class="title" id="M000056">
74
+ <div class="title" id="M000062">
75
75
 
76
- <a name="M000056"></a><b>to_s</b>()
76
+ <a name="M000062"></a><b>to_s</b>()
77
77
 
78
78
  </div>
79
79
 
@@ -89,13 +89,13 @@ Returns the output of this node.
89
89
 
90
90
  <div class="sourcecode">
91
91
  <p class="source-link">
92
- Source: <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show</a>
92
+ Source: <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show</a>
93
93
 
94
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/document.rb#L236" target="_blank" class="github_url">on GitHub</a>
94
+ | <a href="http://github.com/sunaku/erbook/blob/9c3f6ad5c94f67d3f20e896873dbc7b127036c44/lib/erbook/document.rb#L241" target="_blank" class="github_url">on GitHub</a>
95
95
 
96
96
  </p>
97
- <div id="M000056_source" class="dyn-source">
98
- <pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 236</span>
97
+ <div id="M000062_source" class="dyn-source">
98
+ <pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 241</span>
99
99
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
100
100
  <span class="ruby-identifier">defn</span>[<span class="ruby-value str">'silent'</span>] <span class="ruby-operator">?</span> <span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">output</span>
101
101
  <span class="ruby-keyword kw">end</span></pre>
@@ -58,7 +58,7 @@ sandboxing for isolated template rendering.
58
58
  <dd>
59
59
  <ul>
60
60
 
61
- <li><a href="#M000034">buffer</a></li>
61
+ <li><a href="#M000042">buffer</a></li>
62
62
 
63
63
  </ul>
64
64
  </dd>
@@ -67,7 +67,7 @@ sandboxing for isolated template rendering.
67
67
  <dd>
68
68
  <ul>
69
69
 
70
- <li><a href="#M000032">new</a></li>
70
+ <li><a href="#M000038">new</a></li>
71
71
 
72
72
  </ul>
73
73
  </dd>
@@ -76,9 +76,9 @@ sandboxing for isolated template rendering.
76
76
  <dd>
77
77
  <ul>
78
78
 
79
- <li><a href="#M000033">render</a>,</li>
79
+ <li><a href="#M000041">render</a>,</li>
80
80
 
81
- <li><a href="#M000035">render_with</a></li>
81
+ <li><a href="#M000043">render_with</a></li>
82
82
 
83
83
  </ul>
84
84
  </dd>
@@ -120,9 +120,9 @@ sandboxing for isolated template rendering.
120
120
  <div class="sectiontitle">Class Public methods</div>
121
121
 
122
122
  <div class="method">
123
- <div class="title" id="M000032">
123
+ <div class="title" id="M000038">
124
124
 
125
- <a name="M000032"></a><b>new</b>(source, input, unindent = true, safe_level = nil)
125
+ <a name="M000038"></a><b>new</b>(source, input, unindent = true, safe_level = nil)
126
126
 
127
127
  </div>
128
128
 
@@ -151,12 +151,12 @@ traces; so that the user can better determine the source of an error.
151
151
 
152
152
  <div class="sourcecode">
153
153
  <p class="source-link">
154
- Source: <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show</a>
154
+ Source: <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show</a>
155
155
 
156
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L33" target="_blank" class="github_url">on GitHub</a>
156
+ | <a href="http://github.com/sunaku/erbook/blob/2b6f0dba66f674e479ef2cdeb7530389bf2af169/lib/erbook/template.rb#L33" target="_blank" class="github_url">on GitHub</a>
157
157
 
158
158
  </p>
159
- <div id="M000032_source" class="dyn-source">
159
+ <div id="M000038_source" class="dyn-source">
160
160
  <pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 33</span>
161
161
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">source</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">unindent</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">safe_level</span> = <span class="ruby-keyword kw">nil</span>
162
162
  <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">input</span>,
@@ -184,9 +184,9 @@ traces; so that the user can better determine the source of an error.
184
184
  <div class="sectiontitle">Instance Public methods</div>
185
185
 
186
186
  <div class="method">
187
- <div class="title" id="M000034">
187
+ <div class="title" id="M000042">
188
188
 
189
- <a name="M000034"></a><b>buffer</b>()
189
+ <a name="M000042"></a><b>buffer</b>()
190
190
 
191
191
  </div>
192
192
 
@@ -202,12 +202,12 @@ Returns the result of template evaluation thus far.
202
202
 
203
203
  <div class="sourcecode">
204
204
  <p class="source-link">
205
- Source: <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show</a>
205
+ Source: <a href="javascript:toggleSource('M000042_source')" id="l_M000042_source">show</a>
206
206
 
207
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L64" target="_blank" class="github_url">on GitHub</a>
207
+ | <a href="http://github.com/sunaku/erbook/blob/2b6f0dba66f674e479ef2cdeb7530389bf2af169/lib/erbook/template.rb#L64" target="_blank" class="github_url">on GitHub</a>
208
208
 
209
209
  </p>
210
- <div id="M000034_source" class="dyn-source">
210
+ <div id="M000042_source" class="dyn-source">
211
211
  <pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 64</span>
212
212
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">buffer</span>
213
213
  <span class="ruby-ivar">@sandbox</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">:@buffer</span>)
@@ -218,9 +218,9 @@ Returns the result of template evaluation thus far.
218
218
  </div>
219
219
 
220
220
  <div class="method">
221
- <div class="title" id="M000033">
221
+ <div class="title" id="M000041">
222
222
 
223
- <a name="M000033"></a><b>render</b>()
223
+ <a name="M000041"></a><b>render</b>()
224
224
 
225
225
  </div>
226
226
 
@@ -239,12 +239,12 @@ If no context is given, then the sandbox of this template is used.
239
239
 
240
240
  <div class="sourcecode">
241
241
  <p class="source-link">
242
- Source: <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show</a>
242
+ Source: <a href="javascript:toggleSource('M000041_source')" id="l_M000041_source">show</a>
243
243
 
244
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L57" target="_blank" class="github_url">on GitHub</a>
244
+ | <a href="http://github.com/sunaku/erbook/blob/2b6f0dba66f674e479ef2cdeb7530389bf2af169/lib/erbook/template.rb#L57" target="_blank" class="github_url">on GitHub</a>
245
245
 
246
246
  </p>
247
- <div id="M000033_source" class="dyn-source">
247
+ <div id="M000041_source" class="dyn-source">
248
248
  <pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 57</span>
249
249
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
250
250
  <span class="ruby-keyword kw">super</span> <span class="ruby-ivar">@sandbox</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-value str">'binding'</span>)
@@ -255,9 +255,9 @@ If no context is given, then the sandbox of this template is used.
255
255
  </div>
256
256
 
257
257
  <div class="method">
258
- <div class="title" id="M000035">
258
+ <div class="title" id="M000043">
259
259
 
260
- <a name="M000035"></a><b>render_with</b>(inst_vars = {})
260
+ <a name="M000043"></a><b>render_with</b>(inst_vars = {})
261
261
 
262
262
  </div>
263
263
 
@@ -275,12 +275,12 @@ given instance variables, whose names must be prefixed with
275
275
 
276
276
  <div class="sourcecode">
277
277
  <p class="source-link">
278
- Source: <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show</a>
278
+ Source: <a href="javascript:toggleSource('M000043_source')" id="l_M000043_source">show</a>
279
279
 
280
- | <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L72" target="_blank" class="github_url">on GitHub</a>
280
+ | <a href="http://github.com/sunaku/erbook/blob/2b6f0dba66f674e479ef2cdeb7530389bf2af169/lib/erbook/template.rb#L72" target="_blank" class="github_url">on GitHub</a>
281
281
 
282
282
  </p>
283
- <div id="M000035_source" class="dyn-source">
283
+ <div id="M000043_source" class="dyn-source">
284
284
  <pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 72</span>
285
285
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_with</span> <span class="ruby-identifier">inst_vars</span> = {}
286
286
  <span class="ruby-identifier">old_sandbox</span> = <span class="ruby-ivar">@sandbox</span>