isodoc 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b64ad76ffcf7c9f1ced2c15c41a263e49e62cfa4294d31066ba2e358e613fb35
4
- data.tar.gz: f35ca08d240ae7cdb7ba9aa0c9e071ec284d051f0d61c82542d461e101d0da38
3
+ metadata.gz: d69468979c5c216cf0ecfb59a2422cbea3f4ff78be413543e550782ecc75aa55
4
+ data.tar.gz: a8e5c30097afed0414ca7a6ecb5129d3c3fcd1a24df8c6e9d51222d644bf07ff
5
5
  SHA512:
6
- metadata.gz: 3062ddc15478efad6f25fb39e37689fecab84750b34c2496f5693af1b52c864053f50acf3af141d876e8cb8d2d19f89ecdd19e630ab1b1da9e953e897f2ab68a
7
- data.tar.gz: 14d688526a710b92cf2256e49df75e4abcf5a67ed7de40e6593cedf1a99e96561ba5024398ae7c767d78a4e0d74e18df344423cfbc83dd75e2afa28beeea0006
6
+ metadata.gz: 637dc353b19c3a6fcbbf70280604979320760af8c2e552aa80d9752a55948c07285c7f887d1461da541e8425c53749246f4d2f1141c09497caf886209b03dccb
7
+ data.tar.gz: 74e114b5ffb25828b465b213c9ca05994e6f5f22ef0711407eb2928d21a64c7a47ecd4e3c8548813c2e96bc81079db6e66f84c438b646df33d3b9e05c89378cb
data/isodoc.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "html2doc", "~> 1.1.1"
33
33
  spec.add_dependency "htmlentities", "~> 4.3.4"
34
34
  spec.add_dependency "liquid", "~> 4"
35
- spec.add_dependency "metanorma", ">= 1.2.0"
35
+ #spec.add_dependency "metanorma", ">= 1.2.0"
36
36
  spec.add_dependency "nokogiri", "~> 1.11.0"
37
37
  spec.add_dependency "relaton-cli"
38
38
  spec.add_dependency "roman-numerals"
data/lib/isodoc.rb CHANGED
@@ -23,6 +23,7 @@ require "isodoc/headlesshtml_convert"
23
23
  require "isodoc/presentation_xml_convert"
24
24
  require "isodoc/xref"
25
25
  require "isodoc/i18n"
26
+ require "metanorma/output"
26
27
 
27
28
  module IsoDoc
28
29
  end
@@ -1,231 +1,243 @@
1
1
  require_relative "blocks_example_note"
2
2
 
3
- module IsoDoc::Function
4
- module Blocks
5
- @annotation = false
3
+ module IsoDoc
4
+ module Function
5
+ module Blocks
6
+ @annotation = false
6
7
 
7
- def middle_title(_isoxml, out)
8
- out.p(**{ class: "zzSTDTitle1" }) { |p| p << @meta.get[:doctitle] }
9
- end
8
+ def middle_title(_isoxml, out)
9
+ out.p(**{ class: "zzSTDTitle1" }) { |p| p << @meta.get[:doctitle] }
10
+ end
10
11
 
11
- def middle_admonitions(isoxml, out)
12
- isoxml.xpath(ns("//sections/note | //sections/admonition")).each do |x|
13
- parse(x, out)
12
+ def middle_admonitions(isoxml, out)
13
+ isoxml.xpath(ns("//sections/note | //sections/admonition")).each do |x|
14
+ parse(x, out)
15
+ end
14
16
  end
15
- end
16
17
 
17
- def figure_name_parse(_node, div, name)
18
- return if name.nil?
18
+ def figure_name_parse(_node, div, name)
19
+ return if name.nil?
19
20
 
20
- div.p **{ class: "FigureTitle", style: "text-align:center;" } do |p|
21
- name.children.each { |n| parse(n, p) }
21
+ div.p **{ class: "FigureTitle", style: "text-align:center;" } do |p|
22
+ name.children.each { |n| parse(n, p) }
23
+ end
22
24
  end
23
- end
24
25
 
25
- def figure_key(out)
26
- out.p **{ style: "page-break-after:avoid;" } do |p|
27
- p.b { |b| b << @i18n.key }
26
+ def figure_key(out)
27
+ out.p **{ style: "page-break-after:avoid;" } do |p|
28
+ p.b { |b| b << @i18n.key }
29
+ end
28
30
  end
29
- end
30
31
 
31
- def figure_attrs(node)
32
- attr_code(id: node["id"], class: "figure", style: keep_style(node))
33
- end
32
+ def figure_attrs(node)
33
+ attr_code(id: node["id"], class: "figure", style: keep_style(node))
34
+ end
34
35
 
