erbook 6.1.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/bin/erbook +29 -25
  2. data/doc/HelloWorld.spec +3 -1
  3. data/doc/api/classes/ERBook.html +86 -0
  4. data/doc/api/classes/ERBook/Document.html +399 -0
  5. data/doc/api/classes/ERBook/Document/Node.html +110 -0
  6. data/doc/api/classes/ERBook/Template.html +309 -0
  7. data/doc/api/classes/ERBook/Template/Sandbox.html +134 -0
  8. data/doc/api/classes/RDoc.html +69 -0
  9. data/doc/api/classes/RDoc/AnyMethod.html +249 -0
  10. data/doc/api/classes/RDoc/DummyMarkup.html +60 -0
  11. data/doc/api/classes/RDoc/DummyMixin.html +54 -0
  12. data/doc/api/classes/RDoc/DummyOptions.html +60 -0
  13. data/doc/api/classes/RDoc/TopLevel.html +344 -0
  14. data/doc/api/classes/String.html +212 -0
  15. data/doc/api/created.rid +1 -0
  16. data/doc/api/css/main.css +263 -0
  17. data/doc/api/css/panel.css +383 -0
  18. data/doc/api/css/reset.css +53 -0
  19. data/doc/api/files/ANN_eml.html +276 -0
  20. data/doc/api/files/ANN_html.html +407 -0
  21. data/doc/api/files/ANN_txt.html +271 -0
  22. data/doc/api/files/LICENSE.html +76 -0
  23. data/doc/api/files/lib/erbook/document_rb.html +74 -0
  24. data/doc/api/files/lib/erbook/rdoc_rb.html +77 -0
  25. data/doc/api/files/lib/erbook/template_rb.html +66 -0
  26. data/doc/api/files/lib/erbook/to_xhtml_rb.html +89 -0
  27. data/doc/api/files/lib/erbook_rb.html +70 -0
  28. data/doc/api/i/arrows.png +0 -0
  29. data/doc/api/i/results_bg.png +0 -0
  30. data/doc/api/i/tree_bg.png +0 -0
  31. data/doc/api/index.html +14 -18
  32. data/doc/api/js/jquery-1.3.2.min.js +19 -0
  33. data/doc/api/js/jquery-effect.js +593 -0
  34. data/doc/api/js/main.js +22 -0
  35. data/doc/api/js/searchdoc.js +605 -0
  36. data/doc/api/panel/index.html +63 -0
  37. data/doc/api/panel/search_index.js +1 -0
  38. data/doc/api/panel/tree.js +1 -0
  39. data/doc/formats.erb +63 -115
  40. data/doc/history.erb +125 -92
  41. data/doc/index.erb +12 -7
  42. data/doc/index.xhtml +1020 -1347
  43. data/doc/intro.erb +42 -40
  44. data/doc/setup.erb +18 -18
  45. data/doc/theory.erb +24 -31
  46. data/doc/usage.erb +14 -24
  47. data/fmt/xhtml.icons/index.yaml +16 -14
  48. data/fmt/xhtml.icons/rakefile +33 -0
  49. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/16x16/places/start-here.png +0 -0
  50. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-down.png +0 -0
  51. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-up.png +0 -0
  52. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/places/start-here.png +0 -0
  53. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/status/software-update-available.png +0 -0
  54. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/apps/accessories-text-editor.png +0 -0
  55. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/apps/internet-group-chat.png +0 -0
  56. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/emblems/emblem-important.png +0 -0
  57. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-error.png +0 -0
  58. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-information.png +0 -0
  59. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-warning.png +0 -0
  60. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/COPYING +1 -0
  61. data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/README +0 -0
  62. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/bookmark-new.svg +672 -0
  63. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-down.svg +200 -0
  64. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-home.svg +445 -0
  65. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-up.svg +196 -0
  66. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/view-refresh.svg +393 -0
  67. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/accessories-text-editor.svg +554 -0
  68. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/internet-group-chat.svg +312 -0
  69. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-favorite.svg +242 -0
  70. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-important.svg +164 -0
  71. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/mimetypes/application-certificate.svg +443 -0
  72. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/places/start-here.svg +492 -0
  73. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-error.svg +330 -0
  74. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg +1159 -0
  75. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-warning.svg +373 -0
  76. data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/software-update-available.svg +209 -0
  77. data/fmt/xhtml.scripts/jquery-1.3.2.min.js +19 -0
  78. data/fmt/xhtml.scripts/jquery.localscroll-1.2.7-min.js +9 -0
  79. data/fmt/xhtml.scripts/jquery.scrollTo-1.4.1-min.js +11 -0
  80. data/fmt/xhtml.yaml +470 -454
  81. data/lang/de.yaml +5 -5
  82. data/lang/el.yaml +4 -4
  83. data/lang/es.yaml +5 -5
  84. data/lang/fr.yaml +5 -5
  85. data/lang/it.yaml +5 -5
  86. data/lang/ja.yaml +4 -4
  87. data/lang/ko.yaml +4 -4
  88. data/lang/nl.yaml +4 -4
  89. data/lang/phrases.yaml +4 -4
  90. data/lang/pt.yaml +5 -5
  91. data/lang/ru.yaml +5 -5
  92. data/lang/zh.yaml +5 -5
  93. data/lang/zt.yaml +5 -5
  94. data/lib/erbook.rb +12 -5
  95. data/lib/erbook/document.rb +127 -107
  96. data/lib/erbook/rdoc.rb +18 -11
  97. data/lib/erbook/template.rb +86 -176
  98. data/lib/erbook/to_xhtml.rb +98 -25
  99. data/{Rakefile → rakefile} +1 -0
  100. metadata +106 -53
  101. data/doc/api/ERBook.html +0 -35
  102. data/doc/api/ERBook/Document.html +0 -669
  103. data/doc/api/ERBook/Document/Node.html +0 -102
  104. data/doc/api/ERBook/Template.html +0 -670
  105. data/doc/api/RDoc.html +0 -23
  106. data/doc/api/RDoc/AnyMethod.html +0 -302
  107. data/doc/api/RDoc/DummyMarkup.html +0 -73
  108. data/doc/api/RDoc/DummyMixin.html +0 -23
  109. data/doc/api/RDoc/DummyOptions.html +0 -140
  110. data/doc/api/RDoc/TopLevel.html +0 -465
  111. data/doc/api/String.html +0 -372
  112. data/doc/api/all-methods.html +0 -253
  113. data/doc/api/all-namespaces.html +0 -42
  114. data/doc/api/app.js +0 -18
  115. data/doc/api/jquery.js +0 -11
  116. data/doc/api/readme.html +0 -38
  117. data/doc/api/style.css +0 -68
  118. data/doc/api/syntax_highlight.css +0 -21
  119. data/fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/README +0 -2
  120. data/fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/apps/internet-group-chat.png +0 -0
  121. data/fmt/xhtml.icons/tango-icon-theme-0.8.1/COPYING +0 -67
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ gem 'inochi', '~> 1'
2
3
  require 'inochi'
