isodoc 1.6.1 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +2 -12
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -8
  5. data/Rakefile +2 -2
  6. data/isodoc.gemspec +4 -3
  7. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  8. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  9. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  10. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  11. data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
  12. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  13. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  14. data/lib/isodoc.rb +0 -2
  15. data/lib/isodoc/common.rb +2 -0
  16. data/lib/isodoc/convert.rb +8 -2
  17. data/lib/isodoc/function/blocks.rb +15 -4
  18. data/lib/isodoc/function/cleanup.rb +52 -43
  19. data/lib/isodoc/function/form.rb +51 -0
  20. data/lib/isodoc/function/inline.rb +8 -7
  21. data/lib/isodoc/function/references.rb +71 -77
  22. data/lib/isodoc/function/section.rb +28 -16
  23. data/lib/isodoc/function/table.rb +22 -22
  24. data/lib/isodoc/function/terms.rb +6 -7
  25. data/lib/isodoc/function/to_word_html.rb +19 -25
  26. data/lib/isodoc/function/utils.rb +181 -163
  27. data/lib/isodoc/gem_tasks.rb +8 -9
  28. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  29. data/lib/isodoc/html_convert.rb +6 -0
  30. data/lib/isodoc/html_function/comments.rb +14 -12
  31. data/lib/isodoc/html_function/footnotes.rb +14 -7
  32. data/lib/isodoc/html_function/form.rb +62 -0
  33. data/lib/isodoc/html_function/html.rb +30 -26
  34. data/lib/isodoc/html_function/postprocess.rb +191 -182
  35. data/lib/isodoc/html_function/sectionsplit.rb +230 -0
  36. data/lib/isodoc/i18n.rb +13 -11
  37. data/lib/isodoc/metadata.rb +22 -20
  38. data/lib/isodoc/metadata_contributor.rb +31 -28
  39. data/lib/isodoc/pdf_convert.rb +11 -13
  40. data/lib/isodoc/presentation_function/bibdata.rb +54 -30
  41. data/lib/isodoc/presentation_function/inline.rb +70 -120
  42. data/lib/isodoc/presentation_function/math.rb +84 -0
  43. data/lib/isodoc/presentation_function/section.rb +55 -19
  44. data/lib/isodoc/presentation_xml_convert.rb +3 -0
  45. data/lib/isodoc/sassc_importer.rb +1 -1
  46. data/lib/isodoc/version.rb +1 -1
  47. data/lib/isodoc/word_function/body.rb +28 -24
  48. data/lib/isodoc/word_function/postprocess.rb +50 -36
  49. data/lib/isodoc/xref.rb +2 -0
  50. data/lib/isodoc/xref/xref_counter.rb +1 -2
  51. data/lib/isodoc/xref/xref_gen.rb +21 -14
  52. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  53. data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
  54. data/spec/assets/scripts_override.html +3 -0
  55. data/spec/isodoc/blocks_spec.rb +624 -997
  56. data/spec/isodoc/cleanup_spec.rb +40 -42
  57. data/spec/isodoc/form_spec.rb +156 -0
  58. data/spec/isodoc/i18n_spec.rb +694 -821
  59. data/spec/isodoc/inline_spec.rb +1105 -921
  60. data/spec/isodoc/metadata_spec.rb +384 -379
  61. data/spec/isodoc/postproc_spec.rb +461 -333
  62. data/spec/isodoc/presentation_xml_spec.rb +355 -278
  63. data/spec/isodoc/ref_spec.rb +5 -5
  64. data/spec/isodoc/section_spec.rb +216 -199
  65. data/spec/isodoc/sectionsplit_spec.rb +190 -0
  66. data/spec/isodoc/table_spec.rb +41 -42
  67. data/spec/isodoc/terms_spec.rb +84 -84
  68. data/spec/isodoc/xref_spec.rb +974 -932
  69. metadata +32 -7