35
- def figure_parse(node, out)
36
- return pseudocode_parse(node, out) if node["class"] == "pseudocode" ||
37
- node["type"] == "pseudocode"
36
+ def figure_parse(node, out)
37
+ return pseudocode_parse(node, out) if node["class"] == "pseudocode" ||
38
+ node["type"] == "pseudocode"
39
+
40
+ @in_figure = true
41
+ figure_parse1(node, out)
42
+ @in_figure = false
43
+ end
38
44
 
39
- @in_figure = true
40
- out.div **figure_attrs(node) do |div|
41
- node.children.each do |n|
42
- figure_key(out) if n.name == "dl"
43
- parse(n, div) unless n.name == "name"
45
+ def figure_parse1(node, out)
46
+ out.div **figure_attrs(node) do |div|
47
+ node.children.each do |n|
48
+ figure_key(out) if n.name == "dl"
49
+ parse(n, div) unless n.name == "name"
50
+ end
51
+ figure_name_parse(node, div, node.at(ns("./name")))
44
52
  end
45
- figure_name_parse(node, div, node.at(ns("./name")))
46
53
  end
47
- @in_figure = false
48
- end
49
54
 
50
- def pseudocode_attrs(node)
51
- attr_code(id: node["id"], class: "pseudocode", style: keep_style(node))
52
- end
55
+ def pseudocode_attrs(node)
56
+ attr_code(id: node["id"], class: "pseudocode", style: keep_style(node))
57
+ end
53
58
 
54
- def pseudocode_parse(node, out)
55
- @in_figure = true
56
- name = node.at(ns("./name"))
57
- out.div **pseudocode_attrs(node) do |div|
58
- node.children.each { |n| parse(n, div) unless n.name == "name" }
59
- sourcecode_name_parse(node, div, name)
59
+ def pseudocode_parse(node, out)
60
+ @in_figure = true
61
+ name = node.at(ns("./name"))
62
+ out.div **pseudocode_attrs(node) do |div|
63
+ node.children.each { |n| parse(n, div) unless n.name == "name" }
64
+ sourcecode_name_parse(node, div, name)
65
+ end
66
+ @in_figure = false
60
67
  end
61
- @in_figure = false
62
- end
63
68
 
64
- def sourcecode_name_parse(_node, div, name)
65
- return if name.nil?
69
+ def sourcecode_name_parse(_node, div, name)
70
+ return if name.nil?
66
71
 
67
- div.p **{ class: "SourceTitle", style: "text-align:center;" } do |p|
68
- name.children.each { |n| parse(n, p) }
72
+ div.p **{ class: "SourceTitle", style: "text-align:center;" } do |p|
73
+ name.children.each { |n| parse(n, p) }
74
+ end
69
75
  end
70
- end
71
76
 
72
- def admonition_name_parse(_node, div, name)
73
- div.p **{ class: "AdmonitionTitle", style: "text-align:center;" } do |p|
74
- name.children.each { |n| parse(n, p) }
77
+ def admonition_name_parse(_node, div, name)
78
+ div.p **{ class: "AdmonitionTitle", style: "text-align:center;" } do |p|
79
+ name.children.each { |n| parse(n, p) }
80
+ end
75
81
  end
76
- end
77
82
 
78
- def sourcecode_attrs(node)
79
- attr_code(id: node["id"], class: "Sourcecode", style: keep_style(node))
80
- end
83
+ def sourcecode_attrs(node)
84
+ attr_code(id: node["id"], class: "Sourcecode", style: keep_style(node))
85
+ end
81
86
 
82
- def sourcecode_parse(node, out)
83
- name = node.at(ns("./name"))
84
- out.p **sourcecode_attrs(node) do |div|
85
- @sourcecode = true
86
- node.children.each { |n| parse(n, div) unless n.name == "name" }
87
- @sourcecode = false
87
+ def sourcecode_parse(node, out)
88
+ name = node.at(ns("./name"))
89
+ out.p **sourcecode_attrs(node) do |div|
90
+ @sourcecode = true
91
+ node.children.each { |n| parse(n, div) unless n.name == "name" }
92
+ @sourcecode = false
93
+ end
94
+ sourcecode_name_parse(node, out, name)
88
95
  end
89
- sourcecode_name_parse(node, out, name)
90
- end
91
96
 
92
- def pre_parse(node, out)
93
- out.pre node.text, **attr_code(id: node["id"])
94
- end
97
+ def pre_parse(node, out)
98
+ out.pre node.text, **attr_code(id: node["id"])
99
+ end
95
100
 