3
4
 
4
5
  Inochi.rake :ERBook,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suraj N. Kurapati
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-14 00:00:00 -08:00
12
+ date: 2009-05-04 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: inochi
16
+ name: ember
17
17
  type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
@@ -32,6 +32,16 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: "0.5"
34
34
  version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rainpress
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: "1"
44
+ version:
35
45
  - !ruby/object:Gem::Dependency
36
46
  name: coderay
37
47
  type: :runtime
@@ -40,7 +50,27 @@ dependencies:
40
50
  requirements:
41
51
  - - ">="
42
52
  - !ruby/object:Gem::Version
43
- version: "0.7"
53
+ version: "0.8"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: inochi
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: "1"
64
+ version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: inochi
67
+ type: :runtime
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ~>
72
+ - !ruby/object:Gem::Version
73
+ version: "1"
44
74
  version:
45
75
  description: Extensible document processor based on eRuby
46
76
  email: sunaku@gmail.com
@@ -51,34 +81,47 @@ extensions: []
51
81
  extra_rdoc_files: []
52
82
 
53
83
  files:
54
- - fmt
84
+ - fmt/xhtml.scripts/jquery.scrollTo-1.4.1-min.js
85
+ - fmt/xhtml.scripts/jquery-1.3.2.min.js
86
+ - fmt/xhtml.scripts/jquery.localscroll-1.2.7-min.js
55
87
  - fmt/latex.yaml
56
88
  - fmt/man.yaml
57
- - fmt/xhtml.icons
58
- - fmt/xhtml.icons/mediawiki-1.13.2
59
- - fmt/xhtml.icons/mediawiki-1.13.2/skins
60
- - fmt/xhtml.icons/mediawiki-1.13.2/skins/simple
61
89
  - fmt/xhtml.icons/mediawiki-1.13.2/skins/simple/external.png
62
90
  - fmt/xhtml.icons/mediawiki-1.13.2/COPYING
63
91
  - fmt/xhtml.icons/mediawiki-1.13.2/README
64
- - fmt/xhtml.icons/tango-icon-theme-0.8.1
65
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/COPYING
66
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48
67
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/status
68
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/status/dialog-information.png
69
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/status/dialog-warning.png
70
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/status/dialog-error.png
71
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/emblems
72
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/emblems/emblem-important.png
73
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/apps
74
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/apps/accessories-text-editor.png
75
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/apps/internet-group-chat.png
76
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/README
77
- - fmt/xhtml.icons/tango-icon-theme-0.8.1/README
92
+ - fmt/xhtml.icons/rakefile
93
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg
94
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-error.svg
95
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/software-update-available.svg
96
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-warning.svg
97
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/places/start-here.svg
98
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/mimetypes/application-certificate.svg
99
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/bookmark-new.svg
100
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/view-refresh.svg
101
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-home.svg
102
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-up.svg
103
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-down.svg
104
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-favorite.svg
105
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-important.svg
106
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/internet-group-chat.svg
107
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/accessories-text-editor.svg
108
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/COPYING
109
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/status/dialog-information.png
110
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/status/dialog-warning.png
111
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/status/dialog-error.png
112
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/emblems/emblem-important.png
113
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/apps/accessories-text-editor.png
114
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/apps/internet-group-chat.png
115
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/status/software-update-available.png
116
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/places/start-here.png
117
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-down.png
118
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-up.png
119
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/16x16/places/start-here.png
120
+ - fmt/xhtml.icons/tango-icon-theme-0.8.90/README
78
121
  - fmt/xhtml.icons/index.yaml
79
122
  - fmt/xhtml.yaml
80
123
  - fmt/text.yaml
81
- - lang
124
+ - rakefile
82
125
  - lang/ru.yaml
83
126
  - lang/it.yaml
84
127
  - lang/ja.yaml
@@ -92,18 +135,13 @@ files:
92
135
  - lang/de.yaml
93
136
  - lang/nl.yaml
94
137
  - lang/phrases.yaml
95
- - lib
96
- - lib/erbook
97
138
  - lib/erbook/template.rb
98
139
  - lib/erbook/to_xhtml.rb
99
140
  - lib/erbook/document.rb
100
141
  - lib/erbook/rdoc.rb
101
142
  - lib/erbook.rb
102
- - Rakefile
103
- - bin
104
143
  - bin/erbook
105
144
  - LICENSE
106
- - doc
107
145
  - doc/intro.erb
108
146
  - doc/setup.erb
109
147
  - doc/erbook.svg
@@ -112,29 +150,42 @@ files:
112
150
  - doc/HelloWorld.spec
113
151
  - doc/theory.erb
114
152
  - doc/index.xhtml
