metanorma-iso 2.4.1 → 2.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/base_convert.rb +9 -3
- data/lib/isodoc/iso/html/html_iso_intro.html +0 -1
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +0 -2
- data/lib/isodoc/iso/html/word_iso_intro.html +0 -2
- data/lib/isodoc/iso/iso.amendment.xsl +333 -112
- data/lib/isodoc/iso/iso.international-standard.xsl +333 -112
- data/lib/isodoc/iso/presentation_xml_convert.rb +7 -0
- data/lib/isodoc/iso/sections.rb +10 -10
- data/lib/isodoc/iso/word_cleanup.rb +3 -0
- data/lib/isodoc/iso/word_convert.rb +8 -3
- data/lib/metanorma/iso/isodoc.rng +41 -14
- data/lib/metanorma/iso/isostandard-amd.rng +5 -8
- data/lib/metanorma/iso/isostandard.rng +5 -8
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- metadata +6 -6
@@ -23,6 +23,7 @@ module IsoDoc
|
|
23
23
|
sourcecode docxml
|
24
24
|
formula docxml
|
25
25
|
admonition docxml
|
26
|
+
source docxml
|
26
27
|
ol docxml
|
27
28
|
permission docxml
|
28
29
|
requirement docxml
|
@@ -236,6 +237,12 @@ module IsoDoc
|
|
236
237
|
dlist.remove
|
237
238
|
end
|
238
239
|
|
240
|
+
def toc_title(docxml)
|
241
|
+
doctype = docxml.at(ns("//bibdata/ext/doctype"))&.text
|
242
|
+
%w(amendment technical-corrigendum).include?(doctype) and return
|
243
|
+
super
|
244
|
+
end
|
245
|
+
|
239
246
|
include Init
|
240
247
|
end
|
241
248
|
end
|
data/lib/isodoc/iso/sections.rb
CHANGED
@@ -35,26 +35,26 @@ module IsoDoc
|
|
35
35
|
amd(isoxml) and @suppressheadingnumbers = true
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
=begin
|
39
|
+
def introduction(clause, out)
|
40
40
|
title_attr = { class: "IntroTitle" }
|
41
41
|
page_break(out)
|
42
|
-
out.div class: "Section3", id:
|
43
|
-
clause_name(
|
44
|
-
|
42
|
+
out.div class: "Section3", id: clause["id"] do |div|
|
43
|
+
clause_name(clause, clause.at(ns("./title")), div, title_attr)
|
44
|
+
clause.elements.each do |e|
|
45
45
|
parse(e, div) unless e.name == "title"
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
49
|
+
=end
|
49
50
|
|
50
|
-
def foreword(
|
51
|
-
f = isoxml.at(ns("//foreword")) or return
|
51
|
+
def foreword(clause, out)
|
52
52
|
@foreword = true
|
53
53
|
page_break(out)
|
54
|
-
out.div **attr_code(id:
|
55
|
-
clause_name(nil,
|
54
|
+
out.div **attr_code(id: clause["id"]) do |s|
|
55
|
+
clause_name(nil, clause.at(ns("./title")) || @i18n.foreword, s,
|
56
56
|
{ class: "ForewordTitle" })
|
57
|
-
|
57
|
+
clause.elements.each { |e| parse(e, s) unless e.name == "title" }
|
58
58
|
end
|
59
59
|
@foreword = false
|
60
60
|
end
|
@@ -142,6 +142,9 @@ module IsoDoc
|
|
142
142
|
# supply missing annex title
|
143
143
|
def make_WordToC(docxml, level)
|
144
144
|
toc = ""
|
145
|
+
if source = docxml.at("//div[@class = 'TOC']")
|
146
|
+
toc = to_xml(source.children)
|
147
|
+
end
|
145
148
|
xpath = (1..level).each.map { |i| "//h#{i}" }.join (" | ")
|
146
149
|
docxml.xpath(xpath).each do |h|
|
147
150
|
x = ""
|
@@ -231,14 +231,19 @@ module IsoDoc
|
|
231
231
|
out.div align: "center", class: "table_container" do |div|
|
232
232
|
div.table **table_attrs(node) do |t|
|
233
233
|
table_parse_core(node, t)
|
234
|
-
(
|
235
|
-
node.xpath(ns("./note[not(@type = 'units')]"))
|
236
|
-
.each { |n| parse(n, div) }
|
234
|
+
table_parse_tail(node, t)
|
237
235
|
end
|
238
236
|
end
|
239
237
|
@in_table = false
|
240
238
|
end
|
241
239
|
|
240
|
+
def table_parse_tail(node, out)
|
241
|
+
(dl = node.at(ns("./dl"))) && parse(dl, out)
|
242
|
+
node.xpath(ns("./source")).each { |n| parse(n, out) }
|
243
|
+
node.xpath(ns("./note[not(@type = 'units')]"))
|
244
|
+
.each { |n| parse(n, out) }
|
245
|
+
end
|
246
|
+
|
242
247
|
include BaseConvert
|
243
248
|
include Init
|
244
249
|
end
|
@@ -17,6 +17,7 @@
|
|
17
17
|
these elements; we just want one namespace for any child grammars
|
18
18
|
of this.
|
19
19
|
-->
|
20
|
+
<!-- VERSION v1.2.1 -->
|
20
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">
|
21
22
|
<include href="reqt.rng"/>
|
22
23
|
<include href="basicdoc.rng">
|
@@ -382,6 +383,9 @@
|
|
382
383
|
<optional>
|
383
384
|
<ref name="dl"/>
|
384
385
|
</optional>
|
386
|
+
<optional>
|
387
|
+
<ref name="source"/>
|
388
|
+
</optional>
|
385
389
|
</element>
|
386
390
|
</define>
|
387
391
|
<define name="figure">
|
@@ -404,9 +408,6 @@
|
|
404
408
|
<attribute name="class"/>
|
405
409
|
</optional>
|
406
410
|
<ref name="BlockAttributes"/>
|
407
|
-
<optional>
|
408
|
-
<ref name="source"/>
|
409
|
-
</optional>
|
410
411
|
<optional>
|
411
412
|
<ref name="tname"/>
|
412
413
|
</optional>
|
@@ -431,6 +432,20 @@
|
|
431
432
|
<zeroOrMore>
|
432
433
|
<ref name="note"/>
|
433
434
|
</zeroOrMore>
|
435
|
+
<optional>
|
436
|
+
<ref name="source"/>
|
437
|
+
</optional>
|
438
|
+
</element>
|
439
|
+
</define>
|
440
|
+
<define name="source">
|
441
|
+
<element name="source">
|
442
|
+
<attribute name="status">
|
443
|
+
<ref name="SourceStatusType"/>
|
444
|
+
</attribute>
|
445
|
+
<ref name="origin"/>
|
446
|
+
<optional>
|
447
|
+
<ref name="modification"/>
|
448
|
+
</optional>
|
434
449
|
</element>
|
435
450
|
</define>
|
436
451
|
<define name="sourcecode">
|
@@ -1335,15 +1350,19 @@
|
|
1335
1350
|
</choice>
|
1336
1351
|
</element>
|
1337
1352
|
</define>
|
1353
|
+
<define name="Root-Attributes">
|
1354
|
+
<attribute name="version"/>
|
1355
|
+
<attribute name="schema-version"/>
|
1356
|
+
<attribute name="type">
|
1357
|
+
<choice>
|
1358
|
+
<value>semantic</value>
|
1359
|
+
<value>presentation</value>
|
1360
|
+
</choice>
|
1361
|
+
</attribute>
|
1362
|
+
</define>
|
1338
1363
|
<define name="standard-document">
|
1339
1364
|
<element name="standard-document">
|
1340
|
-
<
|
1341
|
-
<attribute name="type">
|
1342
|
-
<choice>
|
1343
|
-
<value>semantic</value>
|
1344
|
-
<value>presentation</value>
|
1345
|
-
</choice>
|
1346
|
-
</attribute>
|
1365
|
+
<ref name="Root-Attributes"/>
|
1347
1366
|
<ref name="bibdata"/>
|
1348
1367
|
<optional>
|
1349
1368
|
<ref name="misccontainer"/>
|
@@ -2099,10 +2118,7 @@
|
|
2099
2118
|
<define name="termsource">
|
2100
2119
|
<element name="termsource">
|
2101
2120
|
<attribute name="status">
|
2102
|
-
<
|
2103
|
-
<value>identical</value>
|
2104
|
-
<value>modified</value>
|
2105
|
-
</choice>
|
2121
|
+
<ref name="SourceStatusType"/>
|
2106
2122
|
</attribute>
|
2107
2123
|
<attribute name="type">
|
2108
2124
|
<choice>
|
@@ -2116,6 +2132,17 @@
|
|
2116
2132
|
</optional>
|
2117
2133
|
</element>
|
2118
2134
|
</define>
|
2135
|
+
<define name="SourceStatusType">
|
2136
|
+
<choice>
|
2137
|
+
<value>identical</value>
|
2138
|
+
<value>modified</value>
|
2139
|
+
<value>restyled</value>
|
2140
|
+
<value>context-added</value>
|
2141
|
+
<value>generalisation</value>
|
2142
|
+
<value>specialisation</value>
|
2143
|
+
<value>unspecified</value>
|
2144
|
+
</choice>
|
2145
|
+
</define>
|
2119
2146
|
<define name="origin">
|
2120
2147
|
<element name="origin">
|
2121
2148
|
<choice>
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
-
<!--
|
3
|
+
<!--
|
4
|
+
VERSION v1.2.1
|
5
|
+
default namespace isostandard = "https://www.metanorma.com/ns/iso"
|
6
|
+
-->
|
4
7
|
<include href="relaton-iso.rng"/>
|
5
8
|
<include href="isostandard.rng">
|
6
9
|
<start>
|
@@ -32,13 +35,7 @@
|
|
32
35
|
</define>
|
33
36
|
<define name="iso-standard">
|
34
37
|
<element name="iso-standard">
|
35
|
-
<
|
36
|
-
<attribute name="type">
|
37
|
-
<choice>
|
38
|
-
<value>semantic</value>
|
39
|
-
<value>presentation</value>
|
40
|
-
</choice>
|
41
|
-
</attribute>
|
38
|
+
<ref name="Root-Attributes"/>
|
42
39
|
<ref name="bibdata"/>
|
43
40
|
<optional>
|
44
41
|
<ref name="misccontainer"/>
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<!--
|
3
|
+
<!--
|
4
|
+
VERSION v1.2.1
|
5
|
+
default namespace isostandard = "https://www.metanorma.com/ns/iso"
|
6
|
+
-->
|
4
7
|
<include href="isodoc.rng">
|
5
8
|
<start>
|
6
9
|
<ref name="iso-standard"/>
|
@@ -240,13 +243,7 @@
|
|
240
243
|
-->
|
241
244
|
<define name="iso-standard">
|
242
245
|
<element name="iso-standard">
|
243
|
-
<
|
244
|
-
<attribute name="type">
|
245
|
-
<choice>
|
246
|
-
<value>semantic</value>
|
247
|
-
<value>presentation</value>
|
248
|
-
</choice>
|
249
|
-
</attribute>
|
246
|
+
<ref name="Root-Attributes"/>
|
250
247
|
<ref name="bibdata"/>
|
251
248
|
<zeroOrMore>
|
252
249
|
<ref name="termdocsource"/>
|
data/metanorma-iso.gemspec
CHANGED
@@ -32,9 +32,9 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
33
33
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
34
34
|
|
35
|
-
spec.add_dependency "metanorma-standoc", "~> 2.4.
|
35
|
+
spec.add_dependency "metanorma-standoc", "~> 2.4.3"
|
36
36
|
spec.add_dependency "mnconvert", "~> 1.14"
|
37
|
-
spec.add_dependency "pubid-iso", "~> 0.
|
37
|
+
spec.add_dependency "pubid-iso", "~> 0.5.0"
|
38
38
|
spec.add_dependency "ruby-jing"
|
39
39
|
spec.add_dependency "tokenizer", "~> 0.3.0"
|
40
40
|
spec.add_dependency "twitter_cldr"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.
|
19
|
+
version: 2.4.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.4.
|
26
|
+
version: 2.4.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mnconvert
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.5.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: ruby-jing
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|