metanorma-nist 1.0.7 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,22 @@
30
30
  <data type="boolean"/>
31
31
  </attribute>
32
32
  </optional>
33
+ <optional>
34
+ <attribute name="number"/>
35
+ </optional>
33
36
  <optional>
34
37
  <attribute name="subsequence"/>
35
38
  </optional>
39
+ <optional>
40
+ <attribute name="keep-with-next">
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="keep-lines-together">
46
+ <data type="boolean"/>
47
+ </attribute>
48
+ </optional>
36
49
  <attribute name="id">
37
50
  <data type="ID"/>
38
51
  </attribute>
@@ -141,6 +154,16 @@
141
154
  <data type="boolean"/>
142
155
  </attribute>
143
156
  </optional>
157
+ <optional>
158
+ <attribute name="keep-with-next">
159
+ <data type="boolean"/>
160
+ </attribute>
161
+ </optional>
162
+ <optional>
163
+ <attribute name="keep-lines-together">
164
+ <data type="boolean"/>
165
+ </attribute>
166
+ </optional>
144
167
  <oneOrMore>
145
168
  <ref name="BasicBlock"/>
146
169
  </oneOrMore>
@@ -1,19 +1,19 @@
1
1
  require "isodoc"
2
2
  require_relative "metadata"
3
- require_relative "xrefs"
3
+ require_relative "xref"
4
4
  require_relative "refs"
5
+ require_relative "section"
5
6
  require "fileutils"
6
7
 
7
8
  module IsoDoc
8
9
  module NIST
9
10
  module BaseConvert
10
- def abstract(isoxml, out)
11
- f = isoxml.at(ns("//preface/abstract")) || return
12
- #page_break(out)
13
- out.div **attr_code(id: f["id"]) do |s|
14
- clause_name(nil, @abstract_lbl, s, class: "AbstractTitle")
15
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
16
- end
11
+ def metadata_init(lang, script, labels)
12
+ @meta = Metadata.new(lang, script, labels)
13
+ end
14
+
15
+ def xref_init(lang, script, klass, labels, options)
16
+ @xrefs = Xref.new(lang, script, klass, labels, options)
17
17
  end
18
18
 
19
19
  def keywords(_docxml, out)
@@ -25,27 +25,8 @@ module IsoDoc
25
25
  end
26
26
  end
27
27
 
28
- FRONT_CLAUSE = "//*[parent::preface][not(local-name() = 'abstract' or local-name() = 'foreword')]".freeze
29
-
30
- # All "[preface]" sections should have class "IntroTitle" to prevent
31
- # page breaks
32
- # But for the Exec Summary
33
- def preface(isoxml, out)
34
- isoxml.xpath(ns(FRONT_CLAUSE)).each do |c|
35
- next if skip_render(c, isoxml)
36
- title = c&.at(ns("./title"))
37
- patent = ["Call for Patent Claims", "Patent Disclosure Notice"].include? title&.text
38
- out.div **attr_code(id: c["id"]) do |s|
39
- page_break(s) if patent
40
- clause_name(anchor(c['id'], :label), title, s,
41
- class: (c.name == "executivesummary") ? "NormalTitle" :
42
- "IntroTitle")
43
- c.elements.reject { |c1| c1.name == "title" }.each do |c1|
44
- parse(c1, s)
45
- end
46
- end
47
- end
48
- end
28
+ FRONT_CLAUSE = "//*[parent::preface][not(local-name() = 'abstract' or "\
29
+ "local-name() = 'foreword')]".freeze
49
30
 
50
31
  def skip_render(c, isoxml)
51
32
  return false unless c.name == "reviewernote"
@@ -121,7 +102,7 @@ module IsoDoc
121
102
 
122
103
  def errata_parse(node, out)
123
104
  out.a **{ name: "errata_XYZZY" }
124
- out.table **make_table_attr(node) do |t|
105
+ out.table **table_attrs(node) do |t|
125
106
  errata_head(t)
126
107
  errata_body(t, node)
127
108
  end
@@ -153,17 +134,18 @@ module IsoDoc
153
134
  end
154
135
  end
155
136
 
156
- MIDDLE_CLAUSE = "//clause[parent::sections] | "\
157
- "//terms[parent::sections]".freeze
137
+ def middle_clause
138
+ "//clause[parent::sections] | //terms[parent::sections]"
139
+ end
158
140
 