115
- - doc/api
116
- - doc/api/ERBook
117
- - doc/api/ERBook/Document.html
118
- - doc/api/ERBook/Document
119
- - doc/api/ERBook/Document/Node.html
120
- - doc/api/ERBook/Template.html
121
- - doc/api/syntax_highlight.css
122
- - doc/api/style.css
123
- - doc/api/RDoc.html
124
- - doc/api/jquery.js
125
- - doc/api/all-methods.html
126
- - doc/api/app.js
127
- - doc/api/String.html
128
- - doc/api/readme.html
129
- - doc/api/all-namespaces.html
153
+ - doc/api/classes/ERBook/Template/Sandbox.html
154
+ - doc/api/classes/ERBook/Document.html
155
+ - doc/api/classes/ERBook/Document/Node.html
156
+ - doc/api/classes/ERBook/Template.html
157
+ - doc/api/classes/RDoc.html
158
+ - doc/api/classes/String.html
159
+ - doc/api/classes/ERBook.html
160
+ - doc/api/classes/RDoc/TopLevel.html
161
+ - doc/api/classes/RDoc/DummyMarkup.html
162
+ - doc/api/classes/RDoc/DummyOptions.html
163
+ - doc/api/classes/RDoc/DummyMixin.html
164
+ - doc/api/classes/RDoc/AnyMethod.html
165
+ - doc/api/panel/search_index.js
166
+ - doc/api/panel/tree.js
167
+ - doc/api/panel/index.html
168
+ - doc/api/js/searchdoc.js
169
+ - doc/api/js/jquery-effect.js
170
+ - doc/api/js/jquery-1.3.2.min.js
171
+ - doc/api/js/main.js
172
+ - doc/api/files/LICENSE.html
173
+ - doc/api/files/ANN_html.html
174
+ - doc/api/files/lib/erbook_rb.html
175
+ - doc/api/files/lib/erbook/rdoc_rb.html
176
+ - doc/api/files/lib/erbook/template_rb.html
177
+ - doc/api/files/lib/erbook/to_xhtml_rb.html
178
+ - doc/api/files/lib/erbook/document_rb.html
179
+ - doc/api/files/ANN_eml.html
180
+ - doc/api/files/ANN_txt.html
181
+ - doc/api/css/main.css
182
+ - doc/api/css/reset.css
183
+ - doc/api/css/panel.css
184
+ - doc/api/i/arrows.png
185
+ - doc/api/i/tree_bg.png
186
+ - doc/api/i/results_bg.png
187
+ - doc/api/created.rid
130
188
  - doc/api/index.html
131
- - doc/api/ERBook.html
132
- - doc/api/RDoc
133
- - doc/api/RDoc/TopLevel.html
134
- - doc/api/RDoc/DummyMarkup.html
135
- - doc/api/RDoc/DummyOptions.html
136
- - doc/api/RDoc/DummyMixin.html
137
- - doc/api/RDoc/AnyMethod.html
138
189
  - doc/usage.erb
139
190
  - doc/history.erb
140
191
  - doc/index.erb
@@ -142,6 +193,8 @@ files:
142
193
  - doc/formats.erb
143
194
  has_rdoc: true
144
195
  homepage: http://snk.tuxfamily.org/lib/erbook/
196
+ licenses: []
197
+
145
198
  post_install_message:
146
199
  rdoc_options: []
147
200
 
@@ -162,9 +215,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
215
  requirements: []
163
216
 
164
217
  rubyforge_project: sunaku
165
- rubygems_version: 1.3.1
218
+ rubygems_version: 1.3.2
166
219
  signing_key:
167
- specification_version: 2
220
+ specification_version: 3
168
221
  summary: Extensible document processor based on eRuby
169
222
  test_files: []
170
223
 
