isodoc 1.6.2 → 1.6.7

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 (58) 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 -6
  5. data/Rakefile +2 -2
  6. data/isodoc.gemspec +3 -2
  7. data/lib/isodoc-yaml/i18n-en.yaml +1 -0
  8. data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
  9. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  10. data/lib/isodoc.rb +0 -2
  11. data/lib/isodoc/convert.rb +7 -1
  12. data/lib/isodoc/function/blocks.rb +5 -4
  13. data/lib/isodoc/function/cleanup.rb +52 -43
  14. data/lib/isodoc/function/inline.rb +7 -7
  15. data/lib/isodoc/function/references.rb +32 -51
  16. data/lib/isodoc/function/section.rb +28 -16
  17. data/lib/isodoc/function/table.rb +21 -22
  18. data/lib/isodoc/function/terms.rb +6 -7
  19. data/lib/isodoc/function/to_word_html.rb +6 -3
  20. data/lib/isodoc/function/utils.rb +181 -163
  21. data/lib/isodoc/gem_tasks.rb +8 -9
  22. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  23. data/lib/isodoc/html_convert.rb +5 -1
  24. data/lib/isodoc/html_function/comments.rb +14 -12
  25. data/lib/isodoc/html_function/footnotes.rb +14 -7
  26. data/lib/isodoc/html_function/html.rb +30 -26
  27. data/lib/isodoc/html_function/postprocess.rb +191 -182
  28. data/lib/isodoc/html_function/sectionsplit.rb +230 -0
  29. data/lib/isodoc/metadata.rb +22 -20
  30. data/lib/isodoc/metadata_contributor.rb +31 -28
  31. data/lib/isodoc/pdf_convert.rb +11 -13
  32. data/lib/isodoc/presentation_function/bibdata.rb +61 -30
  33. data/lib/isodoc/presentation_function/inline.rb +34 -27
  34. data/lib/isodoc/presentation_function/section.rb +54 -19
  35. data/lib/isodoc/presentation_xml_convert.rb +2 -0
  36. data/lib/isodoc/sassc_importer.rb +1 -1
  37. data/lib/isodoc/version.rb +1 -1
  38. data/lib/isodoc/word_function/postprocess.rb +50 -36
  39. data/lib/isodoc/xref.rb +2 -0
  40. data/lib/isodoc/xref/xref_counter.rb +1 -2
  41. data/lib/isodoc/xref/xref_gen.rb +21 -14
  42. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  43. data/lib/isodoc/xref/xref_sect_gen.rb +15 -15
  44. data/spec/assets/scripts_override.html +3 -0
  45. data/spec/isodoc/blocks_spec.rb +624 -997
  46. data/spec/isodoc/cleanup_spec.rb +40 -42
  47. data/spec/isodoc/i18n_spec.rb +694 -821
  48. data/spec/isodoc/inline_spec.rb +482 -328
  49. data/spec/isodoc/metadata_spec.rb +384 -379
  50. data/spec/isodoc/postproc_spec.rb +163 -55
  51. data/spec/isodoc/presentation_xml_spec.rb +355 -278
  52. data/spec/isodoc/ref_spec.rb +5 -5
  53. data/spec/isodoc/section_spec.rb +216 -199
  54. data/spec/isodoc/sectionsplit_spec.rb +190 -0
  55. data/spec/isodoc/table_spec.rb +41 -42
  56. data/spec/isodoc/terms_spec.rb +84 -84
  57. data/spec/isodoc/xref_spec.rb +974 -932
  58. metadata +22 -5
@@ -10,9 +10,9 @@ module IsoDoc::Function
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
@@ -20,21 +20,21 @@ module IsoDoc::Function
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
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
 
@@ -45,16 +45,16 @@ module IsoDoc::Function
45
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 "\
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
58
  "@type = 'ISBN']"))
59
59
  return [id, id1, id2] if id || id1 || id2
60
60
 
@@ -72,20 +72,10 @@ module IsoDoc::Function
72
72
  num
73
73
  end
74
74
 