96
- def annotation_parse(node, out)
97
- @sourcecode = false
98
- @annotation = true
99
- node.at("./preceding-sibling::*[local-name() = 'annotation']") or
100
- out << "<br/>"
101
- callout = node.at(ns("//callout[@target='#{node['id']}']"))
102
- out << "<br/>&lt;#{callout.text}&gt; "
103
- out << node&.children&.text&.strip
104
- @annotation = false
105
- end
101
+ def annotation_parse(node, out)
102
+ @sourcecode = false
103
+ @annotation = true
104
+ node.at("./preceding-sibling::*[local-name() = 'annotation']") or
105
+ out << "<br/>"
106
+ callout = node.at(ns("//callout[@target='#{node['id']}']"))
107
+ out << "<br/>&lt;#{callout.text}&gt; "
108
+ out << node&.children&.text&.strip
109
+ @annotation = false
110
+ end
106
111
 
107
- def admonition_class(_node)
108
- "Admonition"
109
- end
112
+ def admonition_class(_node)
113
+ "Admonition"
114
+ end
110
115
 
111
- def admonition_name(node, type)
112
- name = node&.at(ns("./name")) and return name
113
- name = Nokogiri::XML::Node.new("name", node.document)
114
- return unless type && @i18n.admonition[type]
116
+ def admonition_name(node, type)
117
+ name = node&.at(ns("./name")) and return name
118
+ name = Nokogiri::XML::Node.new("name", node.document)
119
+ return unless type && @i18n.admonition[type]
115
120
 
116
- name << @i18n.admonition[type]&.upcase
117
- name
118
- end
121
+ name << @i18n.admonition[type]&.upcase
122
+ name
123
+ end
119
124
 
120
- def admonition_attrs(node)
121
- attr_code(id: node["id"], class: admonition_class(node),
122
- style: keep_style(node))
123
- end
125
+ def admonition_attrs(node)
126
+ attr_code(id: node["id"], class: admonition_class(node),
127
+ style: keep_style(node))
128
+ end
124
129
 
125
- def admonition_parse(node, out)
126
- type = node["type"]
127
- name = admonition_name(node, type)
128
- out.div **admonition_attrs(node) do |t|
129
- admonition_name_parse(node, t, name) if name
130
- node.children.each { |n| parse(n, t) unless n.name == "name" }
130
+ def admonition_parse(node, out)
131
+ type = node["type"]
132
+ name = admonition_name(node, type)
133
+ out.div **admonition_attrs(node) do |t|
134
+ admonition_name_parse(node, t, name) if name
135
+ node.children.each { |n| parse(n, t) unless n.name == "name" }
136
+ end
131
137
  end
132
- end
133
138
 
134
- def formula_where(dl, out)
135
- return unless dl
139
+ def formula_where(dlist, out)
140
+ return unless dlist
136
141
 
137
- out.p **{ style: "page-break-after:avoid;" } do |p|
138
- p << @i18n.where
142
+ out.p **{ style: "page-break-after:avoid;" } do |p|
143
+ p << @i18n.where
144
+ end
145
+ parse(dlist, out)
146
+ out.parent.at("./dl")["class"] = "formula_dl"
139
147
  end
140
- parse(dl, out)
141
- out.parent.at("./dl")["class"] = "formula_dl"
142
- end
143
148
 
144
- def formula_parse1(node, out)
145
- out.div **attr_code(class: "formula") do |div|
146
- div.p do |_p|
147
- parse(node.at(ns("./stem")), div)
148
- if lbl = node&.at(ns("./name"))&.text
149
- insert_tab(div, 1)
150
- div << "(#{lbl})"
149
+ def formula_parse1(node, out)
150
+ out.div **attr_code(class: "formula") do |div|
151
+ div.p do |_p|
152
+ parse(node.at(ns("./stem")), div)
153
+ if lbl = node&.at(ns("./name"))&.text
154
+ insert_tab(div, 1)
155
+ div << "(#{lbl})"
156
+ end
151
157
  end
152
158
  end
153
159
  end
154
- end
155
160
 
156
- def formula_attrs(node)
157
- attr_code(id: node["id"], style: keep_style(node))
158
- end
161
+ def formula_attrs(node)
162
+ attr_code(id: node["id"], style: keep_style(node))
163
+ end
159
164
 
160
- def formula_parse(node, out)
161
- out.div **formula_attrs(node) do |div|
162
- formula_parse1(node, div)
163
- formula_where(node.at(ns("./dl")), div)
164
- node.children.each do |n|
165
- next if %w(stem dl name).include? n.name
165
+ def formula_parse(node, out)
166
+ out.div **formula_attrs(node) do |div|
167
+ formula_parse1(node, div)
168
+ formula_where(node.at(ns("./dl")), div)
169
+ node.children.each do |n|
170
+ next if %w(stem dl name).include? n.name
166
171
 