data/doc/api/ERBook.html DELETED
@@ -1,35 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html>
4
- <head>
5
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
- <link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
7
- <link rel="stylesheet" href="syntax_highlight.css" type="text/css" charset="utf-8" />
8
-
9
- <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
10
- <script src="app.js" type="text/javascript" charset="utf-8"></script>
11
- <title>Module: ERBook</title>
12
- </head>
13
- <body>
14
- <div id="content">
15
- <div class="section module ERBook">
16
- <h1 class="title">Module: ERBook</h1>
17
- <div class="section constants">
18
- <div class="thisclass">
19
- <h1>Constants</h1>
20
- <dl>
21
-
22
- <dt id="FORMAT_FILES-constant">FORMAT_FILES</dt>
23
- <dd>Dir[File.join(FORMATS_DIR, '*.yaml')]</dd>
24
-
25
- <dt id="FORMATS_DIR-constant">FORMATS_DIR</dt>
26
- <dd>File.join(INSTALL, 'fmt')</dd>
27
-
28
- </dl>
29
- </div>
30
-
31
- </div>
32
- </div>
33
- </div>
34
- </body>
35
- </html>
@@ -1,669 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
- <html>
4
- <head>
5
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
- <link rel="stylesheet" href="../style.css" type="text/css" charset="utf-8" />
7
- <link rel="stylesheet" href="../syntax_highlight.css" type="text/css" charset="utf-8" />
8
-
9
- <script src="../jquery.js" type="text/javascript" charset="utf-8"></script>
10
- <script src="../app.js" type="text/javascript" charset="utf-8"></script>
11
- <title>Class: ERBook::Document</title>
12
- </head>
13
- <body>
14
- <div id="content">
15
- <div class="section class ERBook_Document">
16
- <h1 class="title">Class: ERBook::Document</h1>
17
- <div class="section attributes">
18
- <h1>Attributes</h1>
19
-
20
-
21
- <div class="instance">
22
- <h2>Instance Attributes</h2>
23
- <table>
24
-
25
- <tr>
26
- <th class="name">format</td>
27
- <td class="readwrite">
28
- [<span id='format-instance_method'>R</span>W]
29
- </td>
30
- <td class="visibility">
31
- public
32
- </td>
33
- <td class="docstring">
34
- <p>
35
- Data from the format specification file.
36
- </p>
37
-
38
-
39
- </td>
40
- </tr>
41
-
42
- <tr>
43
- <th class="name">nodes_by_type</td>
44
- <td class="readwrite">
45
- [<span id='nodes_by_type-instance_method'>R</span>W]
46
- </td>
47
- <td class="visibility">
48
- public
49
- </td>
50
- <td class="docstring">
51
- <p>
52
- All nodes in the document arranged by node type.
53
- </p>
54
-
55
-
56
- </td>
57
- </tr>
58
-
59
- <tr>
60
- <th class="name">nodes</td>
61
- <td class="readwrite">
62
- [<span id='nodes-instance_method'>R</span>W]
63
- </td>
64
- <td class="visibility">
65
- public
66
- </td>
67
- <td class="docstring">
68
- <p>
69
- All nodes in the document.
70
- </p>
71
-
72
-
73
- </td>
74
- </tr>
75
-
76
- <tr>
77
- <th class="name">roots</td>
78
- <td class="readwrite">
79
- [<span id='roots-instance_method'>R</span>W]
80
- </td>
81
- <td class="visibility">
82
- public
83
- </td>
84
- <td class="docstring">
85
- <p>
86
- All root nodes in the document.
87
- </p>
88
-
89
-
90
- </td>
91
- </tr>
92
-
93
- </table>
94
- </div>
95
-
96
- </div><div class="section constants">
97
-
98
- </div><div class="section constructor">
99
- <h1>Constructor Summary</h1>
100
- <div id="initialize-instance_method" class="section method">
101
- <div class="details_title">
102
- <div class='section methodsignature'>
103
- <tt class='def'>
104
- <span class='visibility'>public</span>
105
- <span class='return_types'></span>
106
- <span class='name'>initialize</span><span class='args'>(format, input_text, input_file, options = )</span>
107
- <span class='block'></span>
108
- </tt>
109
- </div>
110
-
111
- </div><div class="section tags">
112
- <h2>Meta Tags</h2>
113
- <div class="param">
114
- <h3>Parameters:</h3>
115
- <dl>
116
-
117
-
118
- <dt>
119
- <span class='type'>[<tt><a title="String" href="../String.html">String</a></tt>]</span>
120
- <span class='name'>format</span>
121
-
122
- </dt>
123
- <dd>
124
- <span class='desc'><p>
125
- Either the short-hand name of a built-in format or the path to a format
126
- specification file.
127
- </p>
128
- </span>
129
- </dd>
130
-
131
-
132
-
133
- <dt>
134
- <span class='type'>[<tt><a title="String" href="../String.html">String</a></tt>]</span>
135
- <span class='name'>input_text</span>
136
-
137
- </dt>
138
- <dd>
139
- <span class='desc'><p>
140
- The body of the input document.
141
- </p>
142
- </span>
143
- </dd>
144
-
145
-
146
-
147
- <dt>
148
- <span class='type'>[<tt><a title="String" href="../String.html">String</a></tt>]</span>
149
- <span class='name'>input_file</span>
150
-
151
- </dt>
152
- <dd>
153
- <span class='desc'><p>
154
- Name of the file from which the input document originated.
155
- </p>
156
- </span>
157
- </dd>
158
-
159
-
160
-
161
- <dt>
162
- <span class='type'>[<tt>Hash</tt>]</span>
163
- <span class='name'>options</span>
164
-
165
- <em class="default">(defaults to: <tt></tt>)</em>
166
-
167
- </dt>
168
- <dd>
169
- <span class='desc'><p>
170
- Additional method parameters:
171
- </p>
172
- <dl>
173
- <dt>boolean</dt><dd>:unindent =&gt; If true, all node content is unindented hierarchically.
174
-
175
- </dd>
176
- </dl>
177
- </span>
178
- </dd>
179
-
180
-
181
- </dl>
182
- </div>
183
- </div><div class="section source">
184
- <span>[<a class="source_link" href="#">View source</a>]</span>
185
- <div class="source_code">
186
- <table>
187
- <tr>
188
- <td>
189
- <pre class="lines">
190
-
191
-
192
- 35
193
- 36
194
- 37
195
- 38
196
- 39
197
- 40
198
- 41
199
- 42
200
- 43
201
- 44
202
- 45
203
- 46
204
- 47
205
- 48
206
- 49
207
- 50
208
- 51
209
- 52
210
- 53
211
- 54
212
- 55
213
- 56
214
- 57
215
- 58
216
- 59
217
- 60
218
- 61
219
- 62
220
- 63
221
- 64
222
- 65
223
- 66
224
- 67
225
- 68
226
- 69
227
- 70
228
- 71
229
- 72
230
- 73
231
- 74
232
- 75
233
- 76
234
- 77
235
- 78
236
- 79
237
- 80
238
- 81
239
- 82
240
- 83
241
- 84
242
- 85
243
- 86
244
- 87
245
- 88
246
- 89
247
- 90
248
- 91
249
- 92
250
- 93
251
- 94
252
- 95
253
- 96
254
- 97
255
- 98
256
- 99
257
- 100
258
- 101
259
- 102
260
- 103
261
- 104
262
- 105
263
- 106
264
- 107
265
- 108
266
- 109
267
- 110
268
- 111
269
- 112
270
- 113
271
- 114
272
- 115
273
- 116
274
- 117
275
- 118
276
- 119
277
- 120
278
- 121
279
- 122
280
- 123
281
- 124
282
- 125
283
- 126
284
- 127
285
- 128
286
- 129
287
- 130
288
- 131
289
- 132
290
- 133
291
- 134
292
- 135
293
- 136
294
- 137
295
- 138
296
- 139
297
- 140
298
- 141
299
- 142
300
- 143
301
- 144
302
- 145
303
- 146
304
- 147
305
- 148
306
- 149
307
- 150
308
- 151
309
- 152
310
- 153
311
- 154
312
- 155
313
- 156
314
- 157
315
- 158
316
- 159
317
- 160
318
- 161
319
- 162
320
- 163
321
- 164
322
- 165
323
- 166
324
- 167
325
- 168
326
- 169
327
- 170
328
- 171
329
- 172
330
- 173
331
- 174
332
- 175
333
- 176
334
- 177
335
- 178
336
- 179
337
- 180
338
- 181
339
- 182
340
- 183
341
- 184
342
- 185
343
- 186</pre>
344
- </td>
345
- <td>
346
- <pre class="code"><span class="info file"># File 'lib/erbook/document.rb', line 35</span>
347
-
348
- <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span> <span class='format identifier id'>format</span><span class='comma token'>,</span> <span class='input_text identifier id'>input_text</span><span class='comma token'>,</span> <span class='input_file identifier id'>input_file</span><span class='comma token'>,</span> <span class='options identifier id'>options</span> <span class='assign token'>=</span> <span class='semicolon token'>;</span><span class='lbrace token'>{</span><span class='rbrace token'>}</span>
349
- <span class='comment val'># process format specification</span>
350
- <span class='@format_file ivar id'>@format_file</span> <span class='assign token'>=</span> <span class='format identifier id'>format</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
351
-
352
- <span class='File constant id'>File</span><span class='dot token'>.</span><span class='file? fid id'>file?</span> <span class='@format_file ivar id'>@format_file</span> <span class='or or kw'>or</span>
353
- <span class='@format_file ivar id'>@format_file</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='ERBook constant id'>ERBook</span><span class='colon2 op'>::</span><span class='FORMATS_DIR constant id'>FORMATS_DIR</span><span class='comma token'>,</span> <span class='@format_file ivar id'>@format_file</span> <span class='plus op'>+</span> <span class='string val'>'.yaml'</span><span class='rparen token'>)</span>
354
-
355
- <span class='begin begin kw'>begin</span>
356
- <span class='@format ivar id'>@format</span> <span class='assign token'>=</span> <span class='YAML constant id'>YAML</span><span class='dot token'>.</span><span class='load_file identifier id'>load_file</span><span class='lparen token'>(</span><span class='@format_file ivar id'>@format_file</span><span class='rparen token'>)</span>
357
- <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='symbol val'>:file</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='expand_path identifier id'>expand_path</span><span class='lparen token'>(</span><span class='@format_file ivar id'>@format_file</span><span class='rparen token'>)</span>
358
- <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='symbol val'>:name</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='File constant id'>File</span><span class='dot token'>.</span><span class='basename identifier id'>basename</span><span class='lparen token'>(</span><span class='@format_file ivar id'>@format_file</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='sub identifier id'>sub</span><span class='lparen token'>(</span><span class='regexp val'>/\..*?$/</span><span class='comma token'>,</span> <span class='string val'>''</span><span class='rparen token'>)</span>
359
-
360
- <span class='if if kw'>if</span> <span class='@format ivar id'>@format</span><span class='dot token'>.</span><span class='key? fid id'>key?</span> <span class='string val'>'code'</span>
361
- <span class='eval identifier id'>eval</span> <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='string val'>'code'</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='comma token'>,</span> <span class='TOPLEVEL_BINDING constant id'>TOPLEVEL_BINDING</span><span class='comma token'>,</span> <span class='dstring node'>&quot;#{@format_file}:code&quot;</span>
362
- <span class='end end kw'>end</span>
363
-
364
- <span class='rescue rescue kw'>rescue</span> <span class='Exception constant id'>Exception</span>
365
- <span class='error identifier id'>error</span> <span class='dstring node'>&quot;Could not load format specification file #{@format_file.inspect}&quot;</span>
366
- <span class='end end kw'>end</span>
367
-
368
- <span class='@node_defs ivar id'>@node_defs</span> <span class='assign token'>=</span> <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='string val'>'nodes'</span><span class='rbrack token'>]</span>
369
-
370
- <span class='comment val'># process input document</span>
371
- <span class='begin begin kw'>begin</span>
372
- <span class='comment val'># create sandbox for input evaluation</span>
373
- <span class='template identifier id'>template</span> <span class='assign token'>=</span> <span class='Template constant id'>Template</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='input_file identifier id'>input_file</span><span class='comma token'>,</span> <span class='input_text identifier id'>input_text</span><span class='comma token'>,</span> <span class='options identifier id'>options</span><span class='lbrack token'>[</span><span class='symbol val'>:unindent</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
374
-
375
- <span class='@template_vars ivar id'>@template_vars</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span>
376
- <span class='symbol val'>:@format</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@format ivar id'>@format</span><span class='comma token'>,</span>
377
- <span class='symbol val'>:@roots</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@roots ivar id'>@roots</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='comment val'># root nodes of all trees</span>
378
- <span class='symbol val'>:@nodes</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@nodes ivar id'>@nodes</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='comment val'># all nodes in the forest</span>
379
- <span class='symbol val'>:@nodes_by_type</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@nodes_by_type ivar id'>@nodes_by_type</span> <span class='assign token'>=</span> <span class='Hash constant id'>Hash</span><span class='dot token'>.</span><span class='new identifier id'>new</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='h identifier id'>h</span><span class='comma token'>,</span><span class='k identifier id'>k</span><span class='bitor op'>|</span> <span class='h identifier id'>h</span><span class='lbrack token'>[</span><span class='k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span><span class='comma token'>,</span>
380
- <span class='symbol val'>:@stack</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='comment val'># stack for all nodes</span>
381
- <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='each_pair identifier id'>each_pair</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='k identifier id'>k</span><span class='comma token'>,</span><span class='v identifier id'>v</span><span class='bitor op'>|</span> <span class='template identifier id'>template</span><span class='dot token'>.</span><span class='instance_variable_set identifier id'>instance_variable_set</span><span class='lparen token'>(</span><span class='k identifier id'>k</span><span class='comma token'>,</span> <span class='v identifier id'>v</span><span class='rparen token'>)</span> <span class='rbrace token'>}</span>
382
-
383
- <span class='class class kw'>class</span> <span class='lshft op'>&lt;&lt;</span> <span class='template identifier id'>template</span>
384
- <span class='private identifier id'>private</span>
385
-
386
- <span class='comment val'># Handles the method call from a node</span>
387
- <span class='comment val'># placeholder in the input document.</span>
388
- <span class='def def kw'>def</span> <span class='__node__ identifier id'>__node__</span> <span class='node_type identifier id'>node_type</span><span class='comma token'>,</span> <span class='mult op'>*</span><span class='node_args identifier id'>node_args</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='node_content identifier id'>node_content</span>
389
- <span class='node identifier id'>node</span> <span class='assign token'>=</span> <span class='Node constant id'>Node</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span>
390
- <span class='symbol val'>:type</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='node_type identifier id'>node_type</span><span class='comma token'>,</span>
391
- <span class='symbol val'>:defn</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='string val'>'nodes'</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='node_type identifier id'>node_type</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
392
- <span class='symbol val'>:args</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='node_args identifier id'>node_args</span><span class='comma token'>,</span>
393
- <span class='symbol val'>:children</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='comma token'>,</span>
394
-
395
- <span class='comment val'># omit erbook internals from the stack trace</span>
396
- <span class='symbol val'>:trace</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='caller identifier id'>caller</span><span class='dot token'>.</span><span class='reject identifier id'>reject</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='t identifier id'>t</span><span class='bitor op'>|</span>
397
- <span class='lbrack token'>[</span><span class='$0 gvar id'>$0</span><span class='comma token'>,</span> <span class='ERBook constant id'>ERBook</span><span class='colon2 op'>::</span><span class='INSTALL constant id'>INSTALL</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='any? fid id'>any?</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='f identifier id'>f</span><span class='bitor op'>|</span> <span class='t identifier id'>t</span><span class='dot token'>.</span><span class='index identifier id'>index</span><span class='lparen token'>(</span><span class='f identifier id'>f</span><span class='rparen token'>)</span> <span class='eq op'>==</span> <span class='integer val'>0</span> <span class='rbrace token'>}</span>
398
- <span class='rbrace token'>}</span>
399
- <span class='rparen token'>)</span>
400
- <span class='@nodes ivar id'>@nodes</span> <span class='lshft op'>&lt;&lt;</span> <span class='node identifier id'>node</span>
401
- <span class='@nodes_by_type ivar id'>@nodes_by_type</span><span class='lbrack token'>[</span><span class='node identifier id'>node</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span> <span class='lshft op'>&lt;&lt;</span> <span class='node identifier id'>node</span>
402
-
403
- <span class='comment val'># calculate occurrence number for this node</span>
404
- <span class='if if kw'>if</span> <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='defn identifier id'>defn</span><span class='lbrack token'>[</span><span class='string val'>'number'</span><span class='rbrack token'>]</span>
405
- <span class='@count ivar id'>@count</span> <span class='opasgn op'>||=</span> <span class='Hash constant id'>Hash</span><span class='dot token'>.</span><span class='new identifier id'>new</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='h identifier id'>h</span><span class='comma token'>,</span><span class='k identifier id'>k</span><span class='bitor op'>|</span> <span class='h identifier id'>h</span><span class='lbrack token'>[</span><span class='k identifier id'>k</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='rbrace token'>}</span>
406
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='number identifier id'>number</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='@count ivar id'>@count</span><span class='lbrack token'>[</span><span class='node identifier id'>node</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span> <span class='lshft op'>&lt;&lt;</span> <span class='node identifier id'>node</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='length identifier id'>length</span>
407
- <span class='end end kw'>end</span>
408
-
409
- <span class='comment val'># assign node family</span>
410
- <span class='if if kw'>if</span> <span class='parent identifier id'>parent</span> <span class='assign token'>=</span> <span class='@stack ivar id'>@stack</span><span class='dot token'>.</span><span class='last identifier id'>last</span>
411
- <span class='parent identifier id'>parent</span><span class='dot token'>.</span><span class='children identifier id'>children</span> <span class='lshft op'>&lt;&lt;</span> <span class='node identifier id'>node</span>
412
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='parent identifier id'>parent</span> <span class='assign token'>=</span> <span class='parent identifier id'>parent</span>
413
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='depth identifier id'>depth</span> <span class='assign token'>=</span> <span class='parent identifier id'>parent</span><span class='dot token'>.</span><span class='depth identifier id'>depth</span>
414
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='depth identifier id'>depth</span> <span class='opasgn op'>+=</span> <span class='integer val'>1</span> <span class='if if_mod kw'>if</span> <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='defn identifier id'>defn</span><span class='lbrack token'>[</span><span class='string val'>'depth'</span><span class='rbrack token'>]</span>
415
-
416
- <span class='comment val'># calculate latex-style index number for this node</span>
417
- <span class='if if kw'>if</span> <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='defn identifier id'>defn</span><span class='lbrack token'>[</span><span class='string val'>'index'</span><span class='rbrack token'>]</span>
418
- <span class='ancestry identifier id'>ancestry</span> <span class='assign token'>=</span> <span class='@stack ivar id'>@stack</span><span class='dot token'>.</span><span class='reverse identifier id'>reverse</span><span class='dot token'>.</span><span class='find identifier id'>find</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='bitor op'>|</span> <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='defn identifier id'>defn</span><span class='lbrack token'>[</span><span class='string val'>'index'</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span><span class='dot token'>.</span><span class='index identifier id'>index</span>
419
- <span class='branches identifier id'>branches</span> <span class='assign token'>=</span> <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='parent identifier id'>parent</span><span class='dot token'>.</span><span class='children identifier id'>children</span><span class='dot token'>.</span><span class='select identifier id'>select</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='bitor op'>|</span> <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='index identifier id'>index</span> <span class='rbrace token'>}</span>
420
-
421
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='index identifier id'>index</span> <span class='assign token'>=</span> <span class='lbrack token'>[</span><span class='ancestry identifier id'>ancestry</span><span class='comma token'>,</span> <span class='branches identifier id'>branches</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='join identifier id'>join</span><span class='lparen token'>(</span><span class='string val'>'.'</span><span class='rparen token'>)</span>
422
- <span class='end end kw'>end</span>
423
- <span class='else else kw'>else</span>
424
- <span class='@roots ivar id'>@roots</span> <span class='lshft op'>&lt;&lt;</span> <span class='node identifier id'>node</span>
425
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='parent identifier id'>parent</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
426
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='depth identifier id'>depth</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
427
-
428
- <span class='comment val'># calculate latex-style index number for this node</span>
429
- <span class='if if kw'>if</span> <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='defn identifier id'>defn</span><span class='lbrack token'>[</span><span class='string val'>'index'</span><span class='rbrack token'>]</span>
430
- <span class='branches identifier id'>branches</span> <span class='assign token'>=</span> <span class='@roots ivar id'>@roots</span><span class='dot token'>.</span><span class='select identifier id'>select</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='bitor op'>|</span> <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='index identifier id'>index</span> <span class='rbrace token'>}</span>
431
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='index identifier id'>index</span> <span class='assign token'>=</span> <span class='lparen token'>(</span><span class='branches identifier id'>branches</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
432
- <span class='end end kw'>end</span>
433
- <span class='end end kw'>end</span>
434
-
435
- <span class='comment val'># assign node content</span>
436
- <span class='if if kw'>if</span> <span class='block_given? fid id'>block_given?</span>
437
- <span class='@stack ivar id'>@stack</span><span class='dot token'>.</span><span class='push identifier id'>push</span> <span class='node identifier id'>node</span>
438
- <span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='content_from_block identifier id'>content_from_block</span><span class='lparen token'>(</span><span class='node identifier id'>node</span><span class='comma token'>,</span> <span class='bitand op'>&amp;</span><span class='node_content identifier id'>node_content</span><span class='rparen token'>)</span>
439
- <span class='@stack ivar id'>@stack</span><span class='dot token'>.</span><span class='pop identifier id'>pop</span>
440
-
441
- <span class='digest identifier id'>digest</span> <span class='assign token'>=</span> <span class='Document constant id'>Document</span><span class='dot token'>.</span><span class='digest identifier id'>digest</span><span class='lparen token'>(</span><span class='content identifier id'>content</span><span class='rparen token'>)</span>
442
- <span class='self self kw'>self</span><span class='dot token'>.</span><span class='buffer identifier id'>buffer</span> <span class='lshft op'>&lt;&lt;</span> <span class='digest identifier id'>digest</span>
443
- <span class='else else kw'>else</span>
444
- <span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='nil nil kw'>nil</span>
445
- <span class='digest identifier id'>digest</span> <span class='assign token'>=</span> <span class='Document constant id'>Document</span><span class='dot token'>.</span><span class='digest identifier id'>digest</span><span class='lparen token'>(</span><span class='node identifier id'>node</span><span class='dot token'>.</span><span class='object_id identifier id'>object_id</span><span class='rparen token'>)</span>
446
- <span class='end end kw'>end</span>
447
-
448
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='content identifier id'>content</span> <span class='assign token'>=</span> <span class='content identifier id'>content</span>
449
- <span class='node identifier id'>node</span><span class='dot token'>.</span><span class='digest identifier id'>digest</span> <span class='assign token'>=</span> <span class='digest identifier id'>digest</span>
450
-
451
- <span class='digest identifier id'>digest</span>
452
- <span class='end end kw'>end</span>
453
- <span class='end end kw'>end</span>
454
-
455
- <span class='@node_defs ivar id'>@node_defs</span><span class='dot token'>.</span><span class='each_key identifier id'>each_key</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='type identifier id'>type</span><span class='bitor op'>|</span>
456
- <span class='comment val'># XXX: using a string because define_method()</span>
457
- <span class='comment val'># does not accept a block until Ruby 1.9</span>
458
- <span class='file identifier id'>file</span><span class='comma token'>,</span> <span class='line identifier id'>line</span> <span class='assign token'>=</span> <span class='__FILE__ __file__ kw'>__FILE__</span><span class='comma token'>,</span> <span class='__LINE__ __line__ kw'>__LINE__</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
459
- <span class='template identifier id'>template</span><span class='dot token'>.</span><span class='instance_eval identifier id'>instance_eval</span> <span class='dstring node'>%{
460
- def #{type} *node_args, &amp;node_content
461
- __node__ #{type.inspect}, *node_args, &amp;node_content
462
- end
463
- }</span><span class='comma token'>,</span> <span class='file identifier id'>file</span><span class='comma token'>,</span> <span class='line identifier id'>line</span>
464
- <span class='end end kw'>end</span>
465
-
466
- <span class='comment val'># evaluate the input &amp; build the document tree</span>
467
- <span class='@processed_document ivar id'>@processed_document</span> <span class='assign token'>=</span> <span class='template identifier id'>template</span><span class='dot token'>.</span><span class='instance_eval identifier id'>instance_eval</span> <span class='lbrace token'>{</span> <span class='result identifier id'>result</span> <span class='binding identifier id'>binding</span> <span class='rbrace token'>}</span>
468
-
469
- <span class='comment val'># chain block-level nodes together for local navigation</span>
470
- <span class='block_nodes identifier id'>block_nodes</span> <span class='assign token'>=</span> <span class='@nodes ivar id'>@nodes</span><span class='dot token'>.</span><span class='reject identifier id'>reject</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='bitor op'>|</span> <span class='@node_defs ivar id'>@node_defs</span><span class='lbrack token'>[</span><span class='n identifier id'>n</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>'inline'</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span>
471
-
472
- <span class='require identifier id'>require</span> <span class='string val'>'enumerator'</span>
473
- <span class='block_nodes identifier id'>block_nodes</span><span class='dot token'>.</span><span class='each_cons identifier id'>each_cons</span><span class='lparen token'>(</span><span class='integer val'>2</span><span class='rparen token'>)</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='a identifier id'>a</span><span class='comma token'>,</span> <span class='b identifier id'>b</span><span class='bitor op'>|</span>
474
- <span class='a identifier id'>a</span><span class='dot token'>.</span><span class='next_node identifier id'>next_node</span> <span class='assign token'>=</span> <span class='b identifier id'>b</span>
475
- <span class='b identifier id'>b</span><span class='dot token'>.</span><span class='prev_node identifier id'>prev_node</span> <span class='assign token'>=</span> <span class='a identifier id'>a</span>
476
- <span class='end end kw'>end</span>
477
-
478
- <span class='comment val'># replace node placeholders with their corresponding output</span>
479
- <span class='expander identifier id'>expander</span> <span class='assign token'>=</span> <span class='lambda identifier id'>lambda</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='comma token'>,</span> <span class='buf identifier id'>buf</span><span class='bitor op'>|</span>
480
- <span class='comment val'># calculate node output</span>
481
- <span class='source identifier id'>source</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;#{@format_file}:nodes:#{n.type}:output&quot;</span>
482
- <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='output identifier id'>output</span> <span class='assign token'>=</span> <span class='Template constant id'>Template</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span>
483
- <span class='source identifier id'>source</span><span class='comma token'>,</span> <span class='@node_defs ivar id'>@node_defs</span><span class='lbrack token'>[</span><span class='n identifier id'>n</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>'output'</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='dot token'>.</span><span class='chomp identifier id'>chomp</span>
484
- <span class='rparen token'>)</span><span class='dot token'>.</span><span class='render_with identifier id'>render_with</span><span class='lparen token'>(</span><span class='@template_vars ivar id'>@template_vars</span><span class='dot token'>.</span><span class='merge identifier id'>merge</span><span class='lparen token'>(</span><span class='symbol val'>:@node</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='n identifier id'>n</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
485
-
486
- <span class='comment val'># expand all child nodes in this node's output</span>
487
- <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='children identifier id'>children</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='c identifier id'>c</span><span class='bitor op'>|</span> <span class='expander identifier id'>expander</span><span class='lbrack token'>[</span><span class='c identifier id'>c</span><span class='comma token'>,</span> <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='output identifier id'>output</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span>
488
-
489
- <span class='comment val'># replace this node's placeholder with its output in the buffer</span>
490
- <span class='buf identifier id'>buf</span><span class='lbrack token'>[</span><span class='n identifier id'>n</span><span class='dot token'>.</span><span class='digest identifier id'>digest</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='@node_defs ivar id'>@node_defs</span><span class='lbrack token'>[</span><span class='n identifier id'>n</span><span class='dot token'>.</span><span class='type identifier id'>type</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>'silent'</span><span class='rbrack token'>]</span> <span class='question op'>?</span> <span class='string val'>''</span> <span class='colon op'>:</span> <span class='n identifier id'>n</span><span class='dot token'>.</span><span class='output identifier id'>output</span>
491
- <span class='end end kw'>end</span>
492
-
493
- <span class='@roots ivar id'>@roots</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='n identifier id'>n</span><span class='bitor op'>|</span> <span class='expander identifier id'>expander</span><span class='lbrack token'>[</span><span class='n identifier id'>n</span><span class='comma token'>,</span> <span class='@processed_document ivar id'>@processed_document</span><span class='rbrack token'>]</span> <span class='rbrace token'>}</span>
494
-
495
- <span class='rescue rescue kw'>rescue</span> <span class='Exception constant id'>Exception</span>
496
- <span class='puts identifier id'>puts</span> <span class='input_text identifier id'>input_text</span> <span class='comment val'># so the user can debug line numbers in the stack trace</span>
497
- <span class='error identifier id'>error</span> <span class='dstring node'>&quot;Could not process input document #{input_file.inspect}&quot;</span>
498
- <span class='end end kw'>end</span>
499
- <span class='end end kw'>end</span>
500
- </pre>
501
- </td>
502
- </tr>
503
- </table>
504
- </div>
505
- </div>
506
- </div>
507
- </div> <div class="section visibilitygroup public">
508
- <h1>Public Visibility</h1>
509
- <div class="section methodsummary class public">
510
- <h1>Public Class Method Summary</h1>
511
- <table class="summary">
512
-
513
- <tr>
514
- <th class="signature">
515
- <span class='name'><a title="digest" href="#digest-class_method">digest</a></span><span class='args'>(input)</span>
516
- <span class='block'></span>
517
-
518
- </th>
519
- <td class="docstring">
520
- <p>
521
- Returns a digest of the given string that will not be altered by
522
- String#to_xhtml.
523
- </p>
524
-
525
-
526
- </td>
527
- </tr>
528
-
529
- </table>
530
- </div>
531
- <div class="section methodsummary instance public">
532
- <h1>Public Instance Method Summary</h1>
533
- <table class="summary">
534
-
535
- <tr>
536
- <th class="signature">
537
- <span class='name'><a title="#to_s" href="#to_s-instance_method">#to_s</a></span><span class='args'></span>
538
- <span class='block'></span>
539
-
540
- </th>
541
- <td class="docstring">
542
- <p>
543
- Returns the output of this document.
544
- </p>
545
-
546
-
547
- </td>
548
- </tr>
549
-
550
- </table>
551
- </div>
552
- <div class="section methoddetails class public">
553
- <h1>Public Class Method Details</h1>
554
-
555
- <div class="method">
556
- <div class="method_header">
557
- <h3>digest</h3>
558
- </div><div id="digest-class_method" class="section method">
559
- <div class="details_title">
560
- <div class='section methodsignature'>
561
- <tt class='def'>
562
- <span class='visibility'>public</span>
563
- <span class='return_types'></span>
564
- <span class='name'>digest</span><span class='args'>(input)</span>
565
- <span class='block'></span>
566
- </tt>
567
- </div>
568
-
569
- </div><div class="section docstring">
570
- <p>
571
- Returns a digest of the given string that will not be altered by
572
- String#to_xhtml.
573
- </p>
574
-
575
- </div><div class="section source">
576
- <span>[<a class="source_link" href="#">View source</a>]</span>
577
- <div class="source_code">
578
- <table>
579
- <tr>
580
- <td>
581
- <pre class="lines">
582
-
583
-
584
- 213
585
- 214
586
- 215
587
- 216
588
- 217
589
- 218
590
- 219</pre>
591
- </td>
592
- <td>
593
- <pre class="code"><span class="info file"># File 'lib/erbook/document.rb', line 213</span>
594
-
595
- <span class='def def kw'>def</span> <span class='Document constant id'>Document</span><span class='dot token'>.</span><span class='digest identifier id'>digest</span> <span class='input identifier id'>input</span>
596
- <span class='Digest constant id'>Digest</span><span class='colon2 op'>::</span><span class='SHA1 constant id'>SHA1</span><span class='dot token'>.</span><span class='hexdigest identifier id'>hexdigest</span><span class='lparen token'>(</span><span class='input identifier id'>input</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='rparen token'>)</span><span class='dot token'>.</span>
597
-
598
- <span class='comment val'># XXX: surround all digits with alphabets so</span>
599
- <span class='comment val'># Maruku doesn't change them into HTML</span>
600
- <span class='gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='regexp val'>/\d/</span><span class='comma token'>,</span> <span class='string val'>'z\&amp;z'</span><span class='rparen token'>)</span>
601
- <span class='end end kw'>end</span>
602
- </pre>
603
- </td>
604
- </tr>
605
- </table>
606
- </div>
607
- </div>
608
- </div>
609
- </div>
610
-
611
- </div><div class="section methoddetails instance public">
612
- <h1>Public Instance Method Details</h1>
613
-
614
- <div class="method">
615
- <div class="method_header">
616
- <h3>to_s</h3>
617
- </div><div id="to_s-instance_method" class="section method">
618
- <div class="details_title">
619
- <div class='section methodsignature'>
620
- <tt class='def'>
621
- <span class='visibility'>public</span>
622
- <span class='return_types'></span>
623
- <span class='name'>to_s</span><span class='args'></span>
624
- <span class='block'></span>
625
- </tt>
626
- </div>
627
-
628
- </div><div class="section docstring">
629
- <p>
630
- Returns the output of this document.
631
- </p>
632
-
633
- </div><div class="section source">
634
- <span>[<a class="source_link" href="#">View source</a>]</span>
635
- <div class="source_code">
636
- <table>
637
- <tr>
638
- <td>
639
- <pre class="lines">
640
-
641
-
642
- 191
643
- 192
644
- 193
645
- 194</pre>
646
- </td>
647
- <td>
648
- <pre class="code"><span class="info file"># File 'lib/erbook/document.rb', line 191</span>
649
-
650
- <span class='def def kw'>def</span> <span class='to_s identifier id'>to_s</span>
651
- <span class='Template constant id'>Template</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='dstring node'>&quot;#{@format_file}:output&quot;</span><span class='comma token'>,</span> <span class='@format ivar id'>@format</span><span class='lbrack token'>[</span><span class='string val'>'output'</span><span class='rbrack token'>]</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span><span class='rparen token'>)</span><span class='dot token'>.</span>
652
- <span class='render_with identifier id'>render_with</span><span class='lparen token'>(</span><span class='@template_vars ivar id'>@template_vars</span><span class='dot token'>.</span><span class='merge identifier id'>merge</span><span class='lparen token'>(</span><span class='symbol val'>:@content</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='@processed_document ivar id'>@processed_document</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
653
- <span class='end end kw'>end</span>
654
- </pre>
655
- </td>
656
- </tr>
657
- </table>
658
- </div>
659
- </div>
660
- </div>
661
- </div>
662
-
663
- </div>
664
- </div>
665
-
666
- </div>
667
- </div>
668
- </body>
669
- </html>