@@ -0,0 +1,51 @@
1
+ module IsoDoc::Function
2
+ module Form
3
+ def form_parse(node, out)
4
+ node.children.each do |n|
5
+ parse(n, out)
6
+ end
7
+ end
8
+
9
+ def input_parse(node, out)
10
+ case node["type"]
11
+ when "button" then out << "[#{node['value'] || 'BUTTON'}]"
12
+ when "checkbox" then out << "&#x2610; "
13
+ when "date" then text_input(out)
14
+ when "file" then text_input(out)
15
+ when "password" then text_input(out)
16
+ when "radio" then out << "&#x25CE; "
17
+ when "submit" # nop
18
+ when "text" then text_input(out, node["maxlength"])
19
+ end
20
+ end
21
+
22
+ def text_input(out, length = 10)
23
+ length ||= 10
24
+ length = length.to_i
25
+ length.zero? and length = 10
26
+ out << "_" * length
27
+ out << " "
28
+ end
29
+
30
+ def select_parse(node, out)
31
+ text_input(out, node["size"] || 10)
32
+ end
33
+
34
+ def label_parse(node, out)
35
+ node.children.each do |n|
36
+ parse(n, out)
37
+ end
38
+ end
39
+
40
+ def option_parse(node, out); end
41
+
42
+ def textarea_parse(_node, out)
43
+ out.table **{ border: 1, width: "50%" } do |t|
44
+ t.tr do |tr|
45
+ tr.td do |td|
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -3,11 +3,12 @@ require_relative "inline_simple"
3
3
  module IsoDoc::Function
4
4
  module Inline
5
5
  def link_parse(node, out)
6
- out.a **attr_code(href: node["target"], title: node["alt"]) do |l|
6
+ url = node["target"]
7
+ node["updatetype"] == "true" and url = suffix_url(url)
8
+ out.a **attr_code(href: url, title: node["alt"]) do |l|
7
9
  if node.text.empty?
8
10
  l << node["target"].sub(/^mailto:/, "")
9
- else
10
- node.children.each { |n| parse(n, l) }
11
+ else node.children.each { |n| parse(n, l) }
11
12
  end
12
13
  end
13
14
  end
@@ -33,6 +34,7 @@ module IsoDoc::Function
33
34
 
34
35
  def suffix_url(url)
