metanorma-iso 2.1.0 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/html2doc/lists.rb +145 -10
- data/lib/isodoc/iso/base_convert.rb +11 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +216 -278
- data/lib/isodoc/iso/html/isodoc-dis.scss +294 -288
- data/lib/isodoc/iso/html/isodoc.css +38 -13
- data/lib/isodoc/iso/html/isodoc.scss +38 -12
- data/lib/isodoc/iso/html/style-human.css +14 -1
- data/lib/isodoc/iso/html/style-human.scss +10 -1
- data/lib/isodoc/iso/html/style-iso.css +35 -23
- data/lib/isodoc/iso/html/style-iso.scss +31 -23
- data/lib/isodoc/iso/html/word_iso_intro-dis.html +1 -6
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +24 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +10 -6
- data/lib/isodoc/iso/html/wordstyle-dis.css +12 -62
- data/lib/isodoc/iso/html/wordstyle-dis.scss +7 -56
- data/lib/isodoc/iso/html_convert.rb +7 -2
- data/lib/isodoc/iso/i18n-en.yaml +32 -4
- data/lib/isodoc/iso/i18n-fr.yaml +29 -3
- data/lib/isodoc/iso/i18n-ru.yaml +32 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +32 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +1570 -246
- data/lib/isodoc/iso/iso.international-standard.xsl +1570 -246
- data/lib/isodoc/iso/metadata.rb +67 -67
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +16 -5
- data/lib/isodoc/iso/presentation_xref.rb +10 -4
- data/lib/isodoc/iso/sections.rb +3 -3
- data/lib/isodoc/iso/word_cleanup.rb +3 -0
- data/lib/isodoc/iso/word_convert.rb +8 -5
- data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
- data/lib/isodoc/iso/word_dis_convert.rb +48 -100
- data/lib/isodoc/iso/xref.rb +34 -6
- data/lib/metanorma/iso/base.rb +20 -1
- data/lib/metanorma/iso/biblio.rng +134 -39
- data/lib/metanorma/iso/boilerplate-fr.xml +3 -0
- data/lib/metanorma/iso/boilerplate-ru.xml +3 -0
- data/lib/metanorma/iso/boilerplate.xml +3 -0
- data/lib/metanorma/iso/cleanup.rb +49 -11
- data/lib/metanorma/iso/front.rb +38 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +16 -0
- data/lib/metanorma/iso/isostandard.rng +30 -12
- data/lib/metanorma/iso/macros.rb +29 -0
- data/lib/metanorma/iso/validate_section.rb +0 -12
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/isodoc/amd_spec.rb +20 -46
- data/spec/isodoc/blocks_spec.rb +499 -2
- data/spec/isodoc/i18n_spec.rb +145 -80
- data/spec/isodoc/iso_spec.rb +50 -169
- data/spec/isodoc/metadata_spec.rb +240 -99
- data/spec/isodoc/postproc_spec.rb +43 -7
- data/spec/isodoc/section_spec.rb +9 -9
- data/spec/isodoc/word_dis_spec.rb +1332 -146
- data/spec/isodoc/xref_spec.rb +87 -13
- data/spec/metanorma/amd_spec.rb +39 -23
- data/spec/metanorma/base_spec.rb +174 -44
- data/spec/metanorma/blocks_spec.rb +54 -0
- data/spec/metanorma/lists_spec.rb +2 -2
- data/spec/metanorma/section_spec.rb +2 -2
- data/spec/metanorma/validate_spec.rb +8 -19
- data/spec/spec_helper.rb +17 -7
- data/spec/vcr_cassettes/withdrawn_iso.yml +30 -30
- metadata +7 -8
- data/docs/asciiiso-syntax.adoc +0 -307
- data/docs/guidance.adoc +0 -487
- data/docs/navigation.adoc +0 -23
- data/docs/quickstart.adoc +0 -179
- data/lib/isodoc/iso/presentation_inline.rb +0 -90
@@ -614,12 +614,103 @@
|
|
614
614
|
<optional>
|
615
615
|
<ref name="fetched"/>
|
616
616
|
</optional>
|
617
|
-
<
|
618
|
-
<oneOrMore>
|
619
|
-
<ref name="btitle"/>
|
620
|
-
</oneOrMore>
|
617
|
+
<optional>
|
621
618
|
<ref name="formattedref"/>
|
622
|
-
</
|
619
|
+
</optional>
|
620
|
+
<oneOrMore>
|
621
|
+
<ref name="btitle"/>
|
622
|
+
</oneOrMore>
|
623
|
+
<zeroOrMore>
|
624
|
+
<ref name="bsource"/>
|
625
|
+
</zeroOrMore>
|
626
|
+
<oneOrMore>
|
627
|
+
<ref name="docidentifier"/>
|
628
|
+
</oneOrMore>
|
629
|
+
<optional>
|
630
|
+
<ref name="docnumber"/>
|
631
|
+
</optional>
|
632
|
+
<zeroOrMore>
|
633
|
+
<ref name="bdate"/>
|
634
|
+
</zeroOrMore>
|
635
|
+
<zeroOrMore>
|
636
|
+
<ref name="contributor"/>
|
637
|
+
</zeroOrMore>
|
638
|
+
<optional>
|
639
|
+
<ref name="edition"/>
|
640
|
+
</optional>
|
641
|
+
<zeroOrMore>
|
642
|
+
<ref name="version"/>
|
643
|
+
</zeroOrMore>
|
644
|
+
<zeroOrMore>
|
645
|
+
<ref name="biblionote"/>
|
646
|
+
</zeroOrMore>
|
647
|
+
<zeroOrMore>
|
648
|
+
<ref name="language"/>
|
649
|
+
</zeroOrMore>
|
650
|
+
<zeroOrMore>
|
651
|
+
<ref name="script"/>
|
652
|
+
</zeroOrMore>
|
653
|
+
<zeroOrMore>
|
654
|
+
<ref name="bibabstract"/>
|
655
|
+
</zeroOrMore>
|
656
|
+
<optional>
|
657
|
+
<ref name="status"/>
|
658
|
+
</optional>
|
659
|
+
<zeroOrMore>
|
660
|
+
<ref name="copyright"/>
|
661
|
+
</zeroOrMore>
|
662
|
+
<zeroOrMore>
|
663
|
+
<ref name="docrelation"/>
|
664
|
+
</zeroOrMore>
|
665
|
+
<zeroOrMore>
|
666
|
+
<ref name="series"/>
|
667
|
+
</zeroOrMore>
|
668
|
+
<optional>
|
669
|
+
<ref name="medium"/>
|
670
|
+
</optional>
|
671
|
+
<zeroOrMore>
|
672
|
+
<ref name="bplace"/>
|
673
|
+
</zeroOrMore>
|
674
|
+
<zeroOrMore>
|
675
|
+
<ref name="bprice"/>
|
676
|
+
</zeroOrMore>
|
677
|
+
<zeroOrMore>
|
678
|
+
<ref name="extent"/>
|
679
|
+
</zeroOrMore>
|
680
|
+
<optional>
|
681
|
+
<ref name="bibliographic_size"/>
|
682
|
+
</optional>
|
683
|
+
<zeroOrMore>
|
684
|
+
<ref name="accesslocation"/>
|
685
|
+
</zeroOrMore>
|
686
|
+
<zeroOrMore>
|
687
|
+
<ref name="license"/>
|
688
|
+
</zeroOrMore>
|
689
|
+
<zeroOrMore>
|
690
|
+
<ref name="bclassification"/>
|
691
|
+
</zeroOrMore>
|
692
|
+
<zeroOrMore>
|
693
|
+
<ref name="bkeyword"/>
|
694
|
+
</zeroOrMore>
|
695
|
+
<optional>
|
696
|
+
<ref name="validity"/>
|
697
|
+
</optional>
|
698
|
+
</define>
|
699
|
+
<define name="ReducedBibliographicItem">
|
700
|
+
<optional>
|
701
|
+
<attribute name="type">
|
702
|
+
<ref name="BibItemType"/>
|
703
|
+
</attribute>
|
704
|
+
</optional>
|
705
|
+
<optional>
|
706
|
+
<ref name="fetched"/>
|
707
|
+
</optional>
|
708
|
+
<optional>
|
709
|
+
<ref name="formattedref"/>
|
710
|
+
</optional>
|
711
|
+
<zeroOrMore>
|
712
|
+
<ref name="btitle"/>
|
713
|
+
</zeroOrMore>
|
623
714
|
<zeroOrMore>
|
624
715
|
<ref name="bsource"/>
|
625
716
|
</zeroOrMore>
|
@@ -638,9 +729,9 @@
|
|
638
729
|
<optional>
|
639
730
|
<ref name="edition"/>
|
640
731
|
</optional>
|
641
|
-
<
|
732
|
+
<zeroOrMore>
|
642
733
|
<ref name="version"/>
|
643
|
-
</
|
734
|
+
</zeroOrMore>
|
644
735
|
<zeroOrMore>
|
645
736
|
<ref name="biblionote"/>
|
646
737
|
</zeroOrMore>
|
@@ -833,6 +924,12 @@
|
|
833
924
|
<data type="boolean"/>
|
834
925
|
</attribute>
|
835
926
|
</optional>
|
927
|
+
<optional>
|
928
|
+
<attribute name="language"/>
|
929
|
+
</optional>
|
930
|
+
<optional>
|
931
|
+
<attribute name="script"/>
|
932
|
+
</optional>
|
836
933
|
<text/>
|
837
934
|
</element>
|
838
935
|
</define>
|
@@ -986,36 +1083,34 @@
|
|
986
1083
|
<ref name="SeriesType"/>
|
987
1084
|
</attribute>
|
988
1085
|
</optional>
|
989
|
-
<
|
1086
|
+
<optional>
|
990
1087
|
<ref name="formattedref"/>
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
</group>
|
1018
|
-
</choice>
|
1088
|
+
</optional>
|
1089
|
+
<ref name="btitle"/>
|
1090
|
+
<optional>
|
1091
|
+
<ref name="bplace"/>
|
1092
|
+
</optional>
|
1093
|
+
<optional>
|
1094
|
+
<ref name="seriesorganization"/>
|
1095
|
+
</optional>
|
1096
|
+
<optional>
|
1097
|
+
<ref name="abbreviation"/>
|
1098
|
+
</optional>
|
1099
|
+
<optional>
|
1100
|
+
<ref name="seriesfrom"/>
|
1101
|
+
</optional>
|
1102
|
+
<optional>
|
1103
|
+
<ref name="seriesto"/>
|
1104
|
+
</optional>
|
1105
|
+
<optional>
|
1106
|
+
<ref name="seriesnumber"/>
|
1107
|
+
</optional>
|
1108
|
+
<optional>
|
1109
|
+
<ref name="seriespartnumber"/>
|
1110
|
+
</optional>
|
1111
|
+
<optional>
|
1112
|
+
<ref name="seriesrun"/>
|
1113
|
+
</optional>
|
1019
1114
|
</element>
|
1020
1115
|
</define>
|
1021
1116
|
<define name="SeriesType">
|
@@ -1174,7 +1269,7 @@
|
|
1174
1269
|
</element>
|
1175
1270
|
</optional>
|
1176
1271
|
<element name="bibitem">
|
1177
|
-
<ref name="
|
1272
|
+
<ref name="ReducedBibliographicItem"/>
|
1178
1273
|
</element>
|
1179
1274
|
<choice>
|
1180
1275
|
<zeroOrMore>
|
@@ -1199,9 +1294,9 @@
|
|
1199
1294
|
<optional>
|
1200
1295
|
<ref name="revision-date"/>
|
1201
1296
|
</optional>
|
1202
|
-
<
|
1297
|
+
<optional>
|
1203
1298
|
<ref name="draft"/>
|
1204
|
-
</
|
1299
|
+
</optional>
|
1205
1300
|
</element>
|
1206
1301
|
</define>
|
1207
1302
|
<define name="vedition">
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>DOCUMENT PROTÉGÉ PAR COPYRIGHT</title>
|
6
|
+
{% endif %}
|
4
7
|
<p id="boilerplate-year">© <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
|
5
8
|
|
6
9
|
<p id="boilerplate-message">
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>ДОКУМЕНТ, ОХРАНЯЕМЫЙ АВТОРСКИМ ПРАВОМ</title>
|
6
|
+
{% endif %}
|
4
7
|
<p id="boilerplate-year">© <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
|
5
8
|
|
6
9
|
<p id="boilerplate-message">
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>COPYRIGHT PROTECTED DOCUMENT</title>
|
6
|
+
{% endif %}
|
4
7
|
<p id="boilerplate-year">© <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
|
5
8
|
|
6
9
|
<p id="boilerplate-message">
|
@@ -1,8 +1,5 @@
|
|
1
1
|
require "date"
|
2
|
-
require "nokogiri"
|
3
2
|
require "htmlentities"
|
4
|
-
require "json"
|
5
|
-
require "pathname"
|
6
3
|
|
7
4
|
module Metanorma
|
8
5
|
module ISO
|
@@ -15,8 +12,7 @@ module Metanorma
|
|
15
12
|
|
16
13
|
POST_NORMREF_FOOTNOTES =
|
17
14
|
"//sections//clause[not(@type = 'scope')]//fn | "\
|
18
|
-
"//annex//fn | "
|
19
|
-
"//references[@normative = 'false']//fn".freeze
|
15
|
+
"//annex//fn | //references[@normative = 'false']//fn".freeze
|
20
16
|
|
21
17
|
def other_footnote_renumber(xmldoc)
|
22
18
|
seen = {}
|
@@ -40,7 +36,7 @@ module Metanorma
|
|
40
36
|
xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']"\
|
41
37
|
"/organization").each_with_object([]) do |x, prefix|
|
42
38
|
x1 = x.at("abbreviation")&.text || x.at("name")&.text
|
43
|
-
#(x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
|
39
|
+
# (x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
|
44
40
|
prefix << x1
|
45
41
|
end
|
46
42
|
end
|
@@ -118,9 +114,7 @@ module Metanorma
|
|
118
114
|
super
|
119
115
|
return unless @amd
|
120
116
|
|
121
|
-
xml.xpath("//*[@inline-header]").each
|
122
|
-
h.delete("inline-header")
|
123
|
-
end
|
117
|
+
xml.xpath("//*[@inline-header]").each { |h| h.delete("inline-header") }
|
124
118
|
end
|
125
119
|
|
126
120
|
def boilerplate_file(_xmldoc)
|
@@ -170,8 +164,7 @@ module Metanorma
|
|
170
164
|
|
171
165
|
if id = replacement_standard(b)
|
172
166
|
insert_unpub_note(b, @i18n.cancelled_and_replaced.sub(/%/, id))
|
173
|
-
else
|
174
|
-
insert_unpub_note(b, @i18n.withdrawn)
|
167
|
+
else insert_unpub_note(b, @i18n.withdrawn)
|
175
168
|
end
|
176
169
|
end
|
177
170
|
end
|
@@ -209,6 +202,51 @@ module Metanorma
|
|
209
202
|
@vocab and return
|
210
203
|
super
|
211
204
|
end
|
205
|
+
|
206
|
+
def bibdata_cleanup(xmldoc)
|
207
|
+
super
|
208
|
+
approval_groups_rename(xmldoc)
|
209
|
+
editorial_groups_agency(xmldoc)
|
210
|
+
editorial_group_types(xmldoc)
|
211
|
+
end
|
212
|
+
|
213
|
+
def approval_groups_rename(xmldoc)
|
214
|
+
%w(technical-committee subcommittee workgroup).each do |v|
|
215
|
+
xmldoc.xpath("//bibdata//approval-#{v}").each { |a| a.name = v }
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
def editorial_groups_agency(xmldoc)
|
220
|
+
pubs = extract_publishers(xmldoc)
|
221
|
+
xmldoc.xpath("//bibdata/ext/editorialgroup").each do |e|
|
222
|
+
pubs.reverse.each do |p|
|
223
|
+
if e.children.empty? then e << "<agency>#{p}</agency>"
|
224
|
+
else e.children.first.previous = "<agency>#{p}</agency>"
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
def extract_publishers(xmldoc)
|
231
|
+
xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']/"\
|
232
|
+
"organization").each_with_object([]) do |p, m|
|
233
|
+
x = p.at("./abbreviation") || p.at("./name") or next
|
234
|
+
m << x.text
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
DEFAULT_EDGROUP_TYPE = { "technical-committee": "TC",
|
239
|
+
subcommittee: "SC", workgroup: "WG" }.freeze
|
240
|
+
|
241
|
+
def editorial_group_types(xmldoc)
|
242
|
+
%w(technical-committee subcommittee workgroup).each do |v|
|
243
|
+
xmldoc.xpath("//bibdata//#{v} | //bibdata//approval-#{v}").each do |g|
|
244
|
+
next if g["type"]
|
245
|
+
|
246
|
+
g["type"] = DEFAULT_EDGROUP_TYPE[v.to_sym]
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
212
250
|
end
|
213
251
|
end
|
214
252
|
end
|
data/lib/metanorma/iso/front.rb
CHANGED
@@ -81,11 +81,42 @@ module Metanorma
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def metadata_committee(node, xml)
|
84
|
+
metadata_editorial_committee(node, xml)
|
85
|
+
metadata_approval_committee(node, xml)
|
86
|
+
end
|
87
|
+
|
88
|
+
def metadata_editorial_committee(node, xml)
|
84
89
|
xml.editorialgroup do |a|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
node.attr("secretariat")
|
90
|
+
%w(technical-committee subcommittee workgroup).each do |v|
|
91
|
+
node.attr("#{v}-number") and committee_component(v, node, a)
|
92
|
+
end
|
93
|
+
node.attr("secretariat") and a.secretariat(node.attr("secretariat"))
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def metadata_approval_committee(node, xml)
|
98
|
+
types = metadata_approval_committee_types(node)
|
99
|
+
xml.approvalgroup do |a|
|
100
|
+
metadata_approval_agency(a, node.attr("approval-agency")
|
101
|
+
&.split(%r{[/,;]}))
|
102
|
+
types.each do |v|
|
103
|
+
node.attr("#{v}-number") and committee_component(v, node, a)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
def metadata_approval_committee_types(node)
|
109
|
+
types = %w(technical-committee subcommittee workgroup)
|
110
|
+
node.attr("approval-technical-committee-number") and
|
111
|
+
types = %w(approval-technical-committee approval-subcommittee
|
112
|
+
approval-workgroup)
|
113
|
+
types
|
114
|
+
end
|
115
|
+
|
116
|
+
def metadata_approval_agency(xml, list)
|
117
|
+
list = ["ISO"] if list.nil? || list.empty?
|
118
|
+
list.each do |v|
|
119
|
+
xml.agency v
|
89
120
|
end
|
90
121
|
end
|
91
122
|
|
@@ -146,7 +177,8 @@ module Metanorma
|
|
146
177
|
end
|
147
178
|
|
148
179
|
def relaton_relations
|
149
|
-
super + %w(obsoletes successor-of manifestation-of related
|
180
|
+
super + %w(obsoletes successor-of manifestation-of related
|
181
|
+
annotation-of)
|
150
182
|
end
|
151
183
|
|
152
184
|
def relaton_relation_descriptions
|
@@ -162,7 +194,7 @@ module Metanorma
|
|
162
194
|
"identical-adopted-from" => "adoptedFrom",
|
163
195
|
"modified-adopted-from" => "adoptedFrom",
|
164
196
|
"related-directive" => "related",
|
165
|
-
"related-mandate" => "related"
|
197
|
+
"related-mandate" => "related"
|
166
198
|
)
|
167
199
|
end
|
168
200
|
end
|
@@ -202,6 +202,8 @@ module Metanorma
|
|
202
202
|
%w(40 50).include?(stage) && i = node.attr("iteration") and
|
203
203
|
itersuffix = ".#{i}"
|
204
204
|
return docnum if abbr.nil? || abbr.empty? # prefixes added in cleanup
|
205
|
+
|
206
|
+
typeabbr = "" if %w(DTS FDTS).include?(abbr.sub(/\s+$/, ""))
|
205
207
|
return "/#{abbr}#{typeabbr} #{docnum}#{itersuffix}" unless @amd
|
206
208
|
|
207
209
|
a = docnum.split(%r{/})
|
@@ -282,6 +282,9 @@
|
|
282
282
|
<ref name="MultilingualRenderingType"/>
|
283
283
|
</attribute>
|
284
284
|
</optional>
|
285
|
+
<optional>
|
286
|
+
<ref name="tname"/>
|
287
|
+
</optional>
|
285
288
|
<oneOrMore>
|
286
289
|
<ref name="ul_li"/>
|
287
290
|
</oneOrMore>
|
@@ -324,6 +327,9 @@
|
|
324
327
|
</choice>
|
325
328
|
</attribute>
|
326
329
|
</optional>
|
330
|
+
<optional>
|
331
|
+
<ref name="tname"/>
|
332
|
+
</optional>
|
327
333
|
<oneOrMore>
|
328
334
|
<ref name="li"/>
|
329
335
|
</oneOrMore>
|
@@ -360,6 +366,9 @@
|
|
360
366
|
<ref name="MultilingualRenderingType"/>
|
361
367
|
</attribute>
|
362
368
|
</optional>
|
369
|
+
<optional>
|
370
|
+
<ref name="tname"/>
|
371
|
+
</optional>
|
363
372
|
<oneOrMore>
|
364
373
|
<ref name="dt"/>
|
365
374
|
<ref name="dd"/>
|
@@ -694,6 +703,9 @@
|
|
694
703
|
<optional>
|
695
704
|
<attribute name="tag"/>
|
696
705
|
</optional>
|
706
|
+
<optional>
|
707
|
+
<attribute name="type"/>
|
708
|
+
</optional>
|
697
709
|
<optional>
|
698
710
|
<attribute name="multilingual-rendering">
|
699
711
|
<ref name="MultilingualRenderingType"/>
|
@@ -729,6 +741,9 @@
|
|
729
741
|
<optional>
|
730
742
|
<attribute name="tag"/>
|
731
743
|
</optional>
|
744
|
+
<optional>
|
745
|
+
<attribute name="type"/>
|
746
|
+
</optional>
|
732
747
|
<optional>
|
733
748
|
<attribute name="multilingual-rendering">
|
734
749
|
<ref name="MultilingualRenderingType"/>
|
@@ -2050,6 +2065,7 @@
|
|
2050
2065
|
<value>compare</value>
|
2051
2066
|
<value>contrast</value>
|
2052
2067
|
<value>see</value>
|
2068
|
+
<value>seealso</value>
|
2053
2069
|
</choice>
|
2054
2070
|
</define>
|
2055
2071
|
<define name="deprecates">
|
@@ -45,6 +45,7 @@
|
|
45
45
|
<ref name="horizontal"/>
|
46
46
|
</optional>
|
47
47
|
<ref name="editorialgroup"/>
|
48
|
+
<ref name="approvalgroup"/>
|
48
49
|
<zeroOrMore>
|
49
50
|
<ref name="ics"/>
|
50
51
|
</zeroOrMore>
|
@@ -249,6 +250,7 @@
|
|
249
250
|
<value>warning</value>
|
250
251
|
<value>important</value>
|
251
252
|
<value>safety precautions</value>
|
253
|
+
<value>editorial</value>
|
252
254
|
</choice>
|
253
255
|
</define>
|
254
256
|
<define name="preface">
|
@@ -308,18 +310,7 @@
|
|
308
310
|
</define>
|
309
311
|
<define name="editorialgroup">
|
310
312
|
<element name="editorialgroup">
|
311
|
-
<
|
312
|
-
<ref name="technical-committee"/>
|
313
|
-
</oneOrMore>
|
314
|
-
<zeroOrMore>
|
315
|
-
<ref name="subcommittee"/>
|
316
|
-
</zeroOrMore>
|
317
|
-
<zeroOrMore>
|
318
|
-
<ref name="workgroup"/>
|
319
|
-
</zeroOrMore>
|
320
|
-
<optional>
|
321
|
-
<ref name="secretariat"/>
|
322
|
-
</optional>
|
313
|
+
<ref name="ISOProjectGroup"/>
|
323
314
|
</element>
|
324
315
|
</define>
|
325
316
|
<define name="Content-Section">
|
@@ -367,6 +358,33 @@
|
|
367
358
|
</define>
|
368
359
|
</include>
|
369
360
|
<!-- end overrides -->
|
361
|
+
<define name="ISOProjectGroup">
|
362
|
+
<zeroOrMore>
|
363
|
+
<ref name="agency"/>
|
364
|
+
</zeroOrMore>
|
365
|
+
<oneOrMore>
|
366
|
+
<ref name="technical-committee"/>
|
367
|
+
</oneOrMore>
|
368
|
+
<zeroOrMore>
|
369
|
+
<ref name="subcommittee"/>
|
370
|
+
</zeroOrMore>
|
371
|
+
<zeroOrMore>
|
372
|
+
<ref name="workgroup"/>
|
373
|
+
</zeroOrMore>
|
374
|
+
<optional>
|
375
|
+
<ref name="secretariat"/>
|
376
|
+
</optional>
|
377
|
+
</define>
|
378
|
+
<define name="approvalgroup">
|
379
|
+
<element name="approvalgroup">
|
380
|
+
<ref name="ISOProjectGroup"/>
|
381
|
+
</element>
|
382
|
+
</define>
|
383
|
+
<define name="agency">
|
384
|
+
<element name="agency">
|
385
|
+
<text/>
|
386
|
+
</element>
|
387
|
+
</define>
|
370
388
|
<!--
|
371
389
|
We display the Normative References between scope and terms; but to keep the
|
372
390
|
grammar simple, we keep the references together
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Metanorma
|
2
|
+
module ISO
|
3
|
+
class EditorAdmonitionBlock < Asciidoctor::Extensions::BlockProcessor
|
4
|
+
use_dsl
|
5
|
+
named :EDITOR
|
6
|
+
on_contexts :example, :paragraph
|
7
|
+
|
8
|
+
def process(parent, reader, attrs)
|
9
|
+
attrs["name"] = "editorial"
|
10
|
+
attrs["caption"] = "EDITOR"
|
11
|
+
create_block(parent, :admonition, reader.lines, attrs,
|
12
|
+
content_model: :compound)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class EditorInlineAdmonitionBlock < Asciidoctor::Extensions::Treeprocessor
|
17
|
+
def process(document)
|
18
|
+
(document.find_by context: :paragraph).each do |para|
|
19
|
+
next unless /^EDITOR: /.match? para.lines[0]
|
20
|
+
|
21
|
+
para.set_attr("name", "editorial")
|
22
|
+
para.set_attr("caption", "EDITOR")
|
23
|
+
para.lines[0].sub!(/^EDITOR: /, "")
|
24
|
+
para.context = :admonition
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -202,18 +202,6 @@ module Metanorma
|
|
202
202
|
end
|
203
203
|
end
|
204
204
|
|
205
|
-
def asset_style(root)
|
206
|
-
root.xpath("//example | //termexample").each { |e| example_style(e) }
|
207
|
-
root.xpath("//definition/verbal-definition").each do |e|
|
208
|
-
definition_style(e)
|
209
|
-
end
|
210
|
-
root.xpath("//note").each { |e| note_style(e) }
|
211
|
-
root.xpath("//fn").each { |e| footnote_style(e) }
|
212
|
-
root.xpath(ASSETS_TO_STYLE).each { |e| style(e, extract_text(e)) }
|
213
|
-
norm_bibitem_style(root)
|
214
|
-
super
|
215
|
-
end
|
216
|
-
|
217
205
|
def subclause_validate(root)
|
218
206
|
root.xpath("//clause/clause/clause/clause/clause/clause/clause/clause")
|
219
207
|
.each do |c|
|