metanorma-standoc 2.8.7 → 2.8.9

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: c85d5bbd7c078ea07217f9d0e4eac15edec02f1123a2d631774a7d95e194b5ea
4
- data.tar.gz: 69c26ff7e359967646790c05e81ec9addc1641bd05bf9d1e9bd2e58f330ba24a
3
+ metadata.gz: 3d7a510054b98ebc499b0e59b1a21685ee1dae2a038f2e1ac0cd5f4c8d29d9c8
4
+ data.tar.gz: a748a7834be53490e998f21e4236a1b41d24b13d40522e86ad29ebdf241f80c5
5
5
  SHA512:
6
- metadata.gz: 616aac498897af730a4bd1198011b7bfb310782ca3d1ee940638f753a39c5ee8ef9b0d9d344199d089fef554c757b52dcc1bfafe9dee22b031cf22616bbd358a
7
- data.tar.gz: 88b94f216dc5db91750d334f0555edcf7cef65f8b2c6b011ea6684317dd25817ee216ea9cf935a13f5299710042b996f6f46ea5a784e95d5e2b43760507009b4
6
+ metadata.gz: e23a71d8ce405a29267831a0d0c8fc85c023122265d41b6623c70b3fcb01d33df01f3cfde2afbafdcd79599eebb77a287cc5e680e5dbb1ffa1cbe7c5bd5bd9e4
7
+ data.tar.gz: 421a8574228773ad16ae79d2f33eed300516d7985692c77d15abdfac0569710f40d6827945ec720d604ec4bfb69567304b0ee79465a01699bcca77cf691e899f
@@ -177,6 +177,50 @@ table.rouge-line-table pre {
177
177
  overflow-x: visible;
178
178
  font-size: 100%; }
179
179
 