75
- def render_identifier(id)
76
- [
77
- bracket_if_num(id[0]),
78
- if id[1].nil?
79
- nil
80
- else
81
- docid_prefix(id[1]["type"], id[1].text.sub(/^\[/, "").sub(/\]$/, ""))
82
- end,
83
- if id[2].nil?
84
- nil
85
- else
86
- docid_prefix(id[2]["type"], id[2].text.sub(/^\[/, "").sub(/\]$/, ""))
87
- end,
88
- ]
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(/\]$/, "")]
89
79
  end
90
80
 
91
81
  def docid_prefix(prefix, docid)
@@ -97,19 +87,20 @@ module IsoDoc::Function
97
87
  def omit_docid_prefix(prefix)
98
88
  return true if prefix.nil? || prefix.empty?
99
89
 
100
- %w(ISO IEC IEV ITU W3C csd metanorma rfc-anchor).include? prefix
90
+ %w(ISO IEC IEV ITU W3C csd metanorma repository rfc-anchor)
91
+ .include? prefix
101
92
  end
102
93
 
103
- def date_note_process(b, ref)
104
- 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']"))
105
96
  return if date_note.nil?
106
97
 
107
98
  date_note.children.first.replace("<p>#{date_note.content}</p>")
108
99
  footnote_parse(date_note, ref)
109
100
  end
110
101
 
111
- def iso_bibitem_entry_attrs(b, biblio)
112
- { id: b["id"], class: biblio ? "Biblio" : "NormRef" }
102
+ def iso_bibitem_entry_attrs(bib, biblio)
103
+ { id: bib["id"], class: biblio ? "Biblio" : "NormRef" }
113
104
  end
114
105
 
115
106
  def iso_title(bib)
@@ -130,22 +121,21 @@ module IsoDoc::Function
130
121
  insert_tab(ref, 1)
131
122
  end
132
123
 
133
- def reference_format(bib, r)
124
+ def reference_format(bib, out)
134
125
  if ftitle = bib.at(ns("./formattedref"))
135
- ftitle&.children&.each { |n| parse(n, r) }
126
+ ftitle&.children&.each { |n| parse(n, out) }
136
127
  else
137
- title = iso_title(bib)
138
- r.i do |i|
139
- title&.children&.each { |n| parse(n, i) }
128
+ out.i do |i|
129
+ iso_title(bib)&.children&.each { |n| parse(n, i) }
140
130
  end
141
131
  end
142
132
  end
143
133
 
144
134
  def is_standard(bib)
145
135
  ret = false
136
+ drop = %w(metanorma DOI ISSN ISBN)
146
137
  bib.xpath(ns("./docidentifier")).each do |id|
147
- next if id["type"].nil? ||
148
- %w(metanorma DOI ISSN ISBN).include?(id["type"])
138
+ next if id["type"].nil? || drop.include?(id["type"])
149
139
 
150
140
  ret = true
151
141
  end
@@ -180,8 +170,7 @@ module IsoDoc::Function
180
170
  clause_name(num, f.at(ns("./title")), div, nil)
181
171
  if f.name == "clause"
182
172
  f.elements.each { |e| parse(e, div) unless e.name == "title" }
183
- else
184
- biblio_list(f, div, false)
173
+ else biblio_list(f, div, false)
185
174
  end
186
175
  end
187
176
  num
@@ -212,13 +201,5 @@ module IsoDoc::Function
212
201
  biblio_list(node, div, true)
213
202
  end
214
203
  end
215
-
216
- def format_ref(ref, prefix, _isopub, _date, _allparts)
217
- ref = docid_prefix(prefix, ref)
218
- return "[#{ref}]" if ref && /^\d+$/.match(ref) && !prefix &&
219
- !/^\[.*\]$/.match(ref)
220
-
221
- ref
222
- end
223
204
  end
224
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
@@ -1,17 +1,16 @@
1
1
  module IsoDoc::Function
2
2
  module Table
3
-
4
3
  def table_title_parse(node, out)
