metanorma-itu 1.0.15 → 1.0.16

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: 1716cf558f18bf55eec7bd90d86283304f0ff55fc7d8f384f0f85ce7808fdcc6
4
- data.tar.gz: 3bb69ae66bfd7e2a1f8a791a7b1536f204830a40c16ae6ca972c5e7e86510190
3
+ metadata.gz: 1075b0ab1b5ce442ec5e1048b390b717a0722dfb66b5130c934f4a0eaf39caca
4
+ data.tar.gz: 6d5d755eaf6cfea89ca934e0f54b9c0ef2042da3b289e4fb0297ae7f7efa6267
5
5
  SHA512:
6
- metadata.gz: 6e76f70372f778f9d487af3b6e2f7af48bee0fe0275b7facd4562d5106588f8e0141ea5a2af3113312674c946db7c39ac5b6a5a15065ffce3a493b6ec54947da
7
- data.tar.gz: c3b7170b688848cd7dec19f96a504a5ae55a86645bae0bb11b48ea8ca9a84541c6d6033a526e8ae82cc80cba6a1e07f2b9d58b36fe244597ab3e4d6da1e30556
6
+ metadata.gz: cef7bfe22e96dda2a19678c7f04f60c5a82f76544e6e29f9ae77a34873cc13413139b26c2c84cdbc736438531a034a9c934bc8e9bce96b4d2a6534520948ab75
7
+ data.tar.gz: 932eb30b185032d66a843bb9981e40cb103df654096528742c9029bb092f500b83f11de6553ffc30ec64867b584d54ff750e8bf00e03fde4f4bc467b76110047
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/ubuntu.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-macos:
12
15
  name: Test on Ruby ${{ matrix.ruby }} macOS
13
16
  runs-on: macos-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -5,16 +5,26 @@ name: ubuntu
5
5
  on:
6
6
  push:
7
7
  branches: [ master ]
8
+ tags:
9
+ - '*'
8
10
  pull_request:
11
+ paths-ignore:
12
+ - .github/workflows/macos.yml
13
+ - .github/workflows/windows.yml
9
14
 
10
15
  jobs:
11
16
  test-linux:
12
17
  name: Test on Ruby ${{ matrix.ruby }} Ubuntu
13
18
  runs-on: ubuntu-latest
19
+ continue-on-error: ${{ matrix.experimental }}
14
20
  strategy:
15
21
  fail-fast: false
16
22
  matrix:
17
23
  ruby: [ '2.6', '2.5', '2.4' ]
24
+ experimental: [false]
25
+ include:
26
+ - ruby: '2.7'
27
+ experimental: true
18
28
  steps:
19
29
  - uses: actions/checkout@master
20
30
  - name: Use Ruby
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/ubuntu.yml
9
12
 
10
13
  jobs:
11
14
  test-windows:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Windows
13
16
  runs-on: windows-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -3,9 +3,6 @@ module Asciidoctor
3
3
  class Converter < Standoc::Converter
4
4
  def sections_cleanup(x)
5
5
  super
6
- x.xpath("//*[@inline-header]").each do |h|
7
- h.delete("inline-header")
8
- end
9
6
  insert_missing_sections(x) unless @no_insert_missing_sections
10
7
  end
11
8
 
@@ -44,8 +41,10 @@ module Asciidoctor
44
41
  "<bibliography><sentinel/></bibliography>"
45
42
  ins = x.at("//bibliography").elements.first
46
43
  unless x.at("//bibliography/references[@normative = 'true']")
47
- ins.previous = "<references normative='true'><title>References</title><p>"\
48
- "#{@labels['clause_empty']}</p></references>"
44
+ #ins.previous = "<references normative='true'><title>References</title><p>"\
45
+ # "#{@labels['clause_empty']}</p></references>"
46
+ ins.previous = "<references normative='true'><title>References</title>"\
47
+ "</references>"
49
48
  end
50
49
  x&.at("//sentinel")&.remove
51
50
  end
