metanorma-iso 3.0.4 → 3.0.5
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.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/base_convert.rb +1 -0
- data/lib/isodoc/iso/init.rb +3 -1
- data/lib/isodoc/iso/iso.amendment.xsl +240 -29
- data/lib/isodoc/iso/iso.international-standard.xsl +240 -29
- data/lib/isodoc/iso/presentation_section.rb +1 -1
- data/lib/isodoc/iso/presentation_terms.rb +3 -3
- data/lib/isodoc/iso/presentation_xml_convert.rb +6 -1
- data/lib/isodoc/iso/word_dis_convert.rb +9 -2
- data/lib/isodoc/iso/xref.rb +2 -1
- data/lib/isodoc/iso/xref_section.rb +6 -5
- data/lib/metanorma/iso/isodoc.rng +16 -1
- data/lib/metanorma/iso/isostandard.rng +0 -5
- data/lib/metanorma/iso/section.rb +9 -2
- data/lib/metanorma/iso/validate.rb +2 -4
- data/lib/metanorma/iso/validate_list.rb +7 -6
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +2 -2
@@ -51,7 +51,7 @@ module IsoDoc
|
|
51
51
|
# Redo Amendment annex subclause titles as numbered
|
52
52
|
def clause(docxml)
|
53
53
|
super
|
54
|
-
docxml.xpath(ns("//annex//appendix")).each { |f| clause1(f) }
|
54
|
+
# docxml.xpath(ns("//annex//appendix")).each { |f| clause1(f) }
|
55
55
|
amd?(docxml) or return
|
56
56
|
@suppressheadingnumbers = @oldsuppressheadingnumbers
|
57
57
|
docxml.xpath(ns("//annex//clause | //annex//appendix")).each do |f|
|
@@ -12,8 +12,8 @@ module IsoDoc
|
|
12
12
|
(docxml.xpath(ns("//concept")) - docxml.xpath(ns("//term//concept")))
|
13
13
|
.each do |node|
|
14
14
|
node.ancestors("definition, termsource, related").empty? and
|
15
|
-
|
16
|
-
|
15
|
+
concept_render(node, ital: "false", ref: "false",
|
16
|
+
linkref: "true", linkmention: "false")
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -23,7 +23,7 @@ module IsoDoc
|
|
23
23
|
(f.xpath(ns(".//concept")) - f.xpath(ns(".//term//concept")))
|
24
24
|
.each do |c|
|
25
25
|
c.ancestors("definition, termsource, related").empty? and
|
26
|
-
|
26
|
+
concept_term1(c, m)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -100,9 +100,14 @@ module IsoDoc
|
|
100
100
|
|
101
101
|
def note1(elem)
|
102
102
|
elem["type"] == "units" and return
|
103
|
+
elem["type"] == "requirement" and return requirement_note1(elem)
|
103
104
|
super
|
104
105
|
end
|
105
106
|
|
107
|
+
def requirement_note1(elem)
|
108
|
+
elem["unnumbered"] = "true"
|
109
|
+
end
|
110
|
+
|
106
111
|
def formula_where(dlist)
|
107
112
|
dlist.nil? and return
|
108
113
|
dlist.xpath(ns("./dt")).size == 1 &&
|
@@ -157,7 +162,7 @@ module IsoDoc
|
|
157
162
|
|
158
163
|
def twitter_cldr_localiser_symbols
|
159
164
|
{ group: " ", fraction_group: " ",
|
160
|
-
fraction_group_digits: 3 }
|
165
|
+
fraction_group_digits: 3, decimal: "," }
|
161
166
|
end
|
162
167
|
|
163
168
|
def implicit_reference(bib)
|
@@ -117,8 +117,7 @@ module IsoDoc
|
|
117
117
|
|
118
118
|
def authority_cleanup(docxml)
|
119
119
|
super
|
120
|
-
if @meta.get[:stage_int].to_s[0]
|
121
|
-
@meta.get[:stage_int].to_s[0] == "6"
|
120
|
+
if ["9", "6"].include?(@meta.get[:stage_int].to_s[0])
|
122
121
|
copyright_prf(docxml)
|
123
122
|
else
|
124
123
|
copyright_dis(docxml)
|
@@ -142,6 +141,14 @@ module IsoDoc
|
|
142
141
|
end
|
143
142
|
docxml.xpath("//p[@class = 'zzCopyrightHdr']")&.each(&:remove)
|
144
143
|
end
|
144
|
+
|
145
|
+
def list_title_parse(node, out)
|
146
|
+
name = node.at(ns("./fmt-name")) or return
|
147
|
+
klass = node["key"] == "true" ? "KeyTitle" : "ListTitle"
|
148
|
+
out.p class: klass do |p|
|
149
|
+
name.children&.each { |n| parse(n, p) }
|
150
|
+
end
|
151
|
+
end
|
145
152
|
end
|
146
153
|
end
|
147
154
|
end
|
data/lib/isodoc/iso/xref.rb
CHANGED
@@ -235,7 +235,8 @@ module IsoDoc
|
|
235
235
|
end
|
236
236
|
|
237
237
|
def uncountable_note?(note)
|
238
|
-
@anchors[note["id"]] || blank?(note["id"]) || note["type"] == "units"
|
238
|
+
@anchors[note["id"]] || blank?(note["id"]) || note["type"] == "units" ||
|
239
|
+
note["type"] == "requirement"
|
239
240
|
end
|
240
241
|
|
241
242
|
def note_anchor_names1(notes, counter)
|
@@ -7,19 +7,20 @@ module IsoDoc
|
|
7
7
|
clause.at(ns("./clause")) and
|
8
8
|
@anchors[clause["id"]] = { label: nil, level: 1, type: "clause",
|
9
9
|
xref: clause.at(ns("./title"))&.text }
|
10
|
-
#i = Counter.new(0, prefix: "0")
|
11
10
|
i = clause_counter(0)
|
12
11
|
clause.xpath(ns("./clause")).each do |c|
|
13
12
|
section_names1(c, semx(clause, "0"), i.increment(c).print, 2)
|
14
13
|
end
|
15
14
|
end
|
16
15
|
|
17
|
-
|
16
|
+
# KILL
|
17
|
+
def annex_namesx(clause, num)
|
18
18
|
appendix_names(clause, num)
|
19
19
|
super
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
# KILL
|
23
|
+
def appendix_namesx(clause, _num)
|
23
24
|
i = clause_counter(0)
|
24
25
|
clause.xpath(ns("./appendix")).each do |c|
|
25
26
|
i.increment(c)
|
@@ -65,8 +66,8 @@ module IsoDoc
|
|
65
66
|
@anchors[clause["id"]] = ret.merge(ret2)
|
66
67
|
end
|
67
68
|
|
68
|
-
|
69
|
-
|
69
|
+
# KILL
|
70
|
+
def appendix_names1x(clause, parentnum, num, level, container)
|
70
71
|
num = clause_number_semx(parentnum, clause, num)
|
71
72
|
@anchors[clause["id"]] = { label: num, xref: num, level: level,
|
72
73
|
container: container }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<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">
|
3
|
-
<!-- VERSION v2.0.
|
3
|
+
<!-- VERSION v2.0.4 -->
|
4
4
|
|
5
5
|
<!--
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
@@ -1328,6 +1328,7 @@ numbers</a:documentation>
|
|
1328
1328
|
<ref name="foreword"/>
|
1329
1329
|
<ref name="introduction"/>
|
1330
1330
|
<ref name="acknowledgements"/>
|
1331
|
+
<ref name="executivesummary"/>
|
1331
1332
|
</choice>
|
1332
1333
|
</oneOrMore>
|
1333
1334
|
</element>
|
@@ -1351,6 +1352,11 @@ numbers</a:documentation>
|
|
1351
1352
|
<ref name="Content-Section"/>
|
1352
1353
|
</element>
|
1353
1354
|
</define>
|
1355
|
+
<define name="executivesummary">
|
1356
|
+
<element name="executivesummary">
|
1357
|
+
<ref name="Content-Section"/>
|
1358
|
+
</element>
|
1359
|
+
</define>
|
1354
1360
|
<define name="indexsect">
|
1355
1361
|
<element name="indexsect">
|
1356
1362
|
<ref name="Content-Section"/>
|
@@ -1576,6 +1582,15 @@ used in document amendments</a:documentation>
|
|
1576
1582
|
<define name="annex">
|
1577
1583
|
<element name="annex">
|
1578
1584
|
<ref name="Annex-Section"/>
|
1585
|
+
<zeroOrMore>
|
1586
|
+
<ref name="annex-appendix"/>
|
1587
|
+
</zeroOrMore>
|
1588
|
+
</element>
|
1589
|
+
</define>
|
1590
|
+
<define name="annex-appendix">
|
1591
|
+
<a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
|
1592
|
+
<element name="appendix">
|
1593
|
+
<ref name="Clause-Section"/>
|
1579
1594
|
</element>
|
1580
1595
|
</define>
|
1581
1596
|
<define name="terms">
|
@@ -4,7 +4,9 @@ require "uri" if /^2\./.match?(RUBY_VERSION)
|
|
4
4
|
module Metanorma
|
5
5
|
module Iso
|
6
6
|
class Converter < Standoc::Converter
|
7
|
-
|
7
|
+
|
8
|
+
# KILL
|
9
|
+
def clause_parsex(attrs, xml, node)
|
8
10
|
node.option? "appendix" and return appendix_parse(attrs, xml, node)
|
9
11
|
super
|
10
12
|
end
|
@@ -14,7 +16,8 @@ module Metanorma
|
|
14
16
|
clause_parse(attrs, xml, node)
|
15
17
|
end
|
16
18
|
|
17
|
-
|
19
|
+
# KILL
|
20
|
+
def appendix_parsex(attrs, xml, node)
|
18
21
|
attrs[:"inline-header"] = node.option? "inline-header"
|
19
22
|
set_obligation(attrs, node)
|
20
23
|
xml.appendix **attr_code(attrs) do |xml_section|
|
@@ -23,6 +26,10 @@ module Metanorma
|
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
29
|
+
def support_appendix?(_node)
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
26
33
|
def patent_notice_parse(xml, node)
|
27
34
|
# xml.patent_notice do |xml_section|
|
28
35
|
# xml_section << node.content
|
@@ -14,16 +14,14 @@ module Metanorma
|
|
14
14
|
class Converter < Standoc::Converter
|
15
15
|
def isosubgroup_validate(root)
|
16
16
|
root.xpath("//technical-committee/@type").each do |t|
|
17
|
-
|
17
|
+
%w{TC PC JTC JPC}.include?(t.text) or
|
18
18
|
@log.add("Document Attributes", nil,
|
19
19
|
"invalid technical committee type #{t}")
|
20
|
-
end
|
21
20
|
end
|
22
21
|
root.xpath("//subcommittee/@type").each do |t|
|
23
|
-
|
22
|
+
%w{SC JSC}.include?(t.text) or
|
24
23
|
@log.add("Document Attributes", nil,
|
25
24
|
"invalid subcommittee type #{t}")
|
26
|
-
end
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
@@ -61,7 +61,7 @@ module Metanorma
|
|
61
61
|
when ":", "" then list_after_colon_punctuation(list, entries)
|
62
62
|
when "." then entries.each { |li| list_full_sentence(li) }
|
63
63
|
else style_warning(list, "All lists must be preceded by " \
|
64
|
-
"colon or full stop", prectext)
|
64
|
+
"colon or full stop", prectext, display: false)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -81,7 +81,7 @@ module Metanorma
|
|
81
81
|
text = elem.text.strip
|
82
82
|
starts_lowercase?(text) or
|
83
83
|
style_warning(elem, "List entry of broken up sentence must start " \
|
84
|
-
"with lowercase letter", text)
|
84
|
+
"with lowercase letter", text, display: false)
|
85
85
|
list_semicolon_phrase_punct(elem, text, last)
|
86
86
|
end
|
87
87
|
|
@@ -90,11 +90,12 @@ module Metanorma
|
|
90
90
|
if last
|
91
91
|
punct == "." or
|
92
92
|
style_warning(elem, "Final list entry of broken up " \
|
93
|
-
"sentence must end with full stop", text
|
93
|
+
"sentence must end with full stop", text,
|
94
|
+
display: false)
|
94
95
|
else
|
95
96
|
punct == ";" or
|
96
97
|
style_warning(elem, "List entry of broken up sentence must " \
|
97
|
-
"end with semicolon", text)
|
98
|
+
"end with semicolon", text, display: false)
|
98
99
|
end
|
99
100
|
end
|
100
101
|
|
@@ -103,11 +104,11 @@ module Metanorma
|
|
103
104
|
text = elem.text.strip
|
104
105
|
starts_uppercase?(text) or
|
105
106
|
style_warning(elem, "List entry of separate sentences must start " \
|
106
|
-
"with uppercase letter", text)
|
107
|
+
"with uppercase letter", text, display: false)
|
107
108
|
punct = text.strip.sub(/^.*?(\S)$/m, "\\1")
|
108
109
|
punct == "." or
|
109
110
|
style_warning(elem, "List entry of separate sentences must " \
|
110
|
-
"end with full stop", text)
|
111
|
+
"end with full stop", text, display: false)
|
111
112
|
end
|
112
113
|
|
113
114
|
# allow that all-caps word (acronym) is agnostic as to lowercase
|
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: 3.0.
|
4
|
+
version: 3.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|