5
4
  name = node.at(ns("./name")) or return
6
5
  out.p **{ class: "TableTitle", style: "text-align:center;" } do |p|
7
- name and name.children.each { |n| parse(n, p) }
6
+ name&.children&.each { |n| parse(n, p) }
8
7
  end
9
8
  end
10
9
 
11
- def thead_parse(node, t)
10
+ def thead_parse(node, table)
12
11
  thead = node.at(ns("./thead"))
13
12
  if thead
14
- t.thead do |h|
13
+ table.thead do |h|
15
14
  thead.element_children.each_with_index do |n, i|
16
15
  tr_parse(n, h, i, thead.element_children.size, true)
17
16
  end
@@ -19,19 +18,19 @@ module IsoDoc::Function
19
18
  end
20
19
  end
21
20
 
22
- def tbody_parse(node, t)
21
+ def tbody_parse(node, table)
23
22
  tbody = node.at(ns("./tbody")) || return
24
- t.tbody do |h|
23
+ table.tbody do |h|
25
24
  tbody.element_children.each_with_index do |n, i|
26
25
  tr_parse(n, h, i, tbody.element_children.size, false)
27
26
  end
28
27
  end
29
28
  end
30
29
 
31
- def tfoot_parse(node, t)
30
+ def tfoot_parse(node, table)
32
31
  tfoot = node.at(ns("./tfoot"))
33
32
  if tfoot
34
- t.tfoot do |h|
33
+ table.tfoot do |h|
35
34
  tfoot.element_children.each_with_index do |n, i|
36
35
  tr_parse(n, h, i, tfoot.element_children.size, false)
37
36
  end
@@ -45,23 +44,23 @@ module IsoDoc::Function
45
44
  id: node["id"],
46
45
  class: "MsoISOTable",
47
46
  style: "border-width:1px;border-spacing:0;#{width}#{keep_style(node)}",
48
- title: node["alt"]
47
+ title: node["alt"],
49
48
  )
50
49
  end
51
50
 
52
- def tcaption(node, t)
51
+ def tcaption(node, table)
53
52
  return unless node["summary"]
54
53
 
55
- t.caption do |c|
54
+ table.caption do |c|
56
55
  c.span **{ style: "display:none" } do |s|
57
56
  s << node["summary"]
58
57
  end
59
58
  end
60
59
  end
61
60
 
62
- def colgroup(node, t)
61
+ def colgroup(node, table)
63
62
  colgroup = node.at(ns("./colgroup")) or return
64
- t.colgroup do |cg|
63
+ table.colgroup do |cg|
65
64
  colgroup.xpath(ns("./col")).each do |c|
66
65
  cg.col **{ style: "width: #{c['width']};" }
67
66
  end
@@ -90,19 +89,19 @@ module IsoDoc::Function
90
89
  # border-left:#{col.zero? ? "#{SW} 1.5pt;" : "none;"}
91
90
  # border-right:#{SW} #{col == totalcols && !header ? "1.5" : "1.0"}pt;
92
91
 
93
- def make_tr_attr(td, row, totalrows, header)
94
- style = td.name == "th" ? "font-weight:bold;" : ""
95
- td["align"] and style += "text-align:#{td['align']};"
96
- td["valign"] and style += "vertical-align:#{td['valign']};"
97
- rowmax = td["rowspan"] ? row + td["rowspan"].to_i - 1 : row
92
+ def make_tr_attr(cell, row, totalrows, header)
93
+ style = cell.name == "th" ? "font-weight:bold;" : ""
94
+ cell["align"] and style += "text-align:#{cell['align']};"
95
+ cell["valign"] and style += "vertical-align:#{cell['valign']};"
96
+ rowmax = cell["rowspan"] ? row + cell["rowspan"].to_i - 1 : row
98
97
  style += <<~STYLE
99
98
  border-top:#{row.zero? ? "#{SW} 1.5pt;" : 'none;'}
100
99
  border-bottom:#{SW} #{rowmax == totalrows ? '1.5' : '1.0'}pt;