159
141
  def middle(isoxml, out)
142
+ middle_admonitions(isoxml, out)
160
143
  clause isoxml, out
161
144
  bibliography isoxml, out
162
145
  annex isoxml, out
163
146
  end
164
147
 
165
148
  def info(isoxml, out)
166
- @meta.keywords isoxml, out
167
149
  @meta.series isoxml, out
168
150
  @meta.commentperiod isoxml, out
169
151
  @meta.note isoxml, out
@@ -176,13 +158,15 @@ module IsoDoc
176
158
  end
177
159
 
178
160
  def get_linkend(node)
179
- link = anchor_linkend(node, docid_l10n(node["target"] || wrap_brackets(node['citeas'])))
180
- link += eref_localities(node.xpath(ns("./locality | ./localityStack")), link)
181
- contents = node.children.select { |c| !%w{locality localityStack}.include? c.name }
161
+ link = anchor_linkend(node, docid_l10n(node["target"] ||
162
+ wrap_brackets(node['citeas'])))
163
+ link += eref_localities(node.xpath(ns("./locality | ./localityStack")),
164
+ link)
165
+ contents = node.children.select do |c|
166
+ !%w{locality localityStack}.include? c.name
167
+ end
182
168
  return link if contents.nil? || contents.empty?
183
169
  Nokogiri::XML::NodeSet.new(node.document, contents).to_xml
184
- # so not <origin bibitemid="ISO7301" citeas="ISO 7301">
185
- # <locality type="section"><reference>3.1</reference></locality></origin>
186
170
  end
187
171
 
188
172
  def load_yaml(lang, script)
@@ -205,36 +189,56 @@ module IsoDoc
205
189
  end
206
190
  end
207
191
 
208
- def bibliography_parse(node, out)
209
- title = node&.at(ns("./title"))&.text || ""
210
- out.div do |div|
211
- unless suppress_biblio_title(node)
212
- anchor(node['id'], :label, false) and
213
- clause_parse_title(node, div, node.at(ns("./title")), out) or
214
- div.h2 title, **{ class: "Section3" }
215
- end
216
- biblio_list(node, div, true)
192
+ def termref_parse(node, out)
193
+ end
194
+
195
+ def term_cleanup(docxml)
196
+ docxml.xpath("//table[@class = 'terms_dl']").each do |d|
197
+ prev = d.previous_element
198
+ next unless prev && prev.name == "table" &&
199
+ prev["class"] == "terms_dl"
200
+ d.children.each { |n| prev.add_child(n.remove) }
201
+ d.remove
217
202
  end
203
+ docxml
218
204
  end
219
205
 
220
- def suppress_biblio_title(node)
221
- return false unless node.parent.name == "annex"
222
- return false if node.parent.xpath("./references | ./clause | "\
223
- "./terms | ./definitions").size > 1
224
- title1 = node&.at(ns("./title"))&.text
225
- return true unless title1
226
- title2 = node&.parent&.at(ns("./title"))&.text
227
- title1&.casecmp(title2) == 0
206
+ def term_and_termref_parse(node, dt)
207
+ pref = node.at(ns("./preferred"))
208
+ source = node.xpath(ns("./termsource"))
209
+ pref.children.each { |n| parse(n, dt) }
210
+ return if source.empty?
211
+ dt << "<br/>"
212
+ source.each_with_index do |s, i|
213
+ i > 0 and dt << "; "
214
+ s.elements.each { |n| parse(n, dt) }
215
+ end
228
216
  end
229
217
 
230
- def foreword(isoxml, out)
231
- f = isoxml.at(ns("//foreword")) || return
232
- out.div **attr_code(id: f["id"]) do |s|
233
- title = f.at(ns("./title"))
234
- s.h1(**{ class: "ForewordTitle" }) do |h1|
235
- title and title.children.each { |e| parse(e, h1) }
218
+ def term_rest_parse(node, dd)
219
+ set_termdomain("")
220
+ node.children.each do |n|
221
+ parse(n, dd) unless %w(preferred termsource).include?(n.name)
222
+ end
223
+ end
224
+
225
+ def modification_parse(node, out)
226
+ out << @modified_lbl
227
+ node.at(ns("./p[text()[normalize-space() != '']]")) and
228
+ out << " &mdash; "
229
+ node.at(ns("./p")).children.each { |n| parse(n, out) }
230
+ end
231
+
232
+ def annex_name(annex, name, div)
233
+ div.h1 **{ class: "Annex" } do |t|
234
+ t << "#{@xrefs.anchor(annex['id'], :label)} &mdash; "
235
+ t.b do |b|
236
+ if @bibliographycount == 1 && annex.at(ns("./references"))
237
+ b << "References"
238
+ else
239
+ name&.children&.each { |c2| parse(c2, b) }
240
+ end
236
241
  end