180
+ a.header {
181
+ color: inherit;
182
+ text-decoration: none; }
183
+
184
+ a.header:hover {
185
+ color: #a53221; }
186
+
187
+ a.header:visited {
188
+ color: inherit;
189
+ text-decoration: none; }
190
+
191
+ a.anchor {
192
+ position: absolute;
193
+ z-index: 1001;
194
+ width: 1.5ex;
195
+ margin-left: -1.5ex;
196
+ display: block;
197
+ text-decoration: none !important;
198
+ visibility: hidden;
199
+ text-align: center;
200
+ font-weight: 400; }
201
+
202
+ a.anchor::before {
203
+ content: "\00A7";
204
+ font-size: .85em;
205
+ display: block;
206
+ padding-top: .1em; }
207
+
208
+ h1 > a.anchor:hover,
209
+ h2 > a.anchor:hover,
210
+ h3 > a.anchor:hover,
211
+ h4 > a.anchor:hover,
212
+ h5 > a.anchor:hover,
213
+ h6 > a.anchor:hover,
214
+ .inline-header > a.anchor:hover,
215
+ h1:hover > a.anchor,
216
+ h2:hover > a.anchor,
217
+ h3:hover > a.anchor,
218
+ h4:hover > a.anchor,
219
+ h5:hover > a.anchor,
220
+ h6:hover > a.anchor,
221
+ .inline-header:hover > a.anchor {
222
+ visibility: visible; }
223
+
180
224
  #brochure-band {
181
225
  background-color: #0AC442; }
182
226
 
@@ -95,7 +95,7 @@
95
95
  <text/>
96
96
  </element>
97
97
  </define>
98
- <define name="LocalizedString1">
98
+ <define name="LocalizedStringAttrs">
99
99
  <optional>
100
100
  <!-- multiple languages and scripts possible: comma delimit them if so -->
101
101
  <attribute name="language"/>
@@ -106,6 +106,10 @@
106
106
  <optional>
107
107
  <attribute name="script"/>
108
108
  </optional>
109
+ </define>
110
+ <define name="LocalizedString1">
111
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
112
+ <ref name="LocalizedStringAttrs"/>
109
113
  <text/>
110
114
  </define>
111
115
  <define name="LocalizedString">
@@ -142,16 +146,8 @@
142
146
  <ref name="LocalizedStringOrXsAny"/>
143
147
  </define>
144
148
  <define name="LocalizedStringOrXsAny1">
145
- <optional>
146
- <!-- multiple languages and scripts possible: comma delimit them if so -->
147
- <attribute name="language"/>
148
- </optional>
149
- <optional>
150
- <attribute name="locale"/>
151
- </optional>
152
- <optional>
153
- <attribute name="script"/>
154
- </optional>
149
+ <!-- multiple languages and scripts possible: comma delimit them if so -->
150
+ <ref name="LocalizedStringAttrs"/>
155
151
  <oneOrMore>
156
152
  <choice>
157
153
  <text/>
@@ -208,6 +204,7 @@
208
204
  </define>
209
205
  <define name="roledescription">
210
206
  <element name="description">
207
+ <ref name="LocalizedStringAttrs"/>
211
208
  <oneOrMore>
212
209
  <ref name="TextElement"/>
213
210
  </oneOrMore>
@@ -335,6 +332,7 @@
335
332
  </define>
336
333
  <define name="affiliationdescription">
337
334
  <element name="description">
335
+ <ref name="LocalizedStringAttrs"/>
338
336
  <oneOrMore>
339
337
  <ref name="TextElement"/>
340
338
  </oneOrMore>
@@ -948,6 +946,7 @@
948
946
  <optional>
949
947
  <attribute name="type"/>
950
948
  </optional>
949
+ <ref name="LocalizedStringAttrs"/>
951
950
  <zeroOrMore>
952
951
  <ref name="TextElement"/>
953
952
  </zeroOrMore>
@@ -1041,15 +1040,7 @@
1041
1040
  <data type="boolean"/>
1042
1041
  </attribute>
1043
1042
  </optional>
1044
- <optional>
1045
- <attribute name="language"/>
1046
- </optional>
1047
- <optional>
1048
- <attribute name="locale"/>
1049
- </optional>
1050
- <optional>
1051
- <attribute name="script"/>
1052
- </optional>
1043
+ <ref name="LocalizedStringAttrs"/>
1053
1044
  <oneOrMore>
1054
1045
  <ref name="TextElement"/>
1055
1046
  </oneOrMore>
@@ -1277,6 +1268,7 @@
1277
1268
  <optional>
1278
1269
  <attribute name="type"/>
1279
1270
  </optional>
1271
+ <ref name="LocalizedStringAttrs"/>
1280
1272
  <oneOrMore>
1281
1273
  <ref name="TextElement"/>
1282
1274
  </oneOrMore>
@@ -1284,9 +1276,15 @@
1284
1276
  </define>
1285
1277
  <define name="bibabstract">
1286
1278
  <element name="abstract">
1287
- <oneOrMore>
1288
- <ref name="TextElement"/>
1289
- </oneOrMore>
1279
+ <ref name="LocalizedStringAttrs"/>
1280
+ <choice>
1281
+ <oneOrMore>
1282
+ <ref name="BasicBlock"/>
1283
+ </oneOrMore>
1284
+ <oneOrMore>
1285
+ <ref name="TextElement"/>
1286
+ </oneOrMore>
1287
+ </choice>
1290
1288
  </element>
1291
1289
  </define>
1292
1290
  <define name="copyright">
@@ -1391,6 +1389,7 @@
1391
1389
  </attribute>
1392
1390
  <optional>
1393
1391
  <element name="description">
1392
+ <ref name="LocalizedStringAttrs"/>
1394
1393
  <oneOrMore>
1395
1394
  <ref name="TextElement"/>
1396
1395
  </oneOrMore>
@@ -10,17 +10,12 @@ module Metanorma
10
10
  Vectory::SvgMapping.new(xmldoc, @localdir).call
11
11
  end
12
12
 
13
- def guid?(str)
14
- /^_[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i
15
- .match(str)
16
- end
17
-
18
13
  def svgmap_moveattrs(xmldoc)
19
14
  xmldoc.xpath("//svgmap").each do |s|
20
15
  f = s.at(".//figure") or next
21
16
  (t = s.at("./name")) && !f.at("./name") and
22
17
  f.children.first.previous = t.remove
23
- if s["id"] && guid?(f["id"])
18
+ if s["id"] && Metanorma::Utils::guid_anchor?(f["id"])
24
19
  f["id"] = s["id"]
25
20
  s.delete("id")
26
21
  end
@@ -165,11 +165,6 @@ module Metanorma
165
165
  end
166
166
  end
167
167
 
168
- def guid?(str)
169
- /^_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
170
- .match?(str)
171
- end
172
-
173
168
  def contenthash_id_cleanup(doc)
174
169
  ids = contenthash_id_make(doc)
175
170
  contenthash_id_update_refs(doc, ids)
@@ -177,7 +172,7 @@ module Metanorma
177
172
 
178
173
  def contenthash_id_make(doc)
179
174
  doc.xpath("//*[@id]").each_with_object({}) do |x, m|
180
- next unless guid?(x["id"])
175
+ next unless Metanorma::Utils::guid_anchor?(x["id"])
181
176
 
182
177
  m[x["id"]] = contenthash(x)
183
178
  x["id"] = m[x["id"]]
@@ -1,6 +1,3 @@
1
- require "date"
2
- require "htmlentities"
3
- require "json"
4
1
  require_relative "cleanup_section_names"
5
2
 
6
3
  module Metanorma
@@ -51,8 +48,9 @@ module Metanorma
51
48
 
52
49
  def clean_abstract(dupabstract)
53
50
  dupabstract.traverse { |n| n.remove_attribute("id") }
54
- dupabstract.remove_attribute("language")
55
- dupabstract.remove_attribute("script")
51
+ %w(language script unnumbered).each do |w|
52
+ dupabstract.remove_attribute(w)
53
+ end
56
54
  dupabstract.at("./title")&.remove
57
55
  dupabstract
58
56
  end
@@ -100,9 +98,9 @@ module Metanorma
100
98
  y.name == "annex" || !y.ancestors("annex").empty? and next
101
99
  y.wrap("<annex/>")
102
100
  y.parent["id"] = "_#{UUIDTools::UUID.random_create}"
103
- y.parent["obligation"] = y["obligation"]
104
- y.parent["language"] = y["language"]
105
- y.parent["script"] = y["script"]
101
+ %w(obligation language script).each do |w|
102
+ y.parent[w] = y[w]
103
+ end
106
104
  end
107
105
  end
108
106
 
@@ -195,7 +193,8 @@ module Metanorma
195
193
  def sections_clausebefore_cleanup(xmldoc)
196
194
  xmldoc.at("//sections") or return
197
195
  ins = insert_before(xmldoc, "//sections")
198
- xmldoc.xpath("//sections//*[@beforeclauses = 'true']").reverse.each do |x|
196
+ xmldoc.xpath("//sections//*[@beforeclauses = 'true']")
197
+ .reverse.each do |x|
199
198
  x.delete("beforeclauses")
200
199
  ins.previous = x.remove
201
200
  end
@@ -204,9 +203,10 @@ module Metanorma
204
203
 
205
204
  # only move clausebefore notes at the very end of preface
206
205
  def endofpreface_clausebefore(xmldoc, ins)
207
- xmldoc.xpath("//preface//*[@beforeclauses = 'true']").reverse.each do |x|
208
- textafternote = xmldoc.xpath("//preface//*") & x.xpath("./following::*")
209
- textafternote.text.strip.empty? or break
206
+ xmldoc.xpath("//preface//*[@beforeclauses = 'true']").reverse
207
+ .each do |x|
208
+ textafter = xmldoc.xpath("//preface//*") & x.xpath("./following::*")
209
+ textafter.text.strip.empty? or break
210
210
  x.delete("beforeclauses")
211
211
  ins.previous = x.remove
212
212
  end
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.0 -->
20
+ <!-- VERSION v1.3.1 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -1346,38 +1346,41 @@
1346
1346
  </oneOrMore>
1347
1347
  </element>
1348
1348
  </define>
1349
+ <define name="Section-Attributes">
1350
+ <optional>
1351
+ <attribute name="id">
1352
+ <data type="ID"/>
1353
+ </attribute>
1354
+ </optional>
1355
+ <optional>
1356
+ <attribute name="language"/>
1357
+ </optional>
1358
+ <optional>
1359
+ <attribute name="script"/>
1360
+ </optional>
1361
+ <optional>
1362
+ <attribute name="inline-header">
1363
+ <data type="boolean"/>
1364
+ </attribute>
1365
+ </optional>
1366
+ <optional>
1367
+ <attribute name="number"/>
1368
+ </optional>
1369
+ <optional>
1370
+ <attribute name="branch-number"/>
1371
+ </optional>
1372
+ <optional>
1373
+ <attribute name="obligation">
1374
+ <choice>
1375
+ <value>normative</value>
1376
+ <value>informative</value>
1377
+ </choice>
1378
+ </attribute>
1379
+ </optional>
1380
+ </define>
1349
1381
  <define name="reference-clause">
1350
1382
  <element name="clause">
1351
- <optional>
1352
- <attribute name="id">
1353
- <data type="ID"/>
1354
- </attribute>
1355
- </optional>
1356
- <optional>
1357
- <attribute name="language"/>
1358
- </optional>
1359
- <optional>
1360
- <attribute name="script"/>
1361
- </optional>
1362
- <optional>
1363
- <attribute name="inline-header">
1364
- <data type="boolean"/>
1365
- </attribute>
1366
- </optional>
1367
- <optional>
1368
- <attribute name="number"/>
1369
- </optional>
1370
- <optional>
1371
- <attribute name="branch-number"/>
1372
- </optional>
1373
- <optional>
1374
- <attribute name="obligation">
1375
- <choice>
1376
- <value>normative</value>
1377
- <value>informative</value>
1378
- </choice>
1379
- </attribute>
1380
- </optional>
1383
+ <ref name="Section-Attributes"/>
1381
1384
  <optional>
1382
1385
  <ref name="section-title"/>
1383
1386
  </optional>
@@ -1566,36 +1569,7 @@
1566
1569
  </element>
1567
1570
  </define>
1568
1571
  <define name="Content-Section">
1569
- <optional>
1570
- <attribute name="id">
1571
- <data type="ID"/>
1572
- </attribute>
1573
- </optional>
1574
- <optional>
1575
- <attribute name="language"/>
1576
- </optional>
1577
- <optional>
1578
- <attribute name="script"/>
1579
- </optional>
1580
- <optional>
1581
- <attribute name="inline-header">
1582
- <data type="boolean"/>
1583
- </attribute>
1584
- </optional>
1585
- <optional>
1586
- <attribute name="obligation">
1587
- <choice>
1588
- <value>normative</value>
1589
- <value>informative</value>
1590
- </choice>
1591
- </attribute>
1592
- </optional>
1593
- <optional>
1594
- <attribute name="number"/>
1595
- </optional>
1596
- <optional>
1597
- <attribute name="branch-number"/>
1598
- </optional>
1572
+ <ref name="Section-Attributes"/>
1599
1573
  <optional>
1600
1574
  <attribute name="type"/>
1601
1575
  </optional>
@@ -1617,39 +1591,10 @@
1617
1591
  </element>
1618
1592
  </define>
1619
1593
  <define name="Clause-Section">
1620
- <optional>
1621
- <attribute name="id">
1622
- <data type="ID"/>
1623
- </attribute>
1624
- </optional>
1625
- <optional>
1626
- <attribute name="language"/>
1627
- </optional>
1628
- <optional>
1629
- <attribute name="script"/>
1630
- </optional>
1631
- <optional>
1632
- <attribute name="inline-header">
1633
- <data type="boolean"/>
1634
- </attribute>
1635
- </optional>
1636
- <optional>
1637
- <attribute name="obligation">
1638
- <choice>
1639
- <value>normative</value>
1640
- <value>informative</value>
1641
- </choice>
1642
- </attribute>
1643
- </optional>
1594
+ <ref name="Section-Attributes"/>
1644
1595
  <optional>
1645
1596
  <attribute name="type"/>
1646
1597
  </optional>
1647
- <optional>
1648
- <attribute name="number"/>
1649
- </optional>
1650
- <optional>
1651
- <attribute name="branch-number"/>
1652
- </optional>
1653
1598
  <optional>
1654
1599
  <ref name="section-title"/>
1655
1600
  </optional>
@@ -1730,34 +1675,10 @@
1730
1675
  </define>
1731
1676
  <define name="terms">
1732
1677
  <element name="terms">
1733
- <optional>
1734
- <attribute name="id">
1735
- <data type="ID"/>
1736
- </attribute>
1737
- </optional>
1738
- <optional>
1739
- <attribute name="language"/>
1740
- </optional>
1741
- <optional>
1742
- <attribute name="script"/>
1743
- </optional>
1678
+ <ref name="Section-Attributes"/>
1744
1679
  <optional>
1745
1680
  <attribute name="type"/>
1746
1681
  </optional>
1747
- <optional>
1748
- <attribute name="number"/>
1749
- </optional>
1750
- <optional>
1751
- <attribute name="branch-number"/>
1752
- </optional>
1753
- <optional>
1754
- <attribute name="obligation">
1755
- <choice>
1756
- <value>normative</value>
1757
- <value>informative</value>
1758
- </choice>
1759
- </attribute>
1760
- </optional>
1761
1682
  <optional>
1762
1683
  <ref name="section-title"/>
1763
1684
  </optional>
@@ -83,6 +83,7 @@ module Metanorma
83
83
  def section_attributes(node)
84
84
  ret =
85
85
  { id: Metanorma::Utils::anchor_or_uuid(node),
86
+ unnumbered: node.option?("unnumbered") ? "true" : nil,
86
87
  annex: role_style(node, "appendix") && node.level == 1 ? true : nil,
87
88
  colophon: role_style(node, "colophon") ? true : nil,
88
89
  preface: role_style(node, "preface") ? true : nil }
@@ -19,6 +19,6 @@ module Metanorma
19
19
  end
20
20
 
21
21
  module Standoc
22
- VERSION = "2.8.7".freeze
22
+ VERSION = "2.8.9".freeze
23
23
  end
24
24
  end
@@ -32,11 +32,11 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "asciidoctor", "~> 2.0.0"
33
33
  spec.add_dependency "crass", "~> 1.0.0"
34
34
  spec.add_dependency "iev", "~> 0.3.0"
35
- spec.add_dependency "isodoc", "~> 2.10.0"
35
+ spec.add_dependency "isodoc", "~> 2.10.2"
36
36
  spec.add_dependency "metanorma", ">= 1.6.0"
37
37
  spec.add_dependency "metanorma-plugin-datastruct", "~> 0.3.0"
38
38
  spec.add_dependency "metanorma-plugin-glossarist", "~> 0.2.0"
39
- spec.add_dependency "metanorma-plugin-lutaml", "~> 0.5.0"
39
+ spec.add_dependency "metanorma-plugin-lutaml", "~> 0.6.0"
40
40
  spec.add_dependency "ruby-jing"
41
41
  # relaton-cli not just relaton, to avoid circular reference in metanorma
42
42
  spec.add_dependency "asciimath2unitsml", "~> 0.4.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-standoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.7
4
+ version: 2.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-08 00:00:00.000000000 Z
11
+ date: 2024-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.10.0
75
+ version: 2.10.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.10.0
82
+ version: 2.10.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: metanorma
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.5.0
131
+ version: 0.6.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.5.0
138
+ version: 0.6.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: ruby-jing
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -573,7 +573,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
573
573
  - !ruby/object:Gem::Version
574
574
  version: '0'
575
575
  requirements: []
576
- rubygems_version: 3.3.26
576
+ rubygems_version: 3.3.27
577
577
  signing_key:
578
578
  specification_version: 4
579
579
  summary: metanorma-standoc realises standards following the Metanorma standoc model