167
- parse(n, div)
172
+ parse(n, div)
173
+ end
168
174
  end
169
175
  end
170
- end
171
176
 
172
- def para_class(_node)
173
- classtype = nil
174
- classtype = "MsoCommentText" if in_comment
175
- classtype = "Sourcecode" if @annotation
176
- classtype
177
- end
177
+ def para_class(_node)
178
+ classtype = nil
179
+ classtype = "MsoCommentText" if in_comment
180
+ classtype = "Sourcecode" if @annotation
181
+ classtype
182
+ end
178
183
 
179
- def para_attrs(node)
180
- attrs = { class: para_class(node), id: node["id"] }
181
- s = node["align"].nil? ? "" : "text-align:#{node['align']};"
182
- s = "#{s}#{keep_style(node)}"
183
- attrs[:style] = s unless s.empty?
184
- attrs
185
- end
184
+ def para_attrs(node)
185
+ attrs = { class: para_class(node), id: node["id"] }
186
+ s = node["align"].nil? ? "" : "text-align:#{node['align']};"
187
+ s = "#{s}#{keep_style(node)}"
188
+ attrs[:style] = s unless s.empty?
189
+ attrs
190
+ end
186
191
 
187
- def para_parse(node, out)
188
- out.p **attr_code(para_attrs(node)) do |p|
189
- unless @termdomain.empty?
190
- p << "&lt;#{@termdomain}&gt; "
191
- @termdomain = ""
192
+ def para_parse(node, out)
193
+ out.p **attr_code(para_attrs(node)) do |p|
194
+ unless @termdomain.empty?
195
+ p << "&lt;#{@termdomain}&gt; "
196
+ @termdomain = ""
197
+ end
198
+ node.children.each { |n| parse(n, p) }
192
199
  end
193
- node.children.each { |n| parse(n, p) }
194
200
  end
195
- end
196
201
 
197
- def quote_attribution(node, out)
198
- author = node.at(ns("./author"))
199
- source = node.at(ns("./source"))
200
- return if author.nil? && source.nil?
202
+ def quote_attribution(node, out)
203
+ author = node.at(ns("./author"))
204
+ source = node.at(ns("./source"))
205
+ return if author.nil? && source.nil?
201
206
 
202
- out.p **{ class: "QuoteAttribution" } do |p|
203
- p << "&mdash; #{author.text}" if author
204
- p << ", " if author && source
205
- eref_parse(source, p) if source
207
+ out.p **{ class: "QuoteAttribution" } do |p|
208
+ p << "&mdash; #{author.text}" if author
209
+ p << ", " if author && source
210
+ eref_parse(source, p) if source
211
+ end
206
212
  end
207
- end
208
213
 
209
- def quote_parse(node, out)
210
- attrs = para_attrs(node)
211
- attrs[:class] = "Quote"
212
- out.div **attr_code(attrs) do |p|
213
- node.children.each do |n|
214
- parse(n, p) unless ["author", "source"].include? n.name
214
+ def quote_parse(node, out)
215
+ attrs = para_attrs(node)
216
+ attrs[:class] = "Quote"
217
+ out.div **attr_code(attrs) do |p|
218
+ node.children.each do |n|
219
+ parse(n, p) unless %w(author source).include? n.name
220
+ end
221
+ quote_attribution(node, out)
215
222
  end
216
- quote_attribution(node, out)
217
223
  end
218
- end
219
224
 
220
- def passthrough_parse(node, out)
221
- return if node["format"] &&
222
- !(node["format"].split(",").include? @format.to_s)
225
+ def passthrough_parse(node, out)
226
+ return if node["format"] &&
227
+ !(node["format"].split(",").include? @format.to_s)
223
228
 
224
- out.passthrough node.text
225
- end
229
+ out.passthrough node.text
230
+ end
226
231
 
227
- def svg_parse(node, out)
228
- out.parent.add_child(node)
232
+ def svg_parse(node, out)
233
+ out.parent.add_child(node)
234
+ end
235
+
236
+ def toc_parse(node, out)
237
+ out.div **{ class: "toc" } do |div|
238
+ node.children.each { |n| parse(n, div) }
239
+ end
240
+ end
229
241
  end
230
242
  end
231
243
  end
@@ -1,237 +1,239 @@
1
1
  require "fileutils"
2
2
  require "pathname"
3
3
 
