metanorma-iso 3.0.2 → 3.0.4
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/html/style-human.css +7 -0
- data/lib/isodoc/iso/html/style-iso.css +7 -0
- data/lib/isodoc/iso/i18n-en.yaml +55 -0
- data/lib/isodoc/iso/i18n-fr.yaml +25 -0
- data/lib/isodoc/iso/iso.amendment.xsl +325 -93
- data/lib/isodoc/iso/iso.international-standard.xsl +325 -93
- data/lib/isodoc/iso/presentation_bibdata.rb +10 -2
- data/lib/isodoc/iso/presentation_section.rb +138 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +17 -130
- data/lib/isodoc/iso/word_convert.rb +5 -16
- data/lib/isodoc/iso/xref.rb +0 -6
- data/lib/metanorma/iso/basicdoc.rng +48 -35
- data/lib/metanorma/iso/biblio-standoc.rng +37 -7
- data/lib/metanorma/iso/biblio.rng +30 -18
- data/lib/metanorma/iso/cleanup.rb +2 -2
- data/lib/metanorma/iso/front.rb +1 -6
- data/lib/metanorma/iso/isodoc.rng +126 -80
- data/lib/metanorma/iso/isostandard-amd.rng +4 -7
- data/lib/metanorma/iso/isostandard.rng +6 -149
- data/lib/metanorma/iso/relaton-iso.rng +35 -34
- data/lib/metanorma/iso/reqt.rng +7 -6
- data/lib/metanorma/iso/validate.rb +8 -11
- data/lib/metanorma/iso/validate_requirements.rb +9 -6
- data/lib/metanorma/iso/validate_style.rb +12 -11
- data/lib/metanorma/iso/version.rb +1 -1
- metadata +3 -2
@@ -92,11 +92,11 @@ module Metanorma
|
|
92
92
|
|
93
93
|
def term_xrefs_validate1(xref, termids)
|
94
94
|
closest_id = xref.xpath("./ancestor::*[@id]")&.last or return
|
95
|
-
|
95
|
+
termids[xref["target"]] && !termids[closest_id["id"]] and
|
96
96
|
@log.add("Style", xref,
|
97
97
|
"only terms clauses can cross-reference terms clause " \
|
98
98
|
"(#{xref['target']})")
|
99
|
-
|
99
|
+
!termids[xref["target"]] && termids[closest_id["id"]] and
|
100
100
|
@log.add("Style", xref,
|
101
101
|
"non-terms clauses cannot cross-reference terms clause " \
|
102
102
|
"(#{xref['target']})")
|
@@ -193,15 +193,12 @@ module Metanorma
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
-
def
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
end
|
203
|
-
schema_validate(formattedstr_strip(doc.dup),
|
204
|
-
File.join(File.dirname(__FILE__), schema))
|
196
|
+
def schema_file
|
197
|
+
case @doctype
|
198
|
+
when "amendment", "technical-corrigendum" # @amd
|
199
|
+
"isostandard-amd.rng"
|
200
|
+
else "isostandard-compile.rng"
|
201
|
+
end
|
205
202
|
end
|
206
203
|
end
|
207
204
|
end
|
@@ -124,12 +124,15 @@ module Metanorma
|
|
124
124
|
|
125
125
|
def style_no_guidance(node, text, docpart)
|
126
126
|
@lang == "en" or return
|
127
|
-
r = requirement_check(text)
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
127
|
+
r = requirement_check(text) and
|
128
|
+
style_warning(node, "#{docpart} may contain requirement", r,
|
129
|
+
display: false)
|
130
|
+
r = permission_check(text) and
|
131
|
+
style_warning(node, "#{docpart} may contain permission", r,
|
132
|
+
display: false)
|
133
|
+
r = recommendation_check(text) and
|
134
|
+
style_warning(node, "#{docpart} may contain recommendation", r,
|
135
|
+
display: false)
|
133
136
|
end
|
134
137
|
end
|
135
138
|
end
|
@@ -30,15 +30,17 @@ module Metanorma
|
|
30
30
|
# ISO/IEC DIR 2, 13.2
|
31
31
|
def introduction_style(node)
|
32
32
|
@novalid and return
|
33
|
-
r = requirement_check(extract_text(node))
|
34
|
-
|
33
|
+
r = requirement_check(extract_text(node)) and
|
34
|
+
style_warning(node, "Introduction may contain requirement", r,
|
35
|
+
display: false)
|
35
36
|
end
|
36
37
|
|
37
38
|
# ISO/IEC DIR 2, 16.5.6
|
38
39
|
def definition_style(node)
|
39
40
|
@novalid and return
|
40
|
-
r = requirement_check(extract_text(node))
|
41
|
-
|
41
|
+
r = requirement_check(extract_text(node)) and
|
42
|
+
style_warning(node, "Definition may contain requirement", r,
|
43
|
+
display: false)
|
42
44
|
end
|
43
45
|
|
44
46
|
# ISO/IEC DIR 2, 16.5.7
|
@@ -70,8 +72,7 @@ module Metanorma
|
|
70
72
|
# style check with a regex on a token
|
71
73
|
# and a negative match on its preceding token
|
72
74
|
def style_two_regex_not_prev(n, text, regex, re_prev, warning)
|
73
|
-
|
74
|
-
|
75
|
+
text.nil? and return
|
75
76
|
arr = Tokenizer::WhitespaceTokenizer.new.tokenize(text)
|
76
77
|
arr.each_index do |i|
|
77
78
|
m = regex.match arr[i]
|
@@ -108,7 +109,8 @@ module Metanorma
|
|
108
109
|
# https://www.iso.org/ISO-house-style.html#iso-hs-s-text-r-s-might
|
109
110
|
def style_ambig_words(node, text)
|
110
111
|
r = ambig_words_check(text) and
|
111
|
-
style_warning(node, "may contain ambiguous provision", r
|
112
|
+
style_warning(node, "may contain ambiguous provision", r,
|
113
|
+
display: false)
|
112
114
|
@lang == "en" and style_regex(/\b(?<num>billions?)\b/i,
|
113
115
|
"ambiguous number", node, text)
|
114
116
|
end
|
@@ -208,12 +210,11 @@ module Metanorma
|
|
208
210
|
end
|
209
211
|
end
|
210
212
|
|
211
|
-
def style_warning(node, msg, text = nil)
|
212
|
-
|
213
|
-
|
213
|
+
def style_warning(node, msg, text = nil, display: true)
|
214
|
+
@novalid and return
|
214
215
|
w = msg
|
215
216
|
w += ": #{text}" if text
|
216
|
-
@log.add("Style", node, w)
|
217
|
+
@log.add("Style", node, w, display:)
|
217
218
|
end
|
218
219
|
|
219
220
|
ASSETS_TO_STYLE =
|
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.4
|
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-
|
11
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -352,6 +352,7 @@ files:
|
|
352
352
|
- lib/isodoc/iso/metadata.rb
|
353
353
|
- lib/isodoc/iso/pdf_convert.rb
|
354
354
|
- lib/isodoc/iso/presentation_bibdata.rb
|
355
|
+
- lib/isodoc/iso/presentation_section.rb
|
355
356
|
- lib/isodoc/iso/presentation_terms.rb
|
356
357
|
- lib/isodoc/iso/presentation_xml_convert.rb
|
357
358
|
- lib/isodoc/iso/presentation_xref.rb
|