metanorma-acme 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +16 -11
- data/appveyor.yml +7 -2
- data/lib/asciidoctor/acme/acme.rng +6 -83
- data/lib/asciidoctor/acme/biblio.rng +44 -15
- data/lib/asciidoctor/acme/converter.rb +2 -5
- data/lib/asciidoctor/acme/isodoc.rng +128 -71
- data/lib/asciidoctor/acme/isostandard.rng +29 -304
- data/lib/asciidoctor/acme/reqt.rng +5 -0
- data/lib/isodoc/acme/base_convert.rb +74 -0
- data/lib/isodoc/acme/html/html_acme_titlepage.html +3 -3
- data/lib/isodoc/acme/html/word_acme_titlepage.html +1 -1
- data/lib/isodoc/acme/html_convert.rb +2 -67
- data/lib/isodoc/acme/metadata.rb +3 -9
- data/lib/isodoc/acme/pdf_convert.rb +2 -66
- data/lib/isodoc/acme/word_convert.rb +2 -77
- data/lib/metanorma/acme/version.rb +1 -1
- data/metanorma-acme.gemspec +3 -3
- metadata +9 -22
@@ -4,36 +4,6 @@
|
|
4
4
|
<start>
|
5
5
|
<ref name="iso-standard"/>
|
6
6
|
</start>
|
7
|
-
<define name="language">
|
8
|
-
<element name="language">
|
9
|
-
<choice>
|
10
|
-
<value>en</value>
|
11
|
-
<value>fr</value>
|
12
|
-
</choice>
|
13
|
-
</element>
|
14
|
-
</define>
|
15
|
-
<define name="script">
|
16
|
-
<element name="script">
|
17
|
-
<value>Latn</value>
|
18
|
-
</element>
|
19
|
-
</define>
|
20
|
-
<!-- add type to docidentifier in isodoc? -->
|
21
|
-
<define name="docidentifier">
|
22
|
-
<element name="docidentifier">
|
23
|
-
<optional>
|
24
|
-
<attribute name="type"/>
|
25
|
-
</optional>
|
26
|
-
<choice>
|
27
|
-
<text/>
|
28
|
-
<group>
|
29
|
-
<ref name="documentnumber"/>
|
30
|
-
<optional>
|
31
|
-
<ref name="tc-documentnumber"/>
|
32
|
-
</optional>
|
33
|
-
</group>
|
34
|
-
</choice>
|
35
|
-
</element>
|
36
|
-
</define>
|
37
7
|
<define name="organization">
|
38
8
|
<element name="organization">
|
39
9
|
<ref name="orgname"/>
|
@@ -63,190 +33,24 @@
|
|
63
33
|
</optional>
|
64
34
|
</element>
|
65
35
|
</define>
|
66
|
-
<define name="
|
67
|
-
<optional>
|
68
|
-
<attribute name="type">
|
69
|
-
<ref name="BibItemType"/>
|
70
|
-
</attribute>
|
71
|
-
</optional>
|
72
|
-
<optional>
|
73
|
-
<ref name="fetched"/>
|
74
|
-
</optional>
|
75
|
-
<choice>
|
76
|
-
<oneOrMore>
|
77
|
-
<ref name="btitle"/>
|
78
|
-
</oneOrMore>
|
79
|
-
<ref name="formattedref"/>
|
80
|
-
</choice>
|
81
|
-
<zeroOrMore>
|
82
|
-
<ref name="bsource"/>
|
83
|
-
</zeroOrMore>
|
84
|
-
<zeroOrMore>
|
85
|
-
<ref name="docidentifier"/>
|
86
|
-
</zeroOrMore>
|
87
|
-
<optional>
|
88
|
-
<ref name="docnumber"/>
|
89
|
-
</optional>
|
90
|
-
<zeroOrMore>
|
91
|
-
<ref name="bdate"/>
|
92
|
-
</zeroOrMore>
|
93
|
-
<zeroOrMore>
|
94
|
-
<ref name="contributor"/>
|
95
|
-
</zeroOrMore>
|
96
|
-
<optional>
|
97
|
-
<ref name="edition"/>
|
98
|
-
</optional>
|
99
|
-
<optional>
|
100
|
-
<ref name="version"/>
|
101
|
-
</optional>
|
102
|
-
<zeroOrMore>
|
103
|
-
<ref name="biblionote"/>
|
104
|
-
</zeroOrMore>
|
105
|
-
<zeroOrMore>
|
106
|
-
<ref name="language"/>
|
107
|
-
</zeroOrMore>
|
108
|
-
<zeroOrMore>
|
109
|
-
<ref name="script"/>
|
110
|
-
</zeroOrMore>
|
111
|
-
<zeroOrMore>
|
112
|
-
<ref name="abstract"/>
|
113
|
-
</zeroOrMore>
|
114
|
-
<optional>
|
115
|
-
<ref name="status"/>
|
116
|
-
</optional>
|
117
|
-
<optional>
|
118
|
-
<ref name="copyright"/>
|
119
|
-
</optional>
|
120
|
-
<zeroOrMore>
|
121
|
-
<ref name="docrelation"/>
|
122
|
-
</zeroOrMore>
|
123
|
-
<zeroOrMore>
|
124
|
-
<ref name="series"/>
|
125
|
-
</zeroOrMore>
|
126
|
-
<optional>
|
127
|
-
<ref name="medium"/>
|
128
|
-
</optional>
|
129
|
-
<zeroOrMore>
|
130
|
-
<ref name="bplace"/>
|
131
|
-
</zeroOrMore>
|
132
|
-
<zeroOrMore>
|
133
|
-
<ref name="extent"/>
|
134
|
-
</zeroOrMore>
|
135
|
-
<zeroOrMore>
|
136
|
-
<ref name="accesslocation"/>
|
137
|
-
</zeroOrMore>
|
138
|
-
<optional>
|
139
|
-
<ref name="bclassification"/>
|
140
|
-
</optional>
|
141
|
-
<optional>
|
142
|
-
<ref name="validity"/>
|
143
|
-
</optional>
|
144
|
-
<optional>
|
145
|
-
<ref name="editorialgroup"/>
|
146
|
-
</optional>
|
147
|
-
<zeroOrMore>
|
148
|
-
<ref name="ics"/>
|
149
|
-
</zeroOrMore>
|
150
|
-
<optional>
|
151
|
-
<ref name="allParts"/>
|
152
|
-
</optional>
|
153
|
-
</define>
|
154
|
-
<define name="BibData">
|
155
|
-
<optional>
|
156
|
-
<attribute name="type">
|
157
|
-
<ref name="BibItemType"/>
|
158
|
-
</attribute>
|
159
|
-
</optional>
|
160
|
-
<oneOrMore>
|
161
|
-
<ref name="btitle"/>
|
162
|
-
</oneOrMore>
|
163
|
-
<optional>
|
164
|
-
<ref name="formattedref"/>
|
165
|
-
</optional>
|
166
|
-
<zeroOrMore>
|
167
|
-
<ref name="bsource"/>
|
168
|
-
</zeroOrMore>
|
169
|
-
<zeroOrMore>
|
170
|
-
<ref name="docidentifier"/>
|
171
|
-
</zeroOrMore>
|
172
|
-
<optional>
|
173
|
-
<ref name="docnumber"/>
|
174
|
-
</optional>
|
175
|
-
<zeroOrMore>
|
176
|
-
<ref name="bdate"/>
|
177
|
-
</zeroOrMore>
|
178
|
-
<zeroOrMore>
|
179
|
-
<ref name="contributor"/>
|
180
|
-
</zeroOrMore>
|
181
|
-
<optional>
|
182
|
-
<ref name="edition"/>
|
183
|
-
</optional>
|
184
|
-
<optional>
|
185
|
-
<ref name="version"/>
|
186
|
-
</optional>
|
187
|
-
<zeroOrMore>
|
188
|
-
<ref name="biblionote"/>
|
189
|
-
</zeroOrMore>
|
190
|
-
<zeroOrMore>
|
191
|
-
<ref name="language"/>
|
192
|
-
</zeroOrMore>
|
193
|
-
<zeroOrMore>
|
194
|
-
<ref name="script"/>
|
195
|
-
</zeroOrMore>
|
196
|
-
<zeroOrMore>
|
197
|
-
<ref name="abstract"/>
|
198
|
-
</zeroOrMore>
|
199
|
-
<optional>
|
200
|
-
<ref name="status"/>
|
201
|
-
</optional>
|
202
|
-
<ref name="copyright"/>
|
203
|
-
<zeroOrMore>
|
204
|
-
<ref name="docrelation"/>
|
205
|
-
</zeroOrMore>
|
206
|
-
<zeroOrMore>
|
207
|
-
<ref name="series"/>
|
208
|
-
</zeroOrMore>
|
36
|
+
<define name="BibDataExtensionType">
|
209
37
|
<optional>
|
210
|
-
<ref name="
|
211
|
-
</optional>
|
212
|
-
<zeroOrMore>
|
213
|
-
<ref name="bplace"/>
|
214
|
-
</zeroOrMore>
|
215
|
-
<zeroOrMore>
|
216
|
-
<ref name="extent"/>
|
217
|
-
</zeroOrMore>
|
218
|
-
<zeroOrMore>
|
219
|
-
<ref name="accesslocation"/>
|
220
|
-
</zeroOrMore>
|
221
|
-
<optional>
|
222
|
-
<ref name="bclassification"/>
|
223
|
-
</optional>
|
224
|
-
<optional>
|
225
|
-
<ref name="validity"/>
|
38
|
+
<ref name="doctype"/>
|
226
39
|
</optional>
|
227
40
|
<ref name="editorialgroup"/>
|
228
41
|
<zeroOrMore>
|
229
42
|
<ref name="ics"/>
|
230
43
|
</zeroOrMore>
|
231
|
-
<
|
232
|
-
<ref name="allParts"/>
|
233
|
-
</optional>
|
44
|
+
<ref name="structuredidentifier"/>
|
234
45
|
</define>
|
235
46
|
<define name="bdate">
|
236
47
|
<element name="date">
|
237
48
|
<attribute name="type">
|
238
49
|
<choice>
|
239
|
-
<
|
240
|
-
<
|
241
|
-
<value>created</value>
|
242
|
-
<value>implemented</value>
|
243
|
-
<value>obsoleted</value>
|
244
|
-
<value>confirmed</value>
|
245
|
-
<value>updated</value>
|
246
|
-
<value>issued</value>
|
50
|
+
<ref name="BibliographicDateType"/>
|
51
|
+
<text/>
|
247
52
|
</choice>
|
248
53
|
</attribute>
|
249
|
-
<!-- ( ( bfrom, bto? ) | date_on ) -->
|
250
54
|
<choice>
|
251
55
|
<group>
|
252
56
|
<element name="from">
|
@@ -267,47 +71,6 @@
|
|
267
71
|
</choice>
|
268
72
|
</element>
|
269
73
|
</define>
|
270
|
-
<define name="biblionote">
|
271
|
-
<element name="note">
|
272
|
-
<optional>
|
273
|
-
<!-- Biblio date notes can be footnoted -->
|
274
|
-
<attribute name="reference"/>
|
275
|
-
</optional>
|
276
|
-
<ref name="FormattedString"/>
|
277
|
-
</element>
|
278
|
-
</define>
|
279
|
-
<define name="status">
|
280
|
-
<element name="status">
|
281
|
-
<choice>
|
282
|
-
<ref name="FormattedString"/>
|
283
|
-
<group>
|
284
|
-
<ref name="stage"/>
|
285
|
-
<optional>
|
286
|
-
<ref name="substage"/>
|
287
|
-
</optional>
|
288
|
-
<optional>
|
289
|
-
<ref name="iteration"/>
|
290
|
-
</optional>
|
291
|
-
</group>
|
292
|
-
</choice>
|
293
|
-
</element>
|
294
|
-
</define>
|
295
|
-
<define name="btitle">
|
296
|
-
<element name="title">
|
297
|
-
<choice>
|
298
|
-
<ref name="FormattedString"/>
|
299
|
-
<group>
|
300
|
-
<optional>
|
301
|
-
<ref name="title-intro"/>
|
302
|
-
</optional>
|
303
|
-
<ref name="title-main"/>
|
304
|
-
<optional>
|
305
|
-
<ref name="title-part"/>
|
306
|
-
</optional>
|
307
|
-
</group>
|
308
|
-
</choice>
|
309
|
-
</element>
|
310
|
-
</define>
|
311
74
|
<define name="sections">
|
312
75
|
<element name="sections">
|
313
76
|
<ref name="clause"/>
|
@@ -752,6 +515,16 @@
|
|
752
515
|
</optional>
|
753
516
|
</element>
|
754
517
|
</define>
|
518
|
+
<define name="DocumentType">
|
519
|
+
<choice>
|
520
|
+
<value>international-standard</value>
|
521
|
+
<value>technical-specification</value>
|
522
|
+
<value>technical-report</value>
|
523
|
+
<value>publicly-available-specification</value>
|
524
|
+
<value>international-workshop-agreement</value>
|
525
|
+
<value>guide</value>
|
526
|
+
</choice>
|
527
|
+
</define>
|
755
528
|
</include>
|
756
529
|
<!-- end overrides -->
|
757
530
|
<!--
|
@@ -764,6 +537,9 @@
|
|
764
537
|
<zeroOrMore>
|
765
538
|
<ref name="termdocsource"/>
|
766
539
|
</zeroOrMore>
|
540
|
+
<optional>
|
541
|
+
<ref name="boilerplate"/>
|
542
|
+
</optional>
|
767
543
|
<ref name="preface"/>
|
768
544
|
<oneOrMore>
|
769
545
|
<ref name="sections"/>
|
@@ -784,16 +560,6 @@
|
|
784
560
|
</oneOrMore>
|
785
561
|
</element>
|
786
562
|
</define>
|
787
|
-
<define name="BibItemType" combine="choice">
|
788
|
-
<choice>
|
789
|
-
<value>international-standard</value>
|
790
|
-
<value>technical-specification</value>
|
791
|
-
<value>technical-report</value>
|
792
|
-
<value>publicly-available-specification</value>
|
793
|
-
<value>international-workshop-agreement</value>
|
794
|
-
<value>guide</value>
|
795
|
-
</choice>
|
796
|
-
</define>
|
797
563
|
<define name="editorialgroup">
|
798
564
|
<element name="editorialgroup">
|
799
565
|
<oneOrMore>
|
@@ -825,38 +591,17 @@
|
|
825
591
|
<ref name="Content-Section"/>
|
826
592
|
</element>
|
827
593
|
</define>
|
828
|
-
<define name="
|
829
|
-
<element name="
|
830
|
-
<
|
831
|
-
<
|
832
|
-
|
833
|
-
|
834
|
-
<
|
835
|
-
<
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
<value>95</value>
|
840
|
-
</choice>
|
841
|
-
</element>
|
842
|
-
</define>
|
843
|
-
<define name="substage">
|
844
|
-
<element name="substage">
|
845
|
-
<choice>
|
846
|
-
<value>00</value>
|
847
|
-
<value>20</value>
|
848
|
-
<value>60</value>
|
849
|
-
<value>90</value>
|
850
|
-
<value>92</value>
|
851
|
-
<value>93</value>
|
852
|
-
<value>98</value>
|
853
|
-
<value>99</value>
|
854
|
-
</choice>
|
855
|
-
</element>
|
856
|
-
</define>
|
857
|
-
<define name="iteration">
|
858
|
-
<element name="iteration">
|
859
|
-
<data type="int"/>
|
594
|
+
<define name="structuredidentifier">
|
595
|
+
<element name="structuredidentifier">
|
596
|
+
<optional>
|
597
|
+
<attribute name="type"/>
|
598
|
+
</optional>
|
599
|
+
<group>
|
600
|
+
<ref name="documentnumber"/>
|
601
|
+
<optional>
|
602
|
+
<ref name="tc-documentnumber"/>
|
603
|
+
</optional>
|
604
|
+
</group>
|
860
605
|
</element>
|
861
606
|
</define>
|
862
607
|
<define name="documentnumber">
|
@@ -910,26 +655,6 @@
|
|
910
655
|
<text/>
|
911
656
|
</element>
|
912
657
|
</define>
|
913
|
-
<define name="title-intro">
|
914
|
-
<element name="title-intro">
|
915
|
-
<ref name="FormattedString"/>
|
916
|
-
</element>
|
917
|
-
</define>
|
918
|
-
<define name="title-main">
|
919
|
-
<element name="title-main">
|
920
|
-
<ref name="FormattedString"/>
|
921
|
-
</element>
|
922
|
-
</define>
|
923
|
-
<define name="title-part">
|
924
|
-
<element name="title-part">
|
925
|
-
<ref name="FormattedString"/>
|
926
|
-
</element>
|
927
|
-
</define>
|
928
|
-
<define name="allParts">
|
929
|
-
<element name="allparts">
|
930
|
-
<data type="boolean"/>
|
931
|
-
</element>
|
932
|
-
</define>
|
933
658
|
<define name="clause-hanging-paragraph-with-footnote">
|
934
659
|
<element name="clause">
|
935
660
|
<optional>
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require "isodoc"
|
2
|
+
require_relative "metadata"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
module IsoDoc
|
6
|
+
module Acme
|
7
|
+
module BaseConvert
|
8
|
+
def convert1(docxml, filename, dir)
|
9
|
+
FileUtils.cp html_doc_path('logo.jpg'), File.join(@localdir, "logo.jpg")
|
10
|
+
@files_to_delete << File.join(@localdir, "logo.jpg")
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def metadata_init(lang, script, labels)
|
15
|
+
@meta = Metadata.new(lang, script, labels)
|
16
|
+
end
|
17
|
+
|
18
|
+
def info(isoxml, out)
|
19
|
+
@meta.security isoxml, out
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
def annex_name(annex, name, div)
|
24
|
+
div.h1 **{ class: "Annex" } do |t|
|
25
|
+
t << "#{anchor(annex['id'], :label)} "
|
26
|
+
t.br
|
27
|
+
t.b do |b|
|
28
|
+
name&.children&.each { |c2| parse(c2, b) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def term_defs_boilerplate(div, source, term, preface)
|
34
|
+
if source.empty? && term.nil?
|
35
|
+
div << @no_terms_boilerplate
|
36
|
+
else
|
37
|
+
div << term_defs_boilerplate_cont(source, term)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def i18n_init(lang, script)
|
42
|
+
super
|
43
|
+
@annex_lbl = "Appendix"
|
44
|
+
end
|
45
|
+
|
46
|
+
def fileloc(loc)
|
47
|
+
File.join(File.dirname(__FILE__), loc)
|
48
|
+
end
|
49
|
+
|
50
|
+
def cleanup(docxml)
|
51
|
+
super
|
52
|
+
term_cleanup(docxml)
|
53
|
+
end
|
54
|
+
|
55
|
+
def term_cleanup(docxml)
|
56
|
+
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
57
|
+
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
58
|
+
h2.add_child(" ")
|
59
|
+
h2.add_child(d.remove)
|
60
|
+
end
|
61
|
+
docxml
|
62
|
+
end
|
63
|
+
|
64
|
+
def make_body(xml, docxml)
|
65
|
+
body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
|
66
|
+
xml.body **body_attr do |body|
|
67
|
+
make_body1(body, docxml)
|
68
|
+
make_body2(body, docxml)
|
69
|
+
make_body3(body, docxml)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|