4
- module IsoDoc::Function
5
- module ToWordHtml
6
-
7
- def set_termdomain(termdomain)
8
- @termdomain = termdomain
9
- end
4
+ module IsoDoc
5
+ module Function
6
+ module ToWordHtml
7
+ def set_termdomain(termdomain)
8
+ @termdomain = termdomain
9
+ end
10
10
 
11
- def in_sourcecode
12
- @sourcecode
13
- end
11
+ def in_sourcecode
12
+ @sourcecode
13
+ end
14
14
 
15
- def note?
16
- @note
17
- end
15
+ def note?
16
+ @note
17
+ end
18
18
 
19
- def init_file(filename, debug)
20
- filepath = Pathname.new(filename)
21
- filename = filepath.sub_ext("").sub(/\.presentation$/, "").to_s
22
- dir = init_dir(filename, debug)
23
- @filename = filename
24
- @localdir = "#{filepath.parent}/"
25
- @sourcedir = @localdir
26
- @sourcefilename and
27
- @sourcedir = "#{Pathname.new(@sourcefilename).parent}/"
28
- [filename, dir]
29
- end
19
+ def init_file(filename, debug)
20
+ filepath = Pathname.new(filename)
21
+ filename = filepath.sub_ext("").sub(/\.presentation$/, "").to_s
22
+ dir = init_dir(filename, debug)
23
+ @filename = filename
24
+ @localdir = "#{filepath.parent}/"
25
+ @sourcedir = @localdir
26
+ @sourcefilename and
27
+ @sourcedir = "#{Pathname.new(@sourcefilename).parent}/"
28
+ [filename, dir]
29
+ end
30
30
 
31
- def init_dir(filename, debug)
32
- dir = "#{filename}_files"
33
- unless debug
34
- Dir.mkdir(dir, 0o777) unless File.exists?(dir)
35
- FileUtils.rm_rf "#{dir}/*"
31
+ def init_dir(filename, debug)
32
+ dir = "#{filename}_files"
33
+ unless debug
34
+ Dir.mkdir(dir, 0o777) unless File.exists?(dir)
35
+ FileUtils.rm_rf "#{dir}/*"
36
+ end
37
+ dir
36
38
  end
37
- dir
38
- end
39
39
 
40
- # tmp image dir is same directory as @filename
41
- def tmpimagedir
42
- @filename + tmpimagedir_suffix
43
- end
40
+ # tmp image dir is same directory as @filename
41
+ def tmpimagedir
42
+ @filename + tmpimagedir_suffix
43
+ end
44
44
 
45
- def rel_tmpimagedir
46
- Pathname.new(@filename).basename.to_s + tmpimagedir_suffix
47
- end
45
+ def rel_tmpimagedir
46
+ Pathname.new(@filename).basename.to_s + tmpimagedir_suffix
47
+ end
48
48
 
49
- # isodoc.css overrides any CSS injected by Html2Doc, which
50
- # is inserted before this CSS.
51
- def define_head(head, _filename, _dir)
52
- if @standardstylesheet
53
- head.style do |style|
54
- @standardstylesheet.open
55
- stylesheet = @standardstylesheet.read
56
- style.comment "\n#{stylesheet}\n"
49
+ # isodoc.css overrides any CSS injected by Html2Doc, which
50
+ # is inserted before this CSS.
51
+ def define_head(head, _filename, _dir)
52
+ if @standardstylesheet
53
+ head.style do |style|
54
+ @standardstylesheet.open
55
+ stylesheet = @standardstylesheet.read
56
+ style.comment "\n#{stylesheet}\n"
57
+ end
57
58
  end
58
59
  end
59
- end
60
60
 
61
- def body_attr
62
- { lang: @lang.to_s }
63
- end
64
-
65
- def make_body(xml, docxml)
66
- xml.body **body_attr do |body|
67
- make_body1(body, docxml)
68
- make_body2(body, docxml)
69
- make_body3(body, docxml)
61
+ def body_attr
62
+ { lang: @lang.to_s }
70
63
  end
71
- end
72
64
 
73
- def make_body1(body, _docxml)
74
- body.div **{ class: "title-section" } do |div1|
75
- div1.p { |p| p << "&nbsp;" } # placeholder
65
+ def make_body(xml, docxml)
66
+ xml.body **body_attr do |body|
67
+ make_body1(body, docxml)
68
+ make_body2(body, docxml)
69
+ make_body3(body, docxml)
70
+ end
76
71
  end
77
- section_break(body)
78
- end
79
72
 
80
- def make_body2(body, _docxml)
81
- body.div **{ class: "prefatory-section" } do |div2|
82
- div2.p { |p| p << "&nbsp;" } # placeholder
73
+ def make_body1(body, _docxml)
74
+ body.div **{ class: "title-section" } do |div1|
75
+ div1.p { |p| p << "&nbsp;" } # placeholder
76
+ end
77
+ section_break(body)
83
78
  end