@@ -62,7 +61,7 @@ module Asciidoctor
62
61
  ins = x.at("//sections/terms") ||
63
62
  x.at("//sections/clause[descendant::terms]")
64
63
  unless x.at("//sections//definitions")
65
- ins.next = "<definitions><title>Definitions</title><p>"\
64
+ ins.next = "<definitions><title>Abbreviations and acronyms</title><p>"\
66
65
  "#{@labels['clause_empty']}</p></definitions>"
67
66
  end
68
67
  end
@@ -71,46 +70,47 @@ module Asciidoctor
71
70
  ins = x.at("//sections//definitions") ||
72
71
  x.at("//sections/clause[descendant::definitions]")
73
72
  unless x.at("//sections/clause/title[text() = 'Conventions']")
74
- ins.next = "<clause><title>Conventions</title><p>"\
75
- "#{@labels['clause_empty']}</p></clause>"
76
- end
77
- end
73
+ ins.next = "<clause id='_#{UUIDTools::UUID.random_create}'>"\
74
+ "<title>Conventions</title><p>"\
75
+ "#{@labels['clause_empty']}</p></clause>"
76
+ end
77
+ end
78
78
 
79
- def cleanup(xmldoc)
80
- symbols_cleanup(xmldoc)
81
- super
82
- obligations_cleanup(xmldoc)
83
- xmldoc
84
- end
79
+ def cleanup(xmldoc)
80
+ symbols_cleanup(xmldoc)
81
+ super
82
+ obligations_cleanup(xmldoc)
83
+ xmldoc
84
+ end
85
85
 
86
- def smartquotes_cleanup(xmldoc)
87
- return super if @smartquotes
88
- xmldoc.traverse do |n|
86
+ def smartquotes_cleanup(xmldoc)
87
+ return super if @smartquotes
88
+ xmldoc.traverse do |n|
89
89
  next unless n.text?
90
90
  n.replace(HTMLEntities.new.encode(
91
91
  n.text.gsub(/\u2019|\u2018|\u201a|\u201b/, "'").
92
92
  gsub(/\u201c|\u201d|\u201e|\u201f/, '"'), :basic))
93
- end
94
- xmldoc
95
- end
93
+ end
94
+ xmldoc
95
+ end
96
96
 
97
- def termdef_cleanup(xmldoc)
98
- xmldoc.xpath("//term/preferred").each do |p|
97
+ def termdef_cleanup(xmldoc)
98
+ xmldoc.xpath("//term/preferred").each do |p|
99
99
  if ["terms defined elsewhere",
100
- "terms defined in this recommendation"].include? p.text.downcase
101
- p.name = "title"
102
- p.parent.name = "terms"
100
+ "terms defined in this recommendation"].include? p.text.downcase
101
+ p.name = "title"
102
+ p.parent.name = "terms"
103
+ end
104
+ end
105
+ super
103
106
  end
104
- end
105
- super
106
- end
107
107
 
108
- def termdef_boilerplate_cleanup(xmldoc)
109
- end
108
+ def termdef_boilerplate_cleanup(xmldoc)
109
+ end
110
110
 
111
- def symbols_cleanup(xmldoc)
112
- sym = xmldoc.at("//definitions/title")
113
- sym and sym&.next_element&.name == "dl" and
111
+ def symbols_cleanup(xmldoc)
112
+ sym = xmldoc.at("//definitions/title")
113
+ sym and sym&.next_element&.name == "dl" and
114
114
  sym.next = "<p>#{@symbols_boilerplate}</p>"
115
115
  end
116
116
 
@@ -118,55 +118,55 @@ module Asciidoctor
118
118
 
119
119
  def pub_class(bib)
120
120
  return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ITU']")