35
36
  return url if %r{^https?://}.match?(url)
37
+ return url unless File.extname(url).empty?
36
38
 
37
39
  url.sub(/#{File.extname(url)}$/, ".html")
38
40
  end
@@ -78,8 +80,7 @@ module IsoDoc::Function
78
80
  "#{@openmathdelim}#{HTMLEntities.new.encode(node.text)}"\
79
81
  "#{@closemathdelim}"
80
82
  when "MathML" then node.first_element_child.to_s
81
- else
82
- HTMLEntities.new.encode(node.text)
83
+ else HTMLEntities.new.encode(node.text)
83
84
  end
84
85
  out.span **{ class: "stem" } do |span|
85
86
  span.parent.add_child ooml
@@ -122,13 +123,13 @@ module IsoDoc::Function
122
123
  end
123
124
 
124
125
  def add_parse(node, out)
125
- out.span **{class: "addition"} do |e|
126
+ out.span **{ class: "addition" } do |e|
126
127
  node.children.each { |n| parse(n, e) }
127
128
  end
128
129
  end
129
130
 
130
131
  def del_parse(node, out)
131
- out.span **{class: "deletion"} do |e|
132
+ out.span **{ class: "deletion" } do |e|
132
133
  node.children.each { |n| parse(n, e) }
133
134
  end
134
135
  end
@@ -1,82 +1,81 @@
1
1
  module IsoDoc::Function
2
2
  module References
3
-
4
3
  # This is highly specific to ISO, but it's not a bad precedent for
5
4
  # references anyway; keeping here instead of in IsoDoc::Iso for now
6
- def docid_l10n(x)
7
- return x if x.nil?
8
- x.gsub(/All Parts/i, @i18n.all_parts.downcase) if @i18n.all_parts
9
- x
5
+ def docid_l10n(text)
6
+ return text if text.nil?
7
+
8
+ text.gsub(/All Parts/i, @i18n.all_parts.downcase) if @i18n.all_parts
9
+ text
10
10
  end
11
11
 
12
12
  # TODO generate formatted ref if not present
13
- def nonstd_bibitem(list, b, ordinal, biblio)
14
- list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
15
- ids = bibitem_ref_code(b)
13
+ def nonstd_bibitem(list, bib, ordinal, biblio)
14
+ list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
15
+ ids = bibitem_ref_code(bib)
16
16
  identifiers = render_identifier(ids)
17
17
  if biblio then ref_entry_code(ref, ordinal, identifiers, ids)
18
18
  else
19
- ref << "#{identifiers[0] || identifiers[1]}"
19
+ ref << (identifiers[0] || identifiers[1]).to_s
20
20
  ref << ", #{identifiers[1]}" if identifiers[0] && identifiers[1]
21
21
  end
22
22
  ref << ", " unless biblio && !identifiers[1]
23
- reference_format(b, ref)
23
+ reference_format(bib, ref)
24
24
  end
25
25
  end
26
26
 
27
- def std_bibitem_entry(list, b, ordinal, biblio)
28
- list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
29
- identifiers = render_identifier(bibitem_ref_code(b))
27
+ def std_bibitem_entry(list, bib, ordinal, biblio)
28
+ list.p **attr_code(iso_bibitem_entry_attrs(bib, biblio)) do |ref|
29
+ identifiers = render_identifier(bibitem_ref_code(bib))
30
30
  if biblio then ref_entry_code(ref, ordinal, identifiers, nil)
31
31
  else
32
- ref << "#{identifiers[0] || identifiers[1]}"
32
+ ref << (identifiers[0] || identifiers[1]).to_s
33
33
  ref << ", #{identifiers[1]}" if identifiers[0] && identifiers[1]
34
34
  end
35
- date_note_process(b, ref)
35
+ date_note_process(bib, ref)
36
36
  ref << ", " unless biblio && !identifiers[1]
37
- reference_format(b, ref)
37
+ reference_format(bib, ref)
38
38
  end
39
39
  end
40
40
 
41
41
  # if t is just a number, only use that ([1] Non-Standard)
42
42
  # else, use both ordinal, as prefix, and t
43
- def ref_entry_code(r, ordinal, t, id)
43
+ def ref_entry_code(r, ordinal, t, _id)
44
44
  prefix_bracketed_ref(r, t[0] || "[#{ordinal}]")
45
- t[1] and r << "#{t[1]}"
45
+ t[1] and r << (t[1]).to_s
46
46
  end
47
47
 
48
- def pref_ref_code(b)
49
- b.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'metanorma' "\
48
+ def pref_ref_code(bib)
49
+ bib.at(ns("./docidentifier[not(@type = 'DOI' or @type = 'metanorma' "\
50
50
  "or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"))
51
51
  end
52
52
 
53
53
  # returns [metanorma, non-metanorma, DOI/ISSN/ISBN] identifiers
54
- def bibitem_ref_code(b)
55
- id = b.at(ns("./docidentifier[@type = 'metanorma']"))
56
- id1 = pref_ref_code(b)
57
- id2 = b.at(ns("./docidentifier[@type = 'DOI' or @type = 'ISSN' or "\
58
- "@type = 'ISBN']"))
54
+ def bibitem_ref_code(bib)
55
+ id = bib.at(ns("./docidentifier[@type = 'metanorma']"))
56
+ id1 = pref_ref_code(bib)
57
+ id2 = bib.at(ns("./docidentifier[@type = 'DOI' or @type = 'ISSN' or "\
58
+ "@type = 'ISBN']"))
59
59
  return [id, id1, id2] if id || id1 || id2
60
+
60
61
  id = Nokogiri::XML::Node.new("docidentifier", b.document)
61
62
  id << "(NO ID)"
62
63
  [nil, id, nil]
63
64
  end
64
65
 
65
- def bracket_if_num(x)
66
- return nil if x.nil?
67
- x = x.text.sub(/^\[/, "").sub(/\]$/, "")
68
- return "[#{x}]" if /^\d+$/.match(x)
69
- x
66
+ def bracket_if_num(num)
67
+ return nil if num.nil?
68
+
69
+ num = num.text.sub(/^\[/, "").sub(/\]$/, "")
70
+ return "[#{num}]" if /^\d+$/.match?(num)
71
+
72
+ num
70
73
  end
71
74
 
72
- def render_identifier(id)
73
- [
74
- bracket_if_num(id[0]),
75
- id[1].nil? ? nil :
76
- docid_prefix(id[1]["type"], id[1].text.sub(/^\[/, "").sub(/\]$/, "")),
77
- id[2].nil? ? nil :
78
- docid_prefix(id[2]["type"], id[2].text.sub(/^\[/, "").sub(/\]$/, "")),
79
- ]
75
+ def render_identifier(ident)
76
+ [bracket_if_num(ident[0]),
77
+ ident[1].nil? ? nil : ident[1].text.sub(/^\[/, "").sub(/\]$/, ""),
78
+ ident[2].nil? ? nil : ident[2].text.sub(/^\[/, "").sub(/\]$/, "")]
80
79
  end
81
80
 
82
81
  def docid_prefix(prefix, docid)
@@ -87,32 +86,34 @@ module IsoDoc::Function
87
86
 
88
87
  def omit_docid_prefix(prefix)
89
88
  return true if prefix.nil? || prefix.empty?
90
- return %w(ISO IEC IEV ITU W3C csd metanorma rfc-anchor).include? prefix
89
+
90
+ %w(ISO IEC IEV ITU W3C csd metanorma repository rfc-anchor)
91
+ .include? prefix
91
92
  end
92
93
 
93
- def date_note_process(b, ref)
94
- date_note = b.at(ns("./note[@type = 'Unpublished-Status']"))
94
+ def date_note_process(bib, ref)
95
+ date_note = bib.at(ns("./note[@type = 'Unpublished-Status']"))
95
96
  return if date_note.nil?
97
+
96
98
  date_note.children.first.replace("<p>#{date_note.content}</p>")
97
99
  footnote_parse(date_note, ref)
98
100
  end
99
101
 
100
- def iso_bibitem_entry_attrs(b, biblio)
101
- { id: b["id"], class: biblio ? "Biblio" : "NormRef" }
102
+ def iso_bibitem_entry_attrs(bib, biblio)
103
+ { id: bib["id"], class: biblio ? "Biblio" : "NormRef" }
102
104
  end
103
105
 
104
- def iso_title(b)
105
- title = b.at(ns("./title[@language = '#{@lang}' and @type = 'main']")) ||
106
- b.at(ns("./title[@language = '#{@lang}']")) ||
107
- b.at(ns("./title[@type = 'main']")) ||
108
- b.at(ns("./title"))
109
- title
106
+ def iso_title(bib)
107
+ bib.at(ns("./title[@language = '#{@lang}' and @type = 'main']")) ||
108
+ bib.at(ns("./title[@language = '#{@lang}']")) ||
109
+ bib.at(ns("./title[@type = 'main']")) ||
110
+ bib.at(ns("./title"))
110
111
  end
111
112
 
112
113
  # reference not to be rendered because it is deemed implicit
113
114
  # in the standards environment
114
- def implicit_reference(b)
115
- b["hidden"] == "true"
115
+ def implicit_reference(bib)
116
+ bib["hidden"] == "true"
116
117
  end
117
118
 
118
119
  def prefix_bracketed_ref(ref, text)
@@ -120,35 +121,37 @@ module IsoDoc::Function
120
121
  insert_tab(ref, 1)
121
122
  end
122
123
 
123
- def reference_format(b, r)
124
- if ftitle = b.at(ns("./formattedref"))
125
- ftitle&.children&.each { |n| parse(n, r) }
124
+ def reference_format(bib, out)
125
+ if ftitle = bib.at(ns("./formattedref"))
126
+ ftitle&.children&.each { |n| parse(n, out) }
126
127
  else
127
- title = iso_title(b)
128
- r.i do |i|
129
- title&.children&.each { |n| parse(n, i) }
128
+ out.i do |i|
129
+ iso_title(bib)&.children&.each { |n| parse(n, i) }
130
130
  end
131
131
  end
132
132
  end
133
133
 
134
- def is_standard(b)
134
+ def is_standard(bib)
135
135
  ret = false
136
- b.xpath(ns("./docidentifier")).each do |id|
137
- next if id["type"].nil? ||
138
- %w(metanorma DOI ISSN ISBN).include?(id["type"])
136
+ drop = %w(metanorma DOI ISSN ISBN)
137
+ bib.xpath(ns("./docidentifier")).each do |id|
138
+ next if id["type"].nil? || drop.include?(id["type"])
139
+
139
140
  ret = true
140
141
  end
141
142
  ret
142
143
  end
143
144
 
144
- def biblio_list(f, div, biblio)
145
+ def biblio_list(refs, div, biblio)
145
146
  i = 0
146
- f.children.each do |b|
147
+ refs.children.each do |b|
147
148
  if b.name == "bibitem"
148
149
  next if implicit_reference(b)
150
+
149
151
  i += 1
150
- (is_standard(b)) ? std_bibitem_entry(div, b, i, biblio) :
151
- nonstd_bibitem(div, b, i, biblio)
152
+ if is_standard(b) then std_bibitem_entry(div, b, i, biblio)
153
+ else nonstd_bibitem(div, b, i, biblio)
154
+ end
152
155
  else
153
156
  parse(b, div) unless %w(title).include? b.name
154
157
  end
@@ -167,14 +170,13 @@ module IsoDoc::Function
167
170
  clause_name(num, f.at(ns("./title")), div, nil)
168
171
  if f.name == "clause"
169
172
  f.elements.each { |e| parse(e, div) unless e.name == "title" }
170
- else
171
- biblio_list(f, div, false)
173
+ else biblio_list(f, div, false)
172
174
  end
173
175
  end
174
176
  num
175
177
  end
176
178
 
177
- def bibliography_xpath
179
+ def bibliography_xpath
178
180
  "//bibliography/clause[.//references]"\
179
181
  "[not(.//references[@normative = 'true'])] | "\
180
182
  "//bibliography/references[@normative = 'false']"
@@ -184,7 +186,7 @@ module IsoDoc::Function
184
186
  f = isoxml.at(ns(bibliography_xpath)) and f["hidden"] != "true" or return
185
187
  page_break(out)
186
188
  out.div do |div|
187
- div.h1 **{class: "Section3"} do |h1|
189
+ div.h1 **{ class: "Section3" } do |h1|
188
190
  f&.at(ns("./title"))&.children&.each { |c2| parse(c2, h1) }
189
191
  end
190
192
  biblio_list(f, div, true)
@@ -193,19 +195,11 @@ module IsoDoc::Function
193
195
 
194
196
  def bibliography_parse(node, out)
195
197
  node["hidden"] != true or return
196
- title = node&.at(ns("./title"))&.text || ""
197
198
  out.div do |div|
198
199
  clause_parse_title(node, div, node.at(ns("./title")), out,
199
200
  { class: "Section3" })
200
201
  biblio_list(node, div, true)
201
202
  end
202
203
  end
203
-
204
- def format_ref(ref, prefix, isopub, date, allparts)
205
- ref = docid_prefix(prefix, ref)
206
- return "[#{ref}]" if ref && /^\d+$/.match(ref) && !prefix &&
207
- !/^\[.*\]$/.match(ref)
208
- ref
209
- end
210
204
  end
211
205
  end
@@ -8,11 +8,11 @@ module IsoDoc::Function
8
8
  insert_tab(out, 1)
9
9
  end
10
10
 
11
- def inline_header_title(out, node, title)
11
+ def inline_header_title(out, _node, title)
12
12
  out.span **{ class: "zzMoveToFollowing" } do |s|
13
13
  s.b do |b|
14
14
  title&.children&.each { |c2| parse(c2, b) }
15
- clausedelimspace(out) if /\S/.match(title&.text)
15
+ clausedelimspace(out) if /\S/.match?(title&.text)
16
16
  end
17
17
  end
18
18
  end
@@ -20,12 +20,14 @@ module IsoDoc::Function
20
20
  # used for subclauses
21
21
  def clause_parse_title(node, div, title, out, header_class = {})
22
22
  return if title.nil?
23
+
23
24
  if node["inline-header"] == "true"
24
25
  inline_header_title(out, node, title)
25
26
  else
26
- depth = (title && title["depth"]) ? title["depth"] :
27
- node.ancestors("clause, annex, terms, references, definitions, "\
28
- "acknowledgements, introduction, foreword").size + 1
27
+ depth = if title && title["depth"] then title["depth"]
28
+ else node.ancestors("clause, annex, terms, references, definitions, "\
29
+ "acknowledgements, introduction, foreword").size + 1
30
+ end
29
31
  div.send "h#{depth}", **attr_code(header_class) do |h|
30
32
  title&.children&.each { |c2| parse(c2, h) }
31
33
  end
@@ -49,8 +51,11 @@ module IsoDoc::Function
49
51
  def clause_name(_num, title, div, header_class)
50
52
  header_class = {} if header_class.nil?
51
53
  div.h1 **attr_code(header_class) do |h1|
52
- title.is_a?(String) ? h1 << title :
54
+ if title.is_a?(String)
55
+ h1 << title
56
+ else
53
57
  title&.children&.each { |c2| parse(c2, h1) }
58
+ end
54
59
  end
55
60
  div.parent.at(".//h1")
56
61
  end
@@ -66,8 +71,9 @@ module IsoDoc::Function
66
71
  end
67
72
  end
68
73
 
69
- def annex_name(annex, name, div)
74
+ def annex_name(_annex, name, div)
70
75
  return if name.nil?
76
+
71
77
  div.h1 **{ class: "Annex" } do |t|
72
78
  name.children.each { |c2| parse(c2, t) }
73
79
  end
@@ -144,7 +150,6 @@ module IsoDoc::Function
144
150
 
145
151
  def introduction(isoxml, out)
146
152
  f = isoxml.at(ns("//introduction")) || return
147
- title_attr = { class: "IntroTitle" }
148
153
  page_break(out)
149
154
  out.div **{ class: "Section3", id: f["id"] } do |div|
150
155
  clause_name(nil, f.at(ns("./title")), div, { class: "IntroTitle" })
@@ -160,7 +165,6 @@ module IsoDoc::Function
160
165
  out.div **attr_code(id: f["id"]) do |s|
161
166
  clause_name(nil, f.at(ns("./title")) || @i18n.foreword, s,
162
167
  { class: "ForewordTitle" })
163
- #s.h1(**{ class: "ForewordTitle" }) { |h1| h1 << @i18n.foreword }
164
168
  f.elements.each { |e| parse(e, s) unless e.name == "title" }
165
169
  end
166
170
  end
@@ -187,12 +191,11 @@ module IsoDoc::Function
187
191
  end
188
192
 
189
193
  def preface(isoxml, out)
190
- title_attr = { class: "IntroTitle" }
191
194
  isoxml.xpath(ns("//preface/clause | //preface/references | "\
192
195
  "//preface/definitions | //preface/terms")).each do |f|
193
196
  page_break(out)
194
197
  out.div **{ class: "Section3", id: f["id"] } do |div|
195
- clause_name(nil, f&.at(ns("./title")), div, title_attr)
198
+ clause_name(nil, f&.at(ns("./title")), div, { class: "IntroTitle" })
196
199
  f.elements.each do |e|
197
200
  parse(e, div) unless e.name == "title"
198
201
  end
@@ -202,37 +205,46 @@ module IsoDoc::Function
202
205
 
203
206
  def is_clause?(name)
204
207
  %w(clause references definitions terms foreword introduction abstract
205
- acknowledgements).include? name
208
+ acknowledgements).include? name
206
209
  end
207
210
 
208
211
  def preface_block(isoxml, out)
209
212
  p = isoxml.at(ns("//preface")) or return
210
213
  p.elements.each do |e|
211
214
  next if is_clause?(e.name)
215
+
212
216
  parse(e, out)
213
217
  end
214
218
  end
215
219
 
216
220
  def copyright_parse(node, out)
217
- out.div **{class: "boilerplate-copyright"} do |div|
221
+ return if @bare
222
+
223
+ out.div **{ class: "boilerplate-copyright" } do |div|
218
224
  node.children.each { |n| parse(n, div) }
219
225
  end
220
226
  end
221
227
 
222
228
  def license_parse(node, out)
223
- out.div **{class: "boilerplate-license"} do |div|
229
+ return if @bare
230
+
231
+ out.div **{ class: "boilerplate-license" } do |div|
224
232
  node.children.each { |n| parse(n, div) }
225
233
  end
226
234
  end
227
235
 
228
236
  def legal_parse(node, out)
229
- out.div **{class: "boilerplate-legal"} do |div|
237
+ return if @bare
238
+
239
+ out.div **{ class: "boilerplate-legal" } do |div|
230
240
  node.children.each { |n| parse(n, div) }
231
241
  end
232
242
  end
233
243
 
234
244
  def feedback_parse(node, out)
235
- out.div **{class: "boilerplate-feedback"} do |div|
245
+ return if @bare
246
+
247
+ out.div **{ class: "boilerplate-feedback" } do |div|
236
248
  node.children.each { |n| parse(n, div) }
237
249
  end
238
250
  end