101
100
  STYLE
102
- header and scope = (td["colspan"] ? "colgroup" : "col")
103
- !header and td.name == "th" and scope =
104
- (td["rowspan"] ? "rowgroup" : "row")
105
- { rowspan: td["rowspan"], colspan: td["colspan"],
101
+ header and scope = (cell["colspan"] ? "colgroup" : "col")
102
+ !header and cell.name == "th" and scope =
103
+ (cell["rowspan"] ? "rowgroup" : "row")
104
+ { rowspan: cell["rowspan"], colspan: cell["colspan"],
106
105
  style: style.gsub(/\n/, ""), scope: scope }
107
106
  end
108
107
 
@@ -11,27 +11,27 @@ module IsoDoc::Function
11
11
  end
12
12
 
13
13
  def deprecated_term_parse(node, out)
14
- out.p **{ class: "DeprecatedTerms", style:"text-align:left;" } do |p|
14
+ out.p **{ class: "DeprecatedTerms", style: "text-align:left;" } do |p|
15
15
  p << l10n("#{@i18n.deprecated}: ")
16
16
  node.children.each { |c| parse(c, p) }
17
17
  end
18
18
  end
19
19
 
20
20
  def admitted_term_parse(node, out)
21
- out.p **{ class: "AltTerms", style:"text-align:left;" } do |p|
21
+ out.p **{ class: "AltTerms", style: "text-align:left;" } do |p|
22
22
  node.children.each { |c| parse(c, p) }
23
23
  end
24
24
  end
25
25
 
26
26
  def term_parse(node, out)
27
- out.p **{ class: "Terms", style:"text-align:left;" } do |p|
27
+ out.p **{ class: "Terms", style: "text-align:left;" } do |p|
28
28
  node.children.each { |c| parse(c, p) }
29
29
  end
30
30
  end
31
31
 
32
- def para_then_remainder(first, node, p, div)
32
+ def para_then_remainder(first, node, para, div)
33
33
  if first.name == "p"
34
- first.children.each { |n| parse(n, p) }
34
+ first.children.each { |n| parse(n, para) }
35
35
  node.elements.drop(1).each { |n| parse(n, div) }
36
36
  else
37
37
  node.elements.each { |n| parse(n, div) }
@@ -72,7 +72,6 @@ module IsoDoc::Function
72
72
  node.children.each { |n| parse(n, out) }
73
73
  end
74
74
 
75
- def termdocsource_parse(_node, _out)
76
- end
75
+ def termdocsource_parse(_node, _out); end
77
76
  end
78
77
  end
@@ -21,9 +21,10 @@ module IsoDoc::Function
21
21
  filename = filepath.sub_ext("").sub(/\.presentation$/, "").to_s
22
22
  dir = init_dir(filename, debug)
23
23
  @filename = filename
24
- @localdir = filepath.parent.to_s + "/"
24
+ @localdir = "#{filepath.parent}/"
25
25
  @sourcedir = @localdir
26
- @sourcefilename and @sourcedir = Pathname.new(@sourcefilename).parent.to_s + "/"
26
+ @sourcefilename and
27
+ @sourcedir = "#{Pathname.new(@sourcefilename).parent}/"
27
28
  [filename, dir]
28
29
  end
29
30
 
@@ -47,7 +48,7 @@ module IsoDoc::Function
47
48
 
48
49
  # isodoc.css overrides any CSS injected by Html2Doc, which
49
50
  # is inserted before this CSS.
50
- def define_head(head, filename, _dir)
51
+ def define_head(head, _filename, _dir)
51
52
  if @standardstylesheet
52
53
  head.style do |style|
53
54
  @standardstylesheet.open
@@ -128,6 +129,8 @@ module IsoDoc::Function
128
129
  end
129
130
 
130
131
  def boilerplate(node, out)
132
+ return if @bare
133
+
131
134
  boilerplate = node.at(ns("//boilerplate")) or return
132
135
  out.div **{ class: "authority" } do |s|
133
136
  boilerplate.children.each do |n|