121
- return 1 if bib.at("#{PUBLISHER}[name = 'International "\
122
- "Telecommunication Union']")
123
- return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
124
- return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
125
- "for Standardization']")
126
- return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
127
- return 3 if bib.at("#{PUBLISHER}[name = 'International "\
128
- "Electrotechnical Commission']")
129
- return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
130
- "@type = 'metanorma' or @type = 'ISSN' or @type = "\
131
- "'ISBN')]")
132
- 5
133
- end
121
+ return 1 if bib.at("#{PUBLISHER}[name = 'International "\
122
+ "Telecommunication Union']")
123
+ return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
124
+ return 2 if bib.at("#{PUBLISHER}[name = 'International Organization "\
125
+ "for Standardization']")
126
+ return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
127
+ return 3 if bib.at("#{PUBLISHER}[name = 'International "\
128
+ "Electrotechnical Commission']")
129
+ return 4 if bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
130
+ "@type = 'metanorma' or @type = 'ISSN' or @type = "\
131
+ "'ISBN')]")
132
+ 5
133
+ end
134
134
 
135
- def sort_biblio(bib)
136
- bib.sort do |a, b|
137
- sort_biblio_key(a) <=> sort_biblio_key(b)
135
+ def sort_biblio(bib)
136
+ bib.sort do |a, b|
137
+ sort_biblio_key(a) <=> sort_biblio_key(b)
138
+ end
138
139
  end
139
- end
140
140
 