84
- section_break(body)
85
- end
86
79
 
87
- def make_body3(body, docxml)
88
- body.div **{ class: "main-section" } do |div3|
89
- boilerplate docxml, div3
90
- preface_block docxml, div3
91
- abstract docxml, div3
92
- foreword docxml, div3
93
- introduction docxml, div3
94
- acknowledgements docxml, div3
95
- middle docxml, div3
96
- footnotes div3
97
- comments div3
80
+ def make_body2(body, _docxml)
81
+ body.div **{ class: "prefatory-section" } do |div2|
82
+ div2.p { |p| p << "&nbsp;" } # placeholder
83
+ end
84
+ section_break(body)
98
85
  end
99
- end
100
86
 
101
- def info(isoxml, out)
102
- @meta.title isoxml, out
103
- @meta.subtitle isoxml, out
104
- @meta.docstatus isoxml, out
105
- @meta.docid isoxml, out
106
- @meta.otherid isoxml, out
107
- @meta.docnumeric isoxml, out
108
- @meta.doctype isoxml, out
109
- @meta.author isoxml, out
110
- @meta.bibdate isoxml, out
111
- @meta.relations isoxml, out
112
- @meta.version isoxml, out
113
- @meta.url isoxml, out
114
- @meta.keywords isoxml, out
115
- @meta.note isoxml, out
116
- @meta.get
117
- end
87
+ def make_body3(body, docxml)
88
+ body.div **{ class: "main-section" } do |div3|
89
+ boilerplate docxml, div3
90
+ preface_block docxml, div3
91
+ abstract docxml, div3
92
+ foreword docxml, div3
93
+ introduction docxml, div3
94
+ acknowledgements docxml, div3
95
+ middle docxml, div3
96
+ footnotes div3
97
+ comments div3
98
+ end
99
+ end
118
100
 
119
- def middle(isoxml, out)
120
- middle_title(isoxml, out)
121
- middle_admonitions(isoxml, out)
122
- i = scope isoxml, out, 0
123
- i = norm_ref isoxml, out, i
124
- i = terms_defs isoxml, out, i
125
- symbols_abbrevs isoxml, out, i
126
- clause isoxml, out
127
- annex isoxml, out
128
- bibliography isoxml, out
129
- end
101
+ def info(isoxml, out)
102
+ @meta.title isoxml, out
103
+ @meta.subtitle isoxml, out
104
+ @meta.docstatus isoxml, out
105
+ @meta.docid isoxml, out
106
+ @meta.otherid isoxml, out
107
+ @meta.docnumeric isoxml, out
108
+ @meta.doctype isoxml, out
109
+ @meta.author isoxml, out
110
+ @meta.bibdate isoxml, out
111
+ @meta.relations isoxml, out
112
+ @meta.version isoxml, out
113
+ @meta.url isoxml, out
114
+ @meta.keywords isoxml, out
115
+ @meta.note isoxml, out
116
+ @meta.get
117
+ end
130
118
 
131
- def boilerplate(node, out)
132
- return if @bare
119
+ def middle(isoxml, out)
120
+ middle_title(isoxml, out)
121
+ middle_admonitions(isoxml, out)
122
+ i = scope isoxml, out, 0
123
+ i = norm_ref isoxml, out, i
124
+ i = terms_defs isoxml, out, i
125
+ symbols_abbrevs isoxml, out, i
126
+ clause isoxml, out
127
+ annex isoxml, out
128
+ bibliography isoxml, out
129
+ end
133
130
 
134
- boilerplate = node.at(ns("//boilerplate")) or return
135
- out.div **{ class: "authority" } do |s|
136
- boilerplate.children.each do |n|
137
- if n.name == "title"
138
- s.h1 do |h|
139
- n.children.each { |nn| parse(nn, h) }
131
+ def boilerplate(node, out)
132
+ return if @bare
133
+
134
+ boilerplate = node.at(ns("//boilerplate")) or return
135
+ out.div **{ class: "authority" } do |s|
136
+ boilerplate.children.each do |n|
137
+ if n.name == "title"
138
+ s.h1 do |h|
139
+ n.children.each { |nn| parse(nn, h) }
140
+ end
141
+ else parse(n, s)
140
142
  end
141
- else parse(n, s)
142
143
  end
143
144
  end
144
145
  end
145
- end
146
146
 