237
- f.elements.each { |e| parse(e, s) unless e.name == "title" }
238
242
  end
239
243
  end
240
244
  end
@@ -66,7 +66,7 @@ img#NIST-logo {
66
66
  height: auto;
67
67
  }
68
68
 
69
- .authors-container {
69
+ .authors-container, .currency {
70
70
  margin-top: 2em;
71
71
  }
72
72
 
@@ -163,7 +163,7 @@
163
163
 
164
164
 
165
165
  {% unless unpublished %}
166
- <div class="coverpage-logo">
166
+ <div class="currency">
167
167
  <span>{{ issueddate_monthyear }}</span>
168
168
  {%if confirmeddate and confirmeddate != "XXX" %}
169
169
  <br/>Publication is current as of {{ confirmeddate_MMMddyyyy }}
@@ -693,7 +693,7 @@ div.Admonition {
693
693
  mso-ansi-language:EN-AU;
694
694
  }
695
695
 
696
- div Admonotion p {
696
+ div.Admonition p {
697
697
  margin-top:6.0pt;margin-right:0cm;
698
698
  margin-bottom:6.0pt;margin-left:0cm;text-align:left;mso-pagination:widow-orphan;
699
699
  mso-hyphenate:auto;background:#dddddd;mso-layout-grid-align:auto;mso-vertical-align-alt:
@@ -643,7 +643,7 @@ div.Admonition {
643
643
  mso-ansi-language:EN-AU;
644
644
  }
645
645
 
646
- div Admonotion p {
646
+ div.Admonition p {
647
647
  margin-top:6.0pt;margin-right:0cm;
648
648
  margin-bottom:6.0pt;margin-left:0cm;text-align:left;mso-pagination:widow-orphan;
649
649
  mso-hyphenate:auto;background:#dddddd;mso-layout-grid-align:auto;mso-vertical-align-alt:
@@ -42,13 +42,16 @@ $('#toggle').on('click', function(){
42
42
  </script>
43
43
 
44
44
  <script>
45
- /**
46
- * AnchorJS - v4.1.0 - 2017-09-20
47
- * https://github.com/bryanbraun/anchorjs
48
- * Copyright (c) 2017 Bryan Braun; Licensed MIT
49
- */
50
- !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function e(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64}function t(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}function i(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}this.options=A||{},this.elements=[],e(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var n,o,s,a,r,c,h,l,u,d,f,p=[];if(e(this.options),"touch"===(f=this.options.visible)&&(f=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(n=t(A)).length)return this;for(i(),o=document.querySelectorAll("[id]"),s=[].map.call(o,function(A){return A.id}),r=0;r<n.length;r++)if(this.hasAnchorJSLink(n[r]))p.push(r);else{if(n[r].hasAttribute("id"))a=n[r].getAttribute("id");else if(n[r].hasAttribute("data-anchor-id"))a=n[r].getAttribute("data-anchor-id");else{u=l=this.urlify(n[r].textContent),h=0;do{void 0!==c&&(u=l+"-"+h),c=s.indexOf(u),h+=1}while(-1!==c);c=void 0,s.push(u),n[r].setAttribute("id",u),a=u}a.replace(/-/g," "),(d=document.createElement("a")).className="anchorjs-link "+this.options.class,d.href="#"+a,d.setAttribute("aria-label",this.options.ariaLabel),d.setAttribute("data-anchorjs-icon",this.options.icon),"always"===f&&(d.style.opacity="1"),""===this.options.icon&&(d.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(d.style.lineHeight="inherit")),"left"===this.options.placement?(d.style.position="absolute",d.style.marginLeft="-1em",d.style.paddingRight="0.5em",n[r].insertBefore(d,n[r].firstChild)):(d.style.paddingLeft="0.375em",n[r].appendChild(d))}for(r=0;r<p.length;r++)n.splice(p[r]-r,1);return this.elements=this.elements.concat(n),this},this.remove=function(A){for(var e,i,n=t(A),o=0;o<n.length;o++)(i=n[o].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(n[o]))&&this.elements.splice(e,1),n[o].removeChild(i));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){var t=/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g;return this.options.truncate||e(this.options),A.trim().replace(/\'/gi,"").replace(t,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&(" "+A.firstChild.className+" ").indexOf(" anchorjs-link ")>-1,t=A.lastChild&&(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ")>-1;return e||t||!1}}}); </script>
51
-
45
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
46
+ //
47
+ // AnchorJS - v4.2.2 - 2020-04-20
48
+ // https://www.bryanbraun.com/anchorjs/
49
+ // Copyright (c) 2020 Bryan Braun; Licensed MIT
50
+ //
51
+ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt Expat
52
+ !function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),0===(e=p(A=A||"h2, h3, h4, h5, h6")).length)return this;for(!function(){if(null!==document.head.querySelector("style.anchorjs"))return;var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"],style'))?document.head.appendChild(e):document.head.insertBefore(e,A);e.sheet.insertRule(".anchorjs-link{opacity:0;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}",e.sheet.cssRules.length),e.sheet.insertRule(":hover>.anchorjs-link,.anchorjs-link:focus{opacity:1}",e.sheet.cssRules.length),e.sheet.insertRule("[data-anchorjs-icon]::after{content:attr(data-anchorjs-icon)}",e.sheet.cssRules.length),e.sheet.insertRule('@font-face{font-family:anchorjs-icons;src:url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype")}',e.sheet.cssRules.length)}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
53
+ // @license-end
54
+ </script>
52
55
  <script>
53
56
  /*
54
57
  $(document).ready(function() {
@@ -20,9 +20,11 @@ module IsoDoc
20
20
 
21
21
  def default_fonts(options)
22
22
  {
23
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Libre Baskerville",serif'),
24
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Libre Baskerville",serif'),
25
- monospacefont: '"Space Mono",monospace'
23
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
24
+ '"Libre Baskerville",serif'),
25
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
26
+ '"Libre Baskerville",serif'),
27
+ monospacefont: '"Space Mono",monospace'
26
28
  }
27
29
  end
28
30
 
@@ -35,10 +37,6 @@ module IsoDoc
35
37
  }
36
38
  end
37
39
 
38
- def metadata_init(lang, script, labels)
39
- @meta = Metadata.new(lang, script, labels)
40
- end
41
-
42
40
  def googlefonts
43
41
  <<~HEAD.freeze
44
42
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,600,600i" rel="stylesheet">
@@ -48,28 +46,34 @@ module IsoDoc
48
46
  end
49
47
 
50
48
  def toclevel
51
- ret = toclevel_classes.map { |l| "#{l}:not(:empty):not(.TermNum):not(.noTOC):not(.AbstractTitle):not(.IntroTitle):not(.ForewordTitle)" }
52
- <<~HEAD.freeze
49
+ ret = toclevel_classes.map do |l|
50
+ "#{l}:not(:empty):not(.TermNum):not(.noTOC):not(.AbstractTitle):"\
51
+ "not(.IntroTitle):not(.ForewordTitle)"
52
+ end
53
+ <<~HEAD.freeze
53
54
  function toclevel() { return "#{ret.join(',')}";}
54
- HEAD
55
- end
55
+ HEAD
56
+ end
56
57
 
57
58
  def html_toc(docxml)
58
- idx = docxml.at("//div[@id = 'toc']") or return docxml
59
- toc = "<ul>"
60
- path = toclevel_classes.map do |l|
61
- "//main//#{l}[not(@class = 'TermNum')][not(@class = 'noTOC')][not(text())][not(@class = 'AbstractTitle')][not(@class = 'IntroTitle')][not(@class = 'ForewordTitle')]"
62
- end
63
- docxml.xpath(path.join(" | ")).each_with_index do |h, tocidx|
64
- h["id"] ||= "toc#{tocidx}"
65
- toc += html_toc_entry(h.name, h)
59
+ idx = docxml.at("//div[@id = 'toc']") or return docxml
60
+ toc = "<ul>"
61
+ path = toclevel_classes.map do |l|
62
+ "//main//#{l}[not(@class = 'TermNum')][not(@class = 'noTOC')]"\
63
+ "[text()][not(@class = 'AbstractTitle')]"\
64
+ "[not(@class = 'IntroTitle')][not(@class = 'ForewordTitle')]"
65
+ end
66
+ docxml.xpath(path.join(" | ")).each_with_index do |h, tocidx|
67
+ h["id"] ||= "toc#{tocidx}"
68
+ toc += html_toc_entry(h.name, h)
69
+ end
70
+ idx.children = "#{toc}</ul>"
71
+ docxml
66
72
  end
67
- idx.children = "#{toc}</ul>"
68
- docxml
69
- end
70
73
 
71
74
  def make_body(xml, docxml)
72
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
75
+ body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72",
76
+ "xml:lang": "EN-US", class: "container" }
73
77
  xml.body **body_attr do |body|
74
78
  make_body1(body, docxml)
75
79
  make_body2(body, docxml)
@@ -77,10 +81,6 @@ module IsoDoc
77
81
  end
78
82
  end
79
83
 
80
- def html_toc(docxml)
81
- docxml
82
- end
83
-
84
84
  def authority_cleanup(docxml)
85
85
  dest = docxml.at("//div[@id = 'authority']") || return
86
86
  auth = docxml.at("//div[@class = 'authority']") || return
@@ -102,6 +102,7 @@ module IsoDoc
102
102
  super
103
103
  term_cleanup(docxml)
104
104
  requirement_cleanup(docxml)
105
+ docxml
105
106
  end
106
107
 
107
108
  def make_body3(body, docxml)
@@ -117,56 +118,17 @@ module IsoDoc
117
118
  end
118
119
  end
119
120
 
120
- def bibliography(isoxml, out)
121
- f = isoxml.at(ns("//bibliography/clause | //bibliography/references")) || return
122
- page_break(out)
123
- isoxml.xpath(ns("//bibliography/clause | //bibliography/references")).each do |f|
124
- out.div do |div|
125
- div.h1 **{ class: "Section3" } do |h1|
126
- if @bibliographycount == 1 then h1 << "References"
127
- else
128
- f&.at(ns("./title"))&.children.each { |n| parse(n, h1) }
129
- end
130
- end
131
- biblio_list(f, div, false)
132
- end
133
- end
134
- end
135
-
136
- def keywords(_docxml, out)
137
- kw = @meta.get[:keywords]
138
- kw.empty? and return
139
- out.div **{ class: "Section3" } do |div|
140
- out.div do |div|
141
- clause_name(nil, "Keywords", div, class: "IntroTitle")
142
- div.p kw.sort.join("; ")
143
- end
144
- end
145
- end
146
-
147
121
  def termdef_parse(node, out)
148
- pref = node.at(ns("./preferred"))
149
122
  out.dl **{ class: "terms_dl" } do |dl|
150
123
  dl.dt do |dt|
151
- pref.children.each { |n| parse(n, dt) }
124
+ term_and_termref_parse(node, dt)
152
125
  end
153
- set_termdomain("")
154
126
  dl.dd do |dd|
155
- node.children.each { |n| parse(n, dd) unless n.name == "preferred" }
127
+ term_rest_parse(node, dd)
156
128
  end
157
129
  end
158
130
  end
159
131
 
160
- def term_cleanup(docxml)
161
- docxml.xpath("//table[@class = 'terms_dl']").each do |d|
162
- prev = d.previous_element
163
- next unless prev and prev.name == "table" and prev["class"] == "terms_dl"
164
- d.children.each { |n| prev.add_child(n.remove) }
165
- d.remove
166
- end
167
- docxml
168
- end
169
-
170
132
  include BaseConvert
171
133
  end
172
134
  end
@@ -116,12 +116,6 @@ module IsoDoc
116
116
  Date.parse(isodate).strftime("%m-%d-%Y")
117
117
  end
118
118
 
119
- def keywords(ixml, _out)
120
- keywords = []
121
- ixml.xpath(ns("//bibdata/keyword")).each { |kw| keywords << kw.text }
122
- set(:keywords, keywords)
123
- end
124
-
125
119
  def commentperiod(ixml, _out)
126
120
  from = ixml.at(ns("//bibdata/ext/commentperiod/from"))&.text
127
121
  to = ixml.at(ns("//bibdata/ext/commentperiod/to"))&.text