141
- # sort by: doc class (ITU, ISO, IEC, other standard (not DOI &c), other
142
- # then standard class (docid class other than DOI &c)
143
- # then alphanumeric doc id (not DOI &c)
144
- # then title
145
- def sort_biblio_key(bib)
146
- pubclass = pub_class(bib)
147
- num = bib&.at("./docnumber")&.text
148
- id = bib&.at("./docidentifier[not(@type = 'DOI' or @type = "\
149
- "'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
150
- metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
151
- abbrid = metaid unless /^\[\d+\]$/.match(metaid)
152
- type = id['type'] if id
153
- title = bib&.at("./title[@type = 'main']")&.text ||
154
- bib&.at("./title")&.text || bib&.at("./formattedref")&.text
155
- "#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
156
- end
141
+ # sort by: doc class (ITU, ISO, IEC, other standard (not DOI &c), other
142
+ # then standard class (docid class other than DOI &c)
143
+ # then alphanumeric doc id (not DOI &c)
144
+ # then title
145
+ def sort_biblio_key(bib)
146
+ pubclass = pub_class(bib)
147
+ num = bib&.at("./docnumber")&.text
148
+ id = bib&.at("./docidentifier[not(@type = 'DOI' or @type = "\
149
+ "'metanorma' or @type = 'ISSN' or @type = 'ISBN')]")
150
+ metaid = bib&.at("./docidentifier[@type = 'metanorma']")&.text
151
+ abbrid = metaid unless /^\[\d+\]$/.match(metaid)
152
+ type = id['type'] if id
153
+ title = bib&.at("./title[@type = 'main']")&.text ||
154
+ bib&.at("./title")&.text || bib&.at("./formattedref")&.text
155
+ "#{pubclass} :: #{type} :: #{id&.text || metaid} :: #{title}"
156
+ end
157
157
 
158
- def biblio_reorder(xmldoc)
159
- xmldoc.xpath("//references").each do |r|
160
- biblio_reorder1(r)
158
+ def biblio_reorder(xmldoc)
159
+ xmldoc.xpath("//references").each do |r|
160
+ biblio_reorder1(r)
161
+ end
161
162
  end
162
- end
163
163
 
164
- def normref_cleanup(xmldoc)
165
- super
166
- r = xmldoc.at(NORM_REF) || return
167
- title = r.at("./title") and
168
- title.content = "References"
164
+ def normref_cleanup(xmldoc)
165
+ super
166
+ r = xmldoc.at(NORM_REF) || return
167
+ title = r.at("./title") and
168
+ title.content = "References"
169
+ end
169
170
  end
170
171
  end
171
172
  end
172
- end
@@ -137,6 +137,13 @@ module Asciidoctor
137
137
  super
138
138
  end
139
139
 
140
+ def metadata_keywords(node, xml)
141
+ return unless node.attr("keywords")
142
+ node.attr("keywords").split(/,[ ]*/).sort.each_with_index do |kw, i|
143
+ xml.keyword (i == 0 ? kw.capitalize : kw)
144
+ end
145
+ end
146
+
140
147
  def html_extract_attributes(node)
141
148
  super.merge(hierarchical_assets: node.attr("hierarchical-object-numbering"))
142
149
  end
@@ -39,6 +39,31 @@ module Asciidoctor
39
39
  end
40
40
  end
41
41
 
42
+ def title(node, xml)
43
+ super
44
+ subtitle_english(node, xml)
45
+ subtitle_otherlangs(node, xml)
46
+ end
47
+
48
+ def subtitle_english(node, xml)
49
+ at = { language: "en", format: "text/plain", type: "subtitle" }
50
+ a = node.attr("subtitle") || node.attr("subtitle-en")
51
+ xml.title **attr_code(at) do |t|
52
+ t << Asciidoctor::Standoc::Utils::asciidoc_sub(a)
53
+ end
54
+ end
55
+
56
+ def subtitle_otherlangs(node, xml)
57
+ node.attributes.each do |k, v|
58
+ next unless /^subtitle-(?<lang>.+)$/ =~ k
59
+ next if lang == "en"
60
+ xml.title **attr_code(language: lang, format: "text/plain",
61
+ type: "subtitle") do |t|
62
+ t << v
63
+ end
64
+ end
65
+ end
66
+
42
67
  def metadata_author(node, xml)
43
68
  xml.contributor do |c|
44
69
  c.role **{ type: "author" }
@@ -143,6 +143,8 @@ module IsoDoc
143
143
  id = @meta.get[:docnumber] and p << "Recommendation #{id}"
144
144
  end
145
145
  out.p(**{ class: "zzSTDTitle2" }) { |p| p << @meta.get[:doctitle] }
146
+ s = @meta.get[:docsubtitle] and
147
+ out.p(**{ class: "zzSTDTitle3" }) { |p| p << s }
146
148
  end
147
149
 
148
150
  def add_parse(node, out)
@@ -107,7 +107,7 @@ span.doc-title {
107
107
  padding: 0 3em 0 6em;
108
108
  }
109
109
 
110
- .zzSTDTitle1, .zzSTDTitle2, .MsoCommentText {
110
+ .zzSTDTitle1, .zzSTDTitle2, .zzSTDTitle3, .MsoCommentText {
111
111
  display: none;
112
112
  }
113
113
 
@@ -53,10 +53,10 @@
53
53
  <span class="doc-title">{{ doctitle }}</span>
54
54
  {% if docsubtitle %}
55
55
  <br/><span class="doc-subtitle">{{ docsubtitle }}</span>
56
+ {% endif %}
56
57
  {% if annextitle %}
57
58
  <br/><span class="doctitle">{{ annextitle }}</span>
58
59
  {% endif %}
59
- {% endif %}
60
60
  </div>
61
61
 
62
62
 
@@ -98,9 +98,11 @@
98
98
  </div>
99
99
  -->
100
100
 
101
+ {% if unpublished %}
101
102
  <div class="coverpage-warning">
102
103
  <div id="draft-warning-destination"/>
103
104
  </div>
105
+ {% endif %}
104
106
 
105
107
  <div class="info-section">
106
108
  <div id="boilerplate-copyright-destination"/>
@@ -185,7 +185,7 @@ pre {
185
185
  }
186
186
 
187
187
  #ITU-logo {
188
- width: 200px;
188
+ width: 150px;
189
189
  height: auto;
190
190
  margin-left: auto;
191
191
  }
@@ -620,6 +620,29 @@ p.zzSTDTitle2, li.zzSTDTitle2, div.zzSTDTitle2
620
620
  font-weight:bold;
621
621
  text-align:center;
622
622
  mso-bidi-font-weight:normal;}