147
- def parse(node, out)
148
- if node.text? then text_parse(node, out)
149
- else
150
- case node.name
151
- when "em" then em_parse(node, out)
152
- when "strong" then strong_parse(node, out)
153
- when "sup" then sup_parse(node, out)
154
- when "sub" then sub_parse(node, out)
155
- when "tt" then tt_parse(node, out)
156
- when "strike" then strike_parse(node, out)
157
- when "underline" then underline_parse(node, out)
158
- when "keyword" then keyword_parse(node, out)
159
- when "smallcap" then smallcap_parse(node, out)
160
- when "br" then br_parse(node, out)
161
- when "hr" then hr_parse(node, out)
162
- when "bookmark" then bookmark_parse(node, out)
163
- when "pagebreak" then pagebreak_parse(node, out)
164
- when "callout" then callout_parse(node, out)
165
- when "stem" then stem_parse(node, out)
166
- when "clause" then clause_parse(node, out)
167
- when "xref" then xref_parse(node, out)
168
- when "eref" then eref_parse(node, out)
169
- when "origin" then origin_parse(node, out)
170
- when "link" then link_parse(node, out)
171
- when "ul" then ul_parse(node, out)
172
- when "ol" then ol_parse(node, out)
173
- when "li" then li_parse(node, out)
174
- when "dl" then dl_parse(node, out)
175
- when "fn" then footnote_parse(node, out)
176
- when "p" then para_parse(node, out)
177
- when "quote" then quote_parse(node, out)
178
- when "tr" then tr_parse(node, out)
179
- when "note" then note_parse(node, out)
180
- when "review" then review_note_parse(node, out)
181
- when "admonition" then admonition_parse(node, out)
182
- when "formula" then formula_parse(node, out)
183
- when "table" then table_parse(node, out)
184
- when "figure" then figure_parse(node, out)
185
- when "example" then example_parse(node, out)
186
- when "image" then image_parse(node, out, nil)
187
- when "sourcecode" then sourcecode_parse(node, out)
188
- when "pre" then pre_parse(node, out)
189
- when "annotation" then annotation_parse(node, out)
190
- when "term" then termdef_parse(node, out)
191
- when "preferred" then term_parse(node, out)
192
- when "admitted" then admitted_term_parse(node, out)
193
- when "deprecates" then deprecated_term_parse(node, out)
194
- when "domain" then set_termdomain(node.text)
195
- when "definition" then definition_parse(node, out)
196
- when "termsource" then termref_parse(node, out)
197
- when "modification" then modification_parse(node, out)
198
- when "termnote" then termnote_parse(node, out)
199
- when "termexample" then example_parse(node, out)
200
- when "terms" then terms_parse(node, out)
201
- when "definitions" then symbols_parse(node, out)
202
- when "references" then bibliography_parse(node, out)
203
- when "termdocsource" then termdocsource_parse(node, out)
204
- when "requirement" then requirement_parse(node, out)
205
- when "recommendation" then recommendation_parse(node, out)
206
- when "permission" then permission_parse(node, out)
207
- when "subject" then requirement_skip_parse(node, out)
208
- when "classification" then requirement_skip_parse(node, out)
209
- when "inherit" then requirement_component_parse(node, out)
210
- when "description" then requirement_component_parse(node, out)
211
- when "specification" then requirement_component_parse(node, out)
212
- when "measurement-target" then requirement_component_parse(node, out)
213
- when "verification" then requirement_component_parse(node, out)
214
- when "import" then requirement_component_parse(node, out)
215
- when "index" then index_parse(node, out)
216
- when "index-xref" then index_xref_parse(node, out)
217
- when "termref" then termrefelem_parse(node, out)
218
- when "copyright-statement" then copyright_parse(node, out)
219
- when "license-statement" then license_parse(node, out)
220
- when "legal-statement" then legal_parse(node, out)
221
- when "feedback-statement" then feedback_parse(node, out)
222
- when "passthrough" then passthrough_parse(node, out)
223
- when "amend" then amend_parse(node, out)
224
- when "tab" then clausedelimspace(out) # in Presentation XML only
225
- when "svg" then svg_parse(node, out) # in Presentation XML only
226
- when "add" then add_parse(node, out)
227
- when "del" then del_parse(node, out)
228
- when "form" then form_parse(node, out)
229
- when "input" then input_parse(node, out)
230
- when "select" then select_parse(node, out)
231
- when "label" then label_parse(node, out)
232
- when "option" then option_parse(node, out)
233
- when "textarea" then textarea_parse(node, out)
234
- else error_parse(node, out)
147
+ def parse(node, out)
148
+ if node.text? then text_parse(node, out)
149
+ else
150
+ case node.name
151
+ when "em" then em_parse(node, out)
152
+ when "strong" then strong_parse(node, out)
153
+ when "sup" then sup_parse(node, out)
154
+ when "sub" then sub_parse(node, out)
155
+ when "tt" then tt_parse(node, out)
156
+ when "strike" then strike_parse(node, out)
157
+ when "underline" then underline_parse(node, out)
158
+ when "keyword" then keyword_parse(node, out)
159
+ when "smallcap" then smallcap_parse(node, out)
160
+ when "br" then br_parse(node, out)
161
+ when "hr" then hr_parse(node, out)
162
+ when "bookmark" then bookmark_parse(node, out)
163
+ when "pagebreak" then pagebreak_parse(node, out)
164
+ when "callout" then callout_parse(node, out)
165
+ when "stem" then stem_parse(node, out)
166
+ when "clause" then clause_parse(node, out)
167
+ when "xref" then xref_parse(node, out)
168
+ when "eref" then eref_parse(node, out)
169
+ when "origin" then origin_parse(node, out)
170
+ when "link" then link_parse(node, out)
171
+ when "ul" then ul_parse(node, out)
172
+ when "ol" then ol_parse(node, out)
173
+ when "li" then li_parse(node, out)
174
+ when "dl" then dl_parse(node, out)
175
+ when "fn" then footnote_parse(node, out)
176
+ when "p" then para_parse(node, out)
177
+ when "quote" then quote_parse(node, out)
178
+ when "tr" then tr_parse(node, out)
179
+ when "note" then note_parse(node, out)
180
+ when "review" then review_note_parse(node, out)
181
+ when "admonition" then admonition_parse(node, out)
182
+ when "formula" then formula_parse(node, out)
183
+ when "table" then table_parse(node, out)
184
+ when "figure" then figure_parse(node, out)
185
+ when "example" then example_parse(node, out)
186
+ when "image" then image_parse(node, out, nil)
187
+ when "sourcecode" then sourcecode_parse(node, out)
188
+ when "pre" then pre_parse(node, out)
189
+ when "annotation" then annotation_parse(node, out)
190
+ when "term" then termdef_parse(node, out)
191
+ when "preferred" then term_parse(node, out)
192
+ when "admitted" then admitted_term_parse(node, out)
193
+ when "deprecates" then deprecated_term_parse(node, out)
194
+ when "domain" then set_termdomain(node.text)
195
+ when "definition" then definition_parse(node, out)
196
+ when "termsource" then termref_parse(node, out)
197
+ when "modification" then modification_parse(node, out)
198
+ when "termnote" then termnote_parse(node, out)
199
+ when "termexample" then example_parse(node, out)
200
+ when "terms" then terms_parse(node, out)
201
+ when "definitions" then symbols_parse(node, out)
202
+ when "references" then bibliography_parse(node, out)
203
+ when "termdocsource" then termdocsource_parse(node, out)
204
+ when "requirement" then requirement_parse(node, out)
205
+ when "recommendation" then recommendation_parse(node, out)
206
+ when "permission" then permission_parse(node, out)
207
+ when "subject" then requirement_skip_parse(node, out)
208
+ when "classification" then requirement_skip_parse(node, out)
209
+ when "inherit" then requirement_component_parse(node, out)
210
+ when "description" then requirement_component_parse(node, out)
211
+ when "specification" then requirement_component_parse(node, out)
212
+ when "measurement-target" then requirement_component_parse(node, out)
213
+ when "verification" then requirement_component_parse(node, out)
214
+ when "import" then requirement_component_parse(node, out)
215
+ when "index" then index_parse(node, out)
216
+ when "index-xref" then index_xref_parse(node, out)
217
+ when "termref" then termrefelem_parse(node, out)
218
+ when "copyright-statement" then copyright_parse(node, out)
219
+ when "license-statement" then license_parse(node, out)
220
+ when "legal-statement" then legal_parse(node, out)
221
+ when "feedback-statement" then feedback_parse(node, out)
222
+ when "passthrough" then passthrough_parse(node, out)
223
+ when "amend" then amend_parse(node, out)
224
+ when "tab" then clausedelimspace(out) # in Presentation XML only
225
+ when "svg" then svg_parse(node, out) # in Presentation XML only
226
+ when "add" then add_parse(node, out)
227
+ when "del" then del_parse(node, out)
228
+ when "form" then form_parse(node, out)
229
+ when "input" then input_parse(node, out)
230
+ when "select" then select_parse(node, out)
231
+ when "label" then label_parse(node, out)
232
+ when "option" then option_parse(node, out)
233
+ when "textarea" then textarea_parse(node, out)
234
+ when "toc" then toc_parse(node, out)
235
+ else error_parse(node, out)
236
+ end
235
237
  end
236
238
  end
237
239
  end