metanorma-iso 2.0.8.1 → 2.1.2
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/html2doc/lists.rb +169 -0
- data/lib/isodoc/iso/base_convert.rb +11 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
- data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
- 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 +3 -1
- data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
- data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
- data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
- data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
- data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
- data/lib/isodoc/iso/html_convert.rb +7 -2
- data/lib/isodoc/iso/i18n-en.yaml +33 -4
- data/lib/isodoc/iso/i18n-fr.yaml +30 -3
- data/lib/isodoc/iso/i18n-ru.yaml +33 -4
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
- data/lib/isodoc/iso/i18n.rb +1 -1
- data/lib/isodoc/iso/init.rb +17 -1
- data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
- data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
- data/lib/isodoc/iso/metadata.rb +72 -78
- data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
- data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
- data/lib/isodoc/iso/presentation_xref.rb +132 -0
- data/lib/isodoc/iso/sections.rb +3 -3
- data/lib/isodoc/iso/word_cleanup.rb +17 -0
- data/lib/isodoc/iso/word_convert.rb +32 -12
- data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
- data/lib/isodoc/iso/word_dis_convert.rb +122 -0
- data/lib/isodoc/iso/xref.rb +78 -29
- data/lib/metanorma/iso/base.rb +20 -1
- data/lib/metanorma/iso/biblio.rng +69 -42
- data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
- data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
- data/lib/metanorma/iso/boilerplate.xml +4 -3
- data/lib/metanorma/iso/cleanup.rb +29 -1
- data/lib/metanorma/iso/front.rb +31 -6
- data/lib/metanorma/iso/front_id.rb +2 -0
- data/lib/metanorma/iso/isodoc.rng +65 -0
- data/lib/metanorma/iso/isostandard.rng +30 -12
- data/lib/metanorma/iso/macros.rb +29 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/metanorma-iso.rb +1 -0
- data/lib/relaton/render/config.yml +4 -0
- data/lib/relaton/render/general.rb +13 -0
- data/metanorma-iso.gemspec +1 -1
- data/spec/isodoc/amd_spec.rb +35 -60
- data/spec/isodoc/blocks_spec.rb +783 -179
- data/spec/isodoc/i18n_spec.rb +331 -100
- data/spec/isodoc/inline_spec.rb +35 -42
- data/spec/isodoc/iso_spec.rb +51 -170
- data/spec/isodoc/metadata_spec.rb +240 -99
- data/spec/isodoc/postproc_spec.rb +68 -7
- data/spec/isodoc/ref_spec.rb +66 -69
- data/spec/isodoc/section_spec.rb +88 -80
- data/spec/isodoc/table_spec.rb +2 -2
- data/spec/isodoc/terms_spec.rb +2 -2
- data/spec/isodoc/word_dis_spec.rb +1886 -0
- data/spec/isodoc/xref_spec.rb +138 -64
- data/spec/metanorma/amd_spec.rb +53 -1
- data/spec/metanorma/base_spec.rb +195 -20
- 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/spec_helper.rb +23 -4
- data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
- metadata +15 -10
- 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/spec/vcr_cassettes/docrels.yml +0 -385
data/lib/metanorma/iso/base.rb
CHANGED
@@ -5,10 +5,16 @@ require "pathname"
|
|
5
5
|
require "open-uri"
|
6
6
|
require "isodoc"
|
7
7
|
require "fileutils"
|
8
|
+
require_relative "macros"
|
8
9
|
|
9
10
|
module Metanorma
|
10
11
|
module ISO
|
11
12
|
class Converter < Standoc::Converter
|
13
|
+
Asciidoctor::Extensions.register do
|
14
|
+
block Metanorma::ISO::EditorAdmonitionBlock
|
15
|
+
treeprocessor Metanorma::ISO::EditorInlineAdmonitionBlock
|
16
|
+
end
|
17
|
+
|
12
18
|
XML_ROOT_TAG = "iso-standard".freeze
|
13
19
|
XML_NAMESPACE = "https://www.metanorma.org/ns/iso".freeze
|
14
20
|
|
@@ -25,6 +31,10 @@ module Metanorma
|
|
25
31
|
IsoDoc::Iso::WordConvert.new(doc_extract_attributes(node))
|
26
32
|
end
|
27
33
|
|
34
|
+
def doc_extract_attributes(node)
|
35
|
+
super.merge(isowordtemplate: node.attr("iso-word-template"))
|
36
|
+
end
|
37
|
+
|
28
38
|
def pdf_converter(node)
|
29
39
|
return nil if node.attr("no-pdf")
|
30
40
|
|
@@ -49,7 +59,16 @@ module Metanorma
|
|
49
59
|
|
50
60
|
def ol_attrs(node)
|
51
61
|
attr_code(keep_attrs(node)
|
52
|
-
.merge(id: ::Metanorma::Utils::anchor_or_uuid(node)
|
62
|
+
.merge(id: ::Metanorma::Utils::anchor_or_uuid(node),
|
63
|
+
start: node.attr("start")))
|
64
|
+
end
|
65
|
+
|
66
|
+
def admonition_name(node)
|
67
|
+
name = super
|
68
|
+
a = node.attr("type") and ["editorial"].each do |t|
|
69
|
+
name = t if a.casecmp(t).zero?
|
70
|
+
end
|
71
|
+
name
|
53
72
|
end
|
54
73
|
|
55
74
|
def outputs(node, ret)
|
@@ -614,12 +614,12 @@
|
|
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
623
|
<zeroOrMore>
|
624
624
|
<ref name="bsource"/>
|
625
625
|
</zeroOrMore>
|
@@ -851,17 +851,46 @@
|
|
851
851
|
</define>
|
852
852
|
<define name="bplace">
|
853
853
|
<element name="place">
|
854
|
-
<
|
855
|
-
<
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
854
|
+
<choice>
|
855
|
+
<text/>
|
856
|
+
<group>
|
857
|
+
<ref name="bibliocity"/>
|
858
|
+
<zeroOrMore>
|
859
|
+
<ref name="biblioregion"/>
|
860
|
+
</zeroOrMore>
|
861
|
+
<zeroOrMore>
|
862
|
+
<ref name="bibliocountry"/>
|
863
|
+
</zeroOrMore>
|
864
|
+
</group>
|
865
|
+
</choice>
|
866
|
+
</element>
|
867
|
+
</define>
|
868
|
+
<define name="bibliocity">
|
869
|
+
<element name="city">
|
862
870
|
<text/>
|
863
871
|
</element>
|
864
872
|
</define>
|
873
|
+
<define name="biblioregion">
|
874
|
+
<element name="region">
|
875
|
+
<ref name="RegionType"/>
|
876
|
+
</element>
|
877
|
+
</define>
|
878
|
+
<define name="bibliocountry">
|
879
|
+
<element name="country">
|
880
|
+
<ref name="RegionType"/>
|
881
|
+
</element>
|
882
|
+
</define>
|
883
|
+
<define name="RegionType">
|
884
|
+
<optional>
|
885
|
+
<attribute name="iso"/>
|
886
|
+
</optional>
|
887
|
+
<optional>
|
888
|
+
<attribute name="recommended">
|
889
|
+
<data type="boolean"/>
|
890
|
+
</attribute>
|
891
|
+
</optional>
|
892
|
+
<text/>
|
893
|
+
</define>
|
865
894
|
<define name="bprice">
|
866
895
|
<element name="price">
|
867
896
|
<attribute name="currency"/>
|
@@ -957,36 +986,34 @@
|
|
957
986
|
<ref name="SeriesType"/>
|
958
987
|
</attribute>
|
959
988
|
</optional>
|
960
|
-
<
|
989
|
+
<optional>
|
961
990
|
<ref name="formattedref"/>
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
</group>
|
989
|
-
</choice>
|
991
|
+
</optional>
|
992
|
+
<ref name="btitle"/>
|
993
|
+
<optional>
|
994
|
+
<ref name="bplace"/>
|
995
|
+
</optional>
|
996
|
+
<optional>
|
997
|
+
<ref name="seriesorganization"/>
|
998
|
+
</optional>
|
999
|
+
<optional>
|
1000
|
+
<ref name="abbreviation"/>
|
1001
|
+
</optional>
|
1002
|
+
<optional>
|
1003
|
+
<ref name="seriesfrom"/>
|
1004
|
+
</optional>
|
1005
|
+
<optional>
|
1006
|
+
<ref name="seriesto"/>
|
1007
|
+
</optional>
|
1008
|
+
<optional>
|
1009
|
+
<ref name="seriesnumber"/>
|
1010
|
+
</optional>
|
1011
|
+
<optional>
|
1012
|
+
<ref name="seriespartnumber"/>
|
1013
|
+
</optional>
|
1014
|
+
<optional>
|
1015
|
+
<ref name="seriesrun"/>
|
1016
|
+
</optional>
|
990
1017
|
</element>
|
991
1018
|
</define>
|
992
1019
|
<define name="SeriesType">
|
@@ -1,7 +1,10 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>DOCUMENT PROTÉGÉ PAR COPYRIGHT</title>
|
6
|
+
{% endif %}
|
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">
|
7
10
|
Droits de reproduction réservés. Sauf indication contraire, ou requise dans le cadre de sa mise en œuvre,
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>ДОКУМЕНТ, ОХРАНЯЕМЫЙ АВТОРСКИМ ПРАВОМ</title>
|
6
|
+
{% endif %}
|
7
|
+
<p id="boilerplate-year">© <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
|
7
8
|
|
8
9
|
<p id="boilerplate-message">
|
9
10
|
Все права защищены. Если иначе не определено или не требуется в контексте его реализации, никакая часть этой публикации не может быть воспроизведена или использована иначе в любой форме или каким-либо образом, электронным или механическим, включая фотокопирование, или публикацию в Интернете или интранете, без предварительного письменного разрешения. Разрешение может быть запрошено ISO по адресу, указанному ниже, или у органа — члена ISO страны запрашивающего.
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
{% if stage_int >= 40 %}
|
5
|
+
<title>COPYRIGHT PROTECTED DOCUMENT</title>
|
6
|
+
{% endif %}
|
7
|
+
<p id="boilerplate-year">© <span class="std_publisher">{{ agency }}</span> <span class="std_docNumber">{{ docyear }}</span></p>
|
7
8
|
|
8
9
|
<p id="boilerplate-message">
|
9
10
|
All rights
|
@@ -40,7 +40,8 @@ module Metanorma
|
|
40
40
|
xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']"\
|
41
41
|
"/organization").each_with_object([]) do |x, prefix|
|
42
42
|
x1 = x.at("abbreviation")&.text || x.at("name")&.text
|
43
|
-
(x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
|
43
|
+
# (x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
|
44
|
+
prefix << x1
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
@@ -208,6 +209,33 @@ module Metanorma
|
|
208
209
|
@vocab and return
|
209
210
|
super
|
210
211
|
end
|
212
|
+
|
213
|
+
def bibdata_cleanup(xmldoc)
|
214
|
+
super
|
215
|
+
approval_groups_rename(xmldoc)
|
216
|
+
editorial_groups_agency(xmldoc)
|
217
|
+
end
|
218
|
+
|
219
|
+
def approval_groups_rename(xmldoc)
|
220
|
+
%w(technical-committee subcommittee workgroup).each do |v|
|
221
|
+
xmldoc.xpath("//bibdata//approval-#{v}").each do |a|
|
222
|
+
a.name = v
|
223
|
+
end
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
def editorial_groups_agency(xmldoc)
|
228
|
+
pubs = xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']/"\
|
229
|
+
"organization").each_with_object([]) do |p, m|
|
230
|
+
x = p.at("./abbreviation") || p.at("./name") or next
|
231
|
+
m << x.text
|
232
|
+
end
|
233
|
+
xmldoc.xpath("//bibdata/ext/editorialgroup").each do |e|
|
234
|
+
pubs.reverse.each do |p|
|
235
|
+
e.children.first.previous = "<agency>#{p}</agency>"
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
211
239
|
end
|
212
240
|
end
|
213
241
|
end
|
data/lib/metanorma/iso/front.rb
CHANGED
@@ -81,11 +81,35 @@ 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
|
+
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 = %w(technical-committee subcommittee workgroup)
|
99
|
+
node.attr("approval-technical-committee-number") and
|
100
|
+
types = %w(approval-technical-committee approval-subcommittee
|
101
|
+
approval-workgroup)
|
102
|
+
xml.approvalgroup do |a|
|
103
|
+
metadata_approval_agency(a, node.attr("approval-agency")
|
104
|
+
&.split(%r{[/,;]}))
|
105
|
+
types.each { |v| committee_component(v, node, a) }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def metadata_approval_agency(xml, list)
|
110
|
+
list = ["ISO"] if list.nil? || list.empty?
|
111
|
+
list.each do |v|
|
112
|
+
xml.agency v
|
89
113
|
end
|
90
114
|
end
|
91
115
|
|
@@ -146,7 +170,8 @@ module Metanorma
|
|
146
170
|
end
|
147
171
|
|
148
172
|
def relaton_relations
|
149
|
-
super + %w(obsoletes successor-of manifestation-of related
|
173
|
+
super + %w(obsoletes successor-of manifestation-of related
|
174
|
+
annotation-of)
|
150
175
|
end
|
151
176
|
|
152
177
|
def relaton_relation_descriptions
|
@@ -162,7 +187,7 @@ module Metanorma
|
|
162
187
|
"identical-adopted-from" => "adoptedFrom",
|
163
188
|
"modified-adopted-from" => "adoptedFrom",
|
164
189
|
"related-directive" => "related",
|
165
|
-
"related-mandate" => "related"
|
190
|
+
"related-mandate" => "related"
|
166
191
|
)
|
167
192
|
end
|
168
193
|
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{/})
|
@@ -32,6 +32,43 @@
|
|
32
32
|
<ref name="DocumentType"/>
|
33
33
|
</element>
|
34
34
|
</define>
|
35
|
+
<define name="admonition">
|
36
|
+
<element name="admonition">
|
37
|
+
<attribute name="type">
|
38
|
+
<ref name="AdmonitionType"/>
|
39
|
+
</attribute>
|
40
|
+
<optional>
|
41
|
+
<attribute name="class"/>
|
42
|
+
</optional>
|
43
|
+
<attribute name="id">
|
44
|
+
<data type="ID"/>
|
45
|
+
</attribute>
|
46
|
+
<optional>
|
47
|
+
<attribute name="uri">
|
48
|
+
<data type="anyURI"/>
|
49
|
+
</attribute>
|
50
|
+
</optional>
|
51
|
+
<optional>
|
52
|
+
<attribute name="coverpage">
|
53
|
+
<data type="boolean"/>
|
54
|
+
</attribute>
|
55
|
+
</optional>
|
56
|
+
<optional>
|
57
|
+
<attribute name="notag">
|
58
|
+
<data type="boolean"/>
|
59
|
+
</attribute>
|
60
|
+
</optional>
|
61
|
+
<optional>
|
62
|
+
<ref name="tname"/>
|
63
|
+
</optional>
|
64
|
+
<zeroOrMore>
|
65
|
+
<ref name="paragraph-with-footnote"/>
|
66
|
+
</zeroOrMore>
|
67
|
+
<zeroOrMore>
|
68
|
+
<ref name="note"/>
|
69
|
+
</zeroOrMore>
|
70
|
+
</element>
|
71
|
+
</define>
|
35
72
|
<define name="index">
|
36
73
|
<element name="index">
|
37
74
|
<optional>
|
@@ -245,6 +282,9 @@
|
|
245
282
|
<ref name="MultilingualRenderingType"/>
|
246
283
|
</attribute>
|
247
284
|
</optional>
|
285
|
+
<optional>
|
286
|
+
<ref name="tname"/>
|
287
|
+
</optional>
|
248
288
|
<oneOrMore>
|
249
289
|
<ref name="ul_li"/>
|
250
290
|
</oneOrMore>
|
@@ -287,6 +327,9 @@
|
|
287
327
|
</choice>
|
288
328
|
</attribute>
|
289
329
|
</optional>
|
330
|
+
<optional>
|
331
|
+
<ref name="tname"/>
|
332
|
+
</optional>
|
290
333
|
<oneOrMore>
|
291
334
|
<ref name="li"/>
|
292
335
|
</oneOrMore>
|
@@ -323,6 +366,9 @@
|
|
323
366
|
<ref name="MultilingualRenderingType"/>
|
324
367
|
</attribute>
|
325
368
|
</optional>
|
369
|
+
<optional>
|
370
|
+
<ref name="tname"/>
|
371
|
+
</optional>
|
326
372
|
<oneOrMore>
|
327
373
|
<ref name="dt"/>
|
328
374
|
<ref name="dd"/>
|
@@ -851,6 +897,16 @@
|
|
851
897
|
<ref name="MultilingualRenderingType"/>
|
852
898
|
</attribute>
|
853
899
|
</optional>
|
900
|
+
<optional>
|
901
|
+
<attribute name="coverpage">
|
902
|
+
<data type="boolean"/>
|
903
|
+
</attribute>
|
904
|
+
</optional>
|
905
|
+
<optional>
|
906
|
+
<attribute name="notag">
|
907
|
+
<data type="boolean"/>
|
908
|
+
</attribute>
|
909
|
+
</optional>
|
854
910
|
<oneOrMore>
|
855
911
|
<choice>
|
856
912
|
<ref name="paragraph"/>
|
@@ -1178,6 +1234,7 @@
|
|
1178
1234
|
<ref name="concept"/>
|
1179
1235
|
<ref name="add"/>
|
1180
1236
|
<ref name="del"/>
|
1237
|
+
<ref name="span"/>
|
1181
1238
|
</choice>
|
1182
1239
|
</define>
|
1183
1240
|
<define name="add">
|
@@ -1204,6 +1261,14 @@
|
|
1204
1261
|
</choice>
|
1205
1262
|
</element>
|
1206
1263
|
</define>
|
1264
|
+
<define name="span">
|
1265
|
+
<element name="span">
|
1266
|
+
<attribute name="class"/>
|
1267
|
+
<oneOrMore>
|
1268
|
+
<ref name="TextElement"/>
|
1269
|
+
</oneOrMore>
|
1270
|
+
</element>
|
1271
|
+
</define>
|
1207
1272
|
<define name="concept">
|
1208
1273
|
<element name="concept">
|
1209
1274
|
<optional>
|
@@ -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
|
data/lib/metanorma-iso.rb
CHANGED
@@ -7,6 +7,7 @@ require_relative "isodoc/iso/pdf_convert"
|
|
7
7
|
require_relative "isodoc/iso/sts_convert"
|
8
8
|
require_relative "isodoc/iso/isosts_convert"
|
9
9
|
require_relative "isodoc/iso/presentation_xml_convert"
|
10
|
+
require_relative "html2doc/lists"
|
10
11
|
require "asciidoctor/extensions"
|
11
12
|
|
12
13
|
if defined? Metanorma
|
@@ -0,0 +1,4 @@
|
|
1
|
+
template:
|
2
|
+
# skip standardidentifier, it is inserted in front of formattedref within metanorma
|
3
|
+
standard: "<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}."
|
4
|
+
website: "{{ creatornames }} ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [website]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{ place }}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. {{ standardidentifier | first }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
|
data/metanorma-iso.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
31
31
|
|
32
|
-
spec.add_dependency "metanorma-standoc", "~> 2.
|
32
|
+
spec.add_dependency "metanorma-standoc", "~> 2.1.0"
|
33
33
|
spec.add_dependency "mnconvert", "~> 1.14"
|
34
34
|
spec.add_dependency "ruby-jing"
|
35
35
|
spec.add_dependency "tokenizer", "~> 0.3.0"
|