623
+ p.zzSTDTitle3, li.zzSTDTitle3, div.zzSTDTitle3
624
+ {mso-style-name:zzSTDTitle;
625
+ mso-style-noshow:yes;
626
+ mso-style-unhide:no;
627
+ mso-style-next:Normal;
628
+ margin-top:0pt;
629
+ margin-right:0cm;
630
+ margin-bottom:18.0pt;
631
+ margin-left:0cm;
632
+ line-height:17.5pt;
633
+ mso-line-height-rule:exactly;
634
+ mso-pagination:widow-orphan;
635
+ mso-hyphenate:none;
636
+ tab-stops:20.15pt;
637
+ font-size:14.0pt;
638
+ mso-bidi-font-size:11.0pt;
639
+ font-family:$headerfont;
640
+ mso-fareast-font-family:$headerfont;
641
+ mso-bidi-font-family:$headerfont;
642
+ mso-ansi-language:EN-GB;
643
+ font-style:italic;
644
+ text-align:center;
645
+ mso-bidi-font-weight:normal;}
623
646
  p.Quote, li.Quote, div.Quote
624
647
  {mso-style-priority:99;
625
648
  margin-top:0cm;
@@ -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() {
@@ -104,6 +104,8 @@ style='mso-ansi-language:EN-US'> 

104
104
  <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
105
105
  style='mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
106
106
 
107
+ <div id="sourcebox"/>
108
+
107
109
  <p class=MsoNormal><span style='mso-bookmark:_Hlk526346232'><span lang=EN-US
108
110
  style='mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span></span></p>
109
111
 
@@ -1561,7 +1561,7 @@ p.Tablebody, li.Tablebody, div.Tablebody
1561
1561
  mso-level-tab-stop:none;
1562
1562
  mso-level-number-position:left;
1563
1563
  margin-left:1.4cm;
1564
- text-indent:-0.7cm;}
1564
+ text-indent:-1.4cm;}
1565
1565
  @list l4:level2
1566
1566
  {mso-level-text:"%2\)";
1567
1567
  mso-level-number-format:alpha-lower;
@@ -15,8 +15,10 @@ module IsoDoc
15
15
  end
16
16
 
17
17
  def title(isoxml, _out)
18
- main = isoxml&.at(ns("//bibdata/title[@language='en']"))&.text
18
+ main = isoxml&.at(ns("//bibdata/title[@language='#{@lang}'][@type = 'main']"))&.text
19
19
  set(:doctitle, main)
20
+ main = isoxml&.at(ns("//bibdata/title[@language='#{@lang}'][@type = 'subtitle']"))&.text
21
+ set(:docsubtitle, main)
20
22
  series = isoxml&.at(ns("//bibdata/series[@type='main']/title"))&.text
21
23
  set(:series, series)
22
24
  series1 =
@@ -18,7 +18,8 @@ module IsoDoc
18
18
 
19
19
  def nonstd_bibitem(list, b, ordinal, biblio)
20
20
  list.p **attr_code(iso_bibitem_entry_attrs(b, biblio)) do |ref|
21
- ref << "[#{render_identifier(bibitem_ref_code(b))}]"
21
+ id = render_identifier(bibitem_ref_code(b))
22
+ ref << (id[0] || "[#{id[1]}]")
22
23
  date_note_process(b, ref)
23
24
  insert_tab(ref, 1)
24
25
  reference_format(b, ref)
@@ -29,6 +30,12 @@ module IsoDoc
29
30
  nonstd_bibitem(list, b, ordinal, biblio)
30
31
  end
31
32
 
33
+ def bracket_if_num(x)
34
+ return nil if x.nil?
35
+ x = x.text.sub(/^\[/, "").sub(/\]$/, "")
36
+ "[#{x}]"
37
+ end
38
+
32
39
  def reference_format(b, r)
33
40
  reference_format_start(b, r)
34
41
  reference_format_title(b, r)
@@ -38,20 +45,13 @@ module IsoDoc
38
45
  s.gsub(/ |\_|\-/, " ").split(/ /).map(&:capitalize).join(" ")
39
46
  end
40
47
 
41
- IGNORE_IDS =
42
- "@type = 'DOI' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor'".freeze
43
-
44
- def bibitem_ref_code(b)
45
- id = b.at(ns("./docidentifier[@type = 'metanorma']"))
46
- id ||= b.at(ns("./docidentifier[@type = 'ITU']"))
47
- id ||= b.at(ns("./docidentifier[not(#{IGNORE_IDS})]"))
48
- id ||= b.at(ns("./docidentifier"))
49
- return id if id
50
- id = Nokogiri::XML::Node.new("docidentifier", b.document)
51
- id.text = "(NO ID)"
52
- id
48
+ def pref_ref_code(b)
49
+ b.at(ns("./docidentifier[@type = 'ITU']")) || super
53
50
  end
54
51
 
52
+ IGNORE_IDS =
53
+ "@type = 'DOI' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor'".freeze
54
+
55
55
  def multi_bibitem_ref_code(b)
56
56
  id = b.xpath(ns("./docidentifier[not(@type = 'metanorma' or #{IGNORE_IDS})]"))
57
57
  id.empty? and id = b.xpath(ns("./docidentifier[not(@type = 'metanorma')]"))
@@ -59,7 +59,7 @@ module IsoDoc
59
59
  id.sort_by { |i| i["type"] == "ITU" ? 0 : 1 }
60
60
  end
61
61
 
62
- def render_identifiers(ids)
62
+ def render_multi_identifiers(ids)
63
63
  ids.map do |id|
64
64
  id["type"] == "ITU" ? doctype_title(id) :
65
65
  docid_prefix(id["type"], id.text.sub(/^\[/, "").sub(/\]$/, ""))
@@ -78,7 +78,7 @@ module IsoDoc
78
78
 
79
79
  def reference_format_start(b, r)
80
80
  id = multi_bibitem_ref_code(b)
81
- id1 = render_identifiers(id)
81
+ id1 = render_multi_identifiers(id)
82
82
  r << id1
83
83
  date = b.at(ns("./date[@type = 'published']")) and
84
84
  r << " (#{date.text.sub(/-.*$/, '')})"
@@ -97,8 +97,9 @@ module IsoDoc
97
97
  end
98
98
  end
99
99
 
100
- def format_ref(ref, prefix, isopub, date, allparts)
101
- docid_prefix(prefix, ref).sub(/^\[/, "").sub(/\]$/, "")
100
+ def reference_names(ref)
101
+ super
102
+ @anchors[ref["id"]] = { xref: @anchors[ref["id"]][:xref].sub(/^\[/, '').sub(/\]$/, '') }
102
103
  end
103
104
  end
104
105
  end
@@ -48,7 +48,7 @@ module IsoDoc
48
48
  kw.nil? || kw.empty? and return
49
49
  out.div do |div|
50
50
  clause_name(nil, "Keywords", div, class: "IntroTitle")
51
- div.p kw.sort.join(", ") + "."
51
+ div.p kw.join(", ") + "."
52
52
  end
53
53
  end
54
54
 
@@ -105,12 +105,15 @@ module IsoDoc
105
105
  super
106
106
  abstractbox = docxml.at("//div[@id='abstractbox']")
107
107
  historybox = docxml.at("//div[@id='historybox']")
108
+ sourcebox = docxml.at("//div[@id='sourcebox']")
108
109
  keywordsbox = docxml.at("//div[@id='keywordsbox']")
109
110
  abstract = docxml.at("//p[@class = 'h1Preface' and text() = 'Summary']/..")
110
111
  history = docxml.at("//p[@class = 'h1Preface' and text() = 'History']/..")
112
+ source = docxml.at("//p[@class = 'h1Preface' and text() = 'Source']/..")
111
113
  keywords = docxml.at("//p[@class = 'h1Preface' and text() = 'Keywords']/..")
112
114
  abstract.parent = abstractbox if abstract && abstractbox
113
115
  history.parent = historybox if history && historybox
116
+ source.parent = sourcebox if source && sourcebox
114
117
  keywords.parent = keywordsbox if keywords && keywordsbox
115
118
  end
116
119
 
@@ -3,7 +3,11 @@ require "metanorma/processor"
3
3
  module Metanorma
4
4
  module ITU
5
5
  def self.fonts_used
6
- ["Arial", "Courier New", "Times New Roman"]
6
+ {
7
+ html: ["Arial", "Courier New", "Times New Roman"],
8
+ doc: ["Arial", "Courier New", "Times New Roman"],
9
+ pdf: ["Arial", "Courier New", "Times New Roman"]
10
+ }
7
11
  end
8
12
 
9
13
  class Processor < Metanorma::Processor
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.0.15"
3
+ VERSION = "1.0.16"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-13 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -269,7 +269,6 @@ files:
269
269
  - lib/isodoc/itu/html/itu.scss
270
270
  - lib/isodoc/itu/html/logo.png
271
271
  - lib/isodoc/itu/html/scripts.html
272
- - lib/isodoc/itu/html/scripts.pdf.html
273
272
  - lib/isodoc/itu/html/word_itu_intro.html
274
273
  - lib/isodoc/itu/html/word_itu_titlepage.html
275
274
  - lib/isodoc/itu/html/wordstyle.scss
@@ -1,72 +0,0 @@
1
- <script>
2
- //TOC generation
3
- $('#toc').toc({
4
- 'selectors': toclevel(), //elements to use as headings
5
- 'container': 'main', //element to find all selectors in
6
- 'smoothScrolling': true, //enable or disable smooth scrolling on click
7
- 'prefix': 'toc', //prefix for anchor tags and class names
8
- 'onHighlight': function(el) {}, //called when a new section is highlighted
9
- 'highlightOnScroll': false, //add class to heading that is currently in focus
10
- 'highlightOffset': 100, //offset to trigger the next headline
11
- 'anchorName': function(i, heading, prefix) { //custom function for anchor name
12
- return prefix+i;
13
- },
14
- 'headerText': function(i, heading, $heading) { //custom function building the header-item text
15
- return $heading.text();
16
- },
17
- 'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
18
- return $heading[0].tagName.toLowerCase();
19
- }
20
- });
21
-
22
- </script>
23
-
24
- <script>
25
- //TOC toggle animation
26
- $('#toggle').on('click', function(){
27
- if( $('nav').is(':visible') ) {
28
- $('nav').animate({ 'left': '-353px' }, 'slow', function(){
29
- $('nav').hide();
30
- });
31
- $('.container').animate({ 'padding-left': '31px' }, 'slow');
32
- }
33
- else {
34
- $('nav').show();
35
- $('nav').animate({ 'left': '0px' }, 'slow');
36
- $('.container').animate({ 'padding-left': '360px' }, 'slow');
37
- }
38
- });
39
- </script>
40
-
41
- <script>
42
- // Scroll to top button
43
- window.onscroll = function() {scrollFunction()};
44
-
45
- function scrollFunction() {
46
- if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
47
- document.getElementById("myBtn").style.display = "block";
48
- } else {
49
- document.getElementById("myBtn").style.display = "none";
50
- }
51
- }
52
-
53
- // When the user clicks on the button, scroll to the top of the document
54
- function topFunction() {
55
- document.body.scrollTop = 0;
56
- document.documentElement.scrollTop = 0;
57
- }
58
- </script>
59
-
60
- <script>
61
- /*
62
- $(document).ready(function() {
63
- $('[id^=toc]').each(function ()
64
- {
65
- var currentToc = $(this);
66
- var url = window.location.href;
67
- currentToc.wrap("<a href='" + url + "#" + currentToc.attr("id") + "' </a>");
68
- });
69
- });
70
- */
71
- </script>
72
-