metanorma-plateau 0.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.
@@ -0,0 +1,316 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ VERSION v1.2.1
5
+ default namespace isostandard = "https://www.metanorma.com/ns/iso"
6
+ -->
7
+ <include href="isodoc.rng">
8
+ <start>
9
+ <ref name="iso-standard"/>
10
+ </start>
11
+ <define name="sections">
12
+ <element name="sections">
13
+ <zeroOrMore>
14
+ <choice>
15
+ <ref name="note"/>
16
+ <ref name="admonition"/>
17
+ </choice>
18
+ </zeroOrMore>
19
+ <ref name="clause"/>
20
+ <optional>
21
+ <choice>
22
+ <ref name="term-clause"/>
23
+ <ref name="terms"/>
24
+ </choice>
25
+ </optional>
26
+ <optional>
27
+ <ref name="definitions"/>
28
+ </optional>
29
+ <oneOrMore>
30
+ <choice>
31
+ <ref name="clause"/>
32
+ <ref name="term-clause"/>
33
+ <ref name="terms"/>
34
+ </choice>
35
+ </oneOrMore>
36
+ </element>
37
+ </define>
38
+ <define name="Clause-Section">
39
+ <optional>
40
+ <attribute name="id">
41
+ <data type="ID"/>
42
+ </attribute>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="language"/>
46
+ </optional>
47
+ <optional>
48
+ <attribute name="script"/>
49
+ </optional>
50
+ <optional>
51
+ <attribute name="inline-header">
52
+ <data type="boolean"/>
53
+ </attribute>
54
+ </optional>
55
+ <optional>
56
+ <attribute name="obligation">
57
+ <choice>
58
+ <value>normative</value>
59
+ <value>informative</value>
60
+ </choice>
61
+ </attribute>
62
+ </optional>
63
+ <optional>
64
+ <attribute name="type"/>
65
+ </optional>
66
+ <optional>
67
+ <ref name="section-title"/>
68
+ </optional>
69
+ <choice>
70
+ <choice>
71
+ <oneOrMore>
72
+ <ref name="BasicBlock"/>
73
+ </oneOrMore>
74
+ <ref name="amend"/>
75
+ </choice>
76
+ <oneOrMore>
77
+ <ref name="clause-subsection"/>
78
+ </oneOrMore>
79
+ </choice>
80
+ </define>
81
+ <define name="term">
82
+ <element name="term">
83
+ <optional>
84
+ <attribute name="id">
85
+ <data type="ID"/>
86
+ </attribute>
87
+ </optional>
88
+ <optional>
89
+ <attribute name="language"/>
90
+ </optional>
91
+ <optional>
92
+ <attribute name="script"/>
93
+ </optional>
94
+ <ref name="BlockAttributes"/>
95
+ <ref name="preferred"/>
96
+ <zeroOrMore>
97
+ <ref name="admitted"/>
98
+ </zeroOrMore>
99
+ <zeroOrMore>
100
+ <ref name="deprecates"/>
101
+ </zeroOrMore>
102
+ <optional>
103
+ <ref name="termdomain"/>
104
+ </optional>
105
+ <ref name="termdefinition"/>
106
+ <zeroOrMore>
107
+ <ref name="termnote"/>
108
+ </zeroOrMore>
109
+ <zeroOrMore>
110
+ <ref name="termexample"/>
111
+ </zeroOrMore>
112
+ <zeroOrMore>
113
+ <ref name="termsource"/>
114
+ </zeroOrMore>
115
+ <zeroOrMore>
116
+ <ref name="term"/>
117
+ </zeroOrMore>
118
+ </element>
119
+ </define>
120
+ <define name="annex">
121
+ <element name="annex">
122
+ <optional>
123
+ <attribute name="id">
124
+ <data type="ID"/>
125
+ </attribute>
126
+ </optional>
127
+ <optional>
128
+ <attribute name="language"/>
129
+ </optional>
130
+ <optional>
131
+ <attribute name="script"/>
132
+ </optional>
133
+ <optional>
134
+ <attribute name="inline-header">
135
+ <data type="boolean"/>
136
+ </attribute>
137
+ </optional>
138
+ <optional>
139
+ <attribute name="obligation">
140
+ <choice>
141
+ <value>normative</value>
142
+ <value>informative</value>
143
+ </choice>
144
+ </attribute>
145
+ </optional>
146
+ <optional>
147
+ <ref name="section-title"/>
148
+ </optional>
149
+ <zeroOrMore>
150
+ <!--
151
+ allow hanging paragraps in annexes: they introduce lists
152
+ ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
153
+ -->
154
+ <ref name="BasicBlock"/>
155
+ </zeroOrMore>
156
+ <zeroOrMore>
157
+ <ref name="clause-hanging-paragraph-with-footnote"/>
158
+ </zeroOrMore>
159
+ <zeroOrMore>
160
+ <ref name="annex-appendix"/>
161
+ </zeroOrMore>
162
+ </element>
163
+ </define>
164
+ <define name="AdmonitionType">
165
+ <choice>
166
+ <value>danger</value>
167
+ <value>caution</value>
168
+ <value>warning</value>
169
+ <value>important</value>
170
+ <value>safety precautions</value>
171
+ <value>editorial</value>
172
+ </choice>
173
+ </define>
174
+ <define name="preface">
175
+ <element name="preface">
176
+ <optional>
177
+ <ref name="abstract"/>
178
+ </optional>
179
+ <ref name="foreword"/>
180
+ <optional>
181
+ <ref name="introduction"/>
182
+ </optional>
183
+ </element>
184
+ </define>
185
+ <define name="foreword">
186
+ <element name="foreword">
187
+ <ref name="Basic-Section"/>
188
+ </element>
189
+ </define>
190
+ <define name="introduction">
191
+ <element name="introduction">
192
+ <ref name="Content-Section"/>
193
+ </element>
194
+ </define>
195
+ <define name="Content-Section">
196
+ <optional>
197
+ <attribute name="id">
198
+ <data type="ID"/>
199
+ </attribute>
200
+ </optional>
201
+ <optional>
202
+ <attribute name="language"/>
203
+ </optional>
204
+ <optional>
205
+ <attribute name="script"/>
206
+ </optional>
207
+ <optional>
208
+ <attribute name="inline-header">
209
+ <data type="boolean"/>
210
+ </attribute>
211
+ </optional>
212
+ <optional>
213
+ <attribute name="obligation">
214
+ <choice>
215
+ <value>normative</value>
216
+ <value>informative</value>
217
+ </choice>
218
+ </attribute>
219
+ </optional>
220
+ <optional>
221
+ <attribute name="number"/>
222
+ </optional>
223
+ <optional>
224
+ <attribute name="branch-number"/>
225
+ </optional>
226
+ <optional>
227
+ <attribute name="type"/>
228
+ </optional>
229
+ <optional>
230
+ <ref name="section-title"/>
231
+ </optional>
232
+ <choice>
233
+ <zeroOrMore>
234
+ <ref name="BasicBlock"/>
235
+ </zeroOrMore>
236
+ <oneOrMore>
237
+ <ref name="content-subsection"/>
238
+ </oneOrMore>
239
+ </choice>
240
+ </define>
241
+ </include>
242
+ <!-- end overrides -->
243
+ <!--
244
+ We display the Normative References between scope and terms; but to keep the
245
+ grammar simple, we keep the references together
246
+ -->
247
+ <define name="iso-standard">
248
+ <element name="iso-standard">
249
+ <ref name="Root-Attributes"/>
250
+ <ref name="bibdata"/>
251
+ <zeroOrMore>
252
+ <ref name="termdocsource"/>
253
+ </zeroOrMore>
254
+ <optional>
255
+ <ref name="misccontainer"/>
256
+ </optional>
257
+ <optional>
258
+ <ref name="boilerplate"/>
259
+ </optional>
260
+ <ref name="preface"/>
261
+ <oneOrMore>
262
+ <ref name="sections"/>
263
+ </oneOrMore>
264
+ <zeroOrMore>
265
+ <ref name="annex"/>
266
+ </zeroOrMore>
267
+ <ref name="bibliography"/>
268
+ <zeroOrMore>
269
+ <ref name="indexsect"/>
270
+ </zeroOrMore>
271
+ </element>
272
+ </define>
273
+ <define name="clause-hanging-paragraph-with-footnote">
274
+ <element name="clause">
275
+ <optional>
276
+ <attribute name="id">
277
+ <data type="ID"/>
278
+ </attribute>
279
+ </optional>
280
+ <optional>
281
+ <attribute name="language"/>
282
+ </optional>
283
+ <optional>
284
+ <attribute name="script"/>
285
+ </optional>
286
+ <optional>
287
+ <attribute name="inline-header">
288
+ <data type="boolean"/>
289
+ </attribute>
290
+ </optional>
291
+ <optional>
292
+ <attribute name="obligation">
293
+ <choice>
294
+ <value>normative</value>
295
+ <value>informative</value>
296
+ </choice>
297
+ </attribute>
298
+ </optional>
299
+ <optional>
300
+ <ref name="section-title"/>
301
+ </optional>
302
+ <zeroOrMore>
303
+ <!-- allow hanging paragraphs in annexes: they introduce lists -->
304
+ <ref name="BasicBlock"/>
305
+ </zeroOrMore>
306
+ <zeroOrMore>
307
+ <ref name="clause-hanging-paragraph-with-footnote"/>
308
+ </zeroOrMore>
309
+ </element>
310
+ </define>
311
+ <define name="annex-appendix">
312
+ <element name="appendix">
313
+ <ref name="Clause-Section"/>
314
+ </element>
315
+ </define>
316
+ </grammar>
@@ -0,0 +1,70 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!--
4
+ VERSION v1.2.1
5
+ default namespace = "https://www.metanorma.com/ns/jis"
6
+ -->
7
+ <include href="relaton-jis.rng"/>
8
+ <include href="isostandard.rng">
9
+ <start>
10
+ <ref name="jis-standard"/>
11
+ </start>
12
+ <define name="annex">
13
+ <element name="annex">
14
+ <optional>
15
+ <attribute name="commentary">
16
+ <data type="boolean"/>
17
+ </attribute>
18
+ </optional>
19
+ <ref name="Annex-Section"/>
20
+ </element>
21
+ </define>
22
+ </include>
23
+ <!-- end overrides -->
24
+ <define name="floating-section-title">
25
+ <element name="section-title">
26
+ <attribute name="id">
27
+ <data type="ID"/>
28
+ </attribute>
29
+ <attribute name="depth">
30
+ <data type="int"/>
31
+ </attribute>
32
+ <zeroOrMore>
33
+ <ref name="TextElement"/>
34
+ </zeroOrMore>
35
+ </element>
36
+ </define>
37
+ <!--
38
+ We display the Normative References between scope and terms; but to keep the
39
+ grammar simple, we keep the references together
40
+ -->
41
+ <define name="jis-standard">
42
+ <element name="jis-standard">
43
+ <ref name="Root-Attributes"/>
44
+ <ref name="bibdata"/>
45
+ <zeroOrMore>
46
+ <ref name="termdocsource"/>
47
+ </zeroOrMore>
48
+ <optional>
49
+ <ref name="misccontainer"/>
50
+ </optional>
51
+ <optional>
52
+ <ref name="boilerplate"/>
53
+ </optional>
54
+ <ref name="preface"/>
55
+ <oneOrMore>
56
+ <ref name="sections"/>
57
+ </oneOrMore>
58
+ <zeroOrMore>
59
+ <ref name="annex"/>
60
+ </zeroOrMore>
61
+ <ref name="bibliography"/>
62
+ <zeroOrMore>
63
+ <ref name="indexsect"/>
64
+ </zeroOrMore>
65
+ <optional>
66
+ <ref name="colophon"/>
67
+ </optional>
68
+ </element>
69
+ </define>
70
+ </grammar>
@@ -0,0 +1,98 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar ns='https://www.metanorma.org/ns/plateau' xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ VERSION v1.2.1
5
+ default namespace = "https://www.metanorma.com/ns/jis"
6
+ -->
7
+ <!--
8
+ include "relaton-jis.rnc" { }
9
+ jis.rnc already includes relaton-jis.rnc, if we have distinct metadata, will need to abstract jis-compile.rnc
10
+ -->
11
+ <include href="jis.rng">
12
+ <start>
13
+ <ref name="plateau-standard"/>
14
+ </start>
15
+ <define name="ParagraphFnBody">
16
+ <zeroOrMore>
17
+ <choice>
18
+ <ref name="TextElement"/>
19
+ <ref name="fn"/>
20
+ </choice>
21
+ </zeroOrMore>
22
+ <zeroOrMore>
23
+ <ref name="note"/>
24
+ </zeroOrMore>
25
+ <zeroOrMore>
26
+ <ref name="source"/>
27
+ </zeroOrMore>
28
+ </define>
29
+ <define name="UlBody">
30
+ <oneOrMore>
31
+ <ref name="li"/>
32
+ </oneOrMore>
33
+ <zeroOrMore>
34
+ <ref name="note"/>
35
+ </zeroOrMore>
36
+ <zeroOrMore>
37
+ <ref name="source"/>
38
+ </zeroOrMore>
39
+ </define>
40
+ <define name="OlBody">
41
+ <oneOrMore>
42
+ <ref name="li"/>
43
+ </oneOrMore>
44
+ <zeroOrMore>
45
+ <ref name="note"/>
46
+ </zeroOrMore>
47
+ <zeroOrMore>
48
+ <ref name="source"/>
49
+ </zeroOrMore>
50
+ </define>
51
+ <define name="DlBody">
52
+ <oneOrMore>
53
+ <ref name="dt"/>
54
+ <ref name="dd"/>
55
+ </oneOrMore>
56
+ <zeroOrMore>
57
+ <ref name="note"/>
58
+ </zeroOrMore>
59
+ <zeroOrMore>
60
+ <ref name="source"/>
61
+ </zeroOrMore>
62
+ </define>
63
+ </include>
64
+ <!-- end overrides -->
65
+ <!--
66
+ We display the Normative References between scope and terms; but to keep the
67
+ grammar simple, we keep the references together
68
+ -->
69
+ <define name="plateau-standard">
70
+ <element name="plateau-standard">
71
+ <ref name="Root-Attributes"/>
72
+ <ref name="bibdata"/>
73
+ <zeroOrMore>
74
+ <ref name="termdocsource"/>
75
+ </zeroOrMore>
76
+ <optional>
77
+ <ref name="misccontainer"/>
78
+ </optional>
79
+ <optional>
80
+ <ref name="boilerplate"/>
81
+ </optional>
82
+ <ref name="preface"/>
83
+ <oneOrMore>
84
+ <ref name="sections"/>
85
+ </oneOrMore>
86
+ <zeroOrMore>
87
+ <ref name="annex"/>
88
+ </zeroOrMore>
89
+ <ref name="bibliography"/>
90
+ <zeroOrMore>
91
+ <ref name="indexsect"/>
92
+ </zeroOrMore>
93
+ <optional>
94
+ <ref name="colophon"/>
95
+ </optional>
96
+ </element>
97
+ </define>
98
+ </grammar>
@@ -0,0 +1,54 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module Plateau
5
+ class Processor < Metanorma::JIS::Processor
6
+ def initialize # rubocop:disable Lint/MissingSuper
7
+ @short = :plateau
8
+ @input_format = :asciidoc
9
+ @asciidoctor_backend = :plateau
10
+ end
11
+
12
+ def output_formats
13
+ super.merge(
14
+ html: "html",
15
+ pdf: "pdf",
16
+ )
17
+ end
18
+
19
+ def fonts_manifest
20
+ {
21
+ "Yu Gothic" => nil,
22
+ "Noto Sans Condensed" => nil,
23
+ "Noto Sans CJK JP" => nil,
24
+ "STIX Two Math" => nil,
25
+ "Courier New" => nil,
26
+ "Cambria Math" => nil,
27
+ "Times New Roman" => nil,
28
+ "Arial" => nil,
29
+ }
30
+ end
31
+
32
+ def version
33
+ "Metanorma::Plateau #{Metanorma::Plateau::VERSION}"
34
+ end
35
+
36
+ def output(xml, inname, outname, format, options = {})
37
+ options_preprocess(options)
38
+ case format
39
+ when :html
40
+ IsoDoc::Plateau::HtmlConvert.new(options)
41
+ .convert(inname, xml, nil, outname)
42
+ when :pdf
43
+ IsoDoc::Plateau::PdfConvert.new(options)
44
+ .convert(inname, xml, nil, outname)
45
+ when :presentation
46
+ IsoDoc::Plateau::PresentationXMLConvert.new(options)
47
+ .convert(inname, xml, nil, outname)
48
+ else
49
+ super
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,125 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="biblio-standoc.rng">
4
+ <define name="BibDataExtensionType">
5
+ <optional>
6
+ <attribute name="schema-version"/>
7
+ </optional>
8
+ <ref name="doctype"/>
9
+ <ref name="editorialgroup"/>
10
+ <zeroOrMore>
11
+ <ref name="ics"/>
12
+ </zeroOrMore>
13
+ <ref name="structuredidentifier"/>
14
+ <optional>
15
+ <ref name="stagename"/>
16
+ </optional>
17
+ </define>
18
+ <define name="DocumentType">
19
+ <choice>
20
+ <value>japanese-industrial-standard</value>
21
+ <value>technical-report</value>
22
+ <value>technical-specification</value>
23
+ <value>amendment</value>
24
+ </choice>
25
+ </define>
26
+ <define name="structuredidentifier">
27
+ <element name="structuredidentifier">
28
+ <optional>
29
+ <attribute name="type"/>
30
+ </optional>
31
+ <group>
32
+ <ref name="documentnumber"/>
33
+ <optional>
34
+ <ref name="tc-documentnumber"/>
35
+ </optional>
36
+ </group>
37
+ </element>
38
+ </define>
39
+ <define name="editorialgroup">
40
+ <element name="editorialgroup">
41
+ <ref name="ISOProjectGroup"/>
42
+ </element>
43
+ </define>
44
+ </include>
45
+ <define name="ISOProjectGroup">
46
+ <zeroOrMore>
47
+ <ref name="agency"/>
48
+ </zeroOrMore>
49
+ <oneOrMore>
50
+ <ref name="technical-committee"/>
51
+ </oneOrMore>
52
+ <zeroOrMore>
53
+ <ref name="subcommittee"/>
54
+ </zeroOrMore>
55
+ <zeroOrMore>
56
+ <ref name="workgroup"/>
57
+ </zeroOrMore>
58
+ <optional>
59
+ <ref name="secretariat"/>
60
+ </optional>
61
+ </define>
62
+ <define name="agency">
63
+ <element name="agency">
64
+ <text/>
65
+ </element>
66
+ </define>
67
+ <define name="documentnumber">
68
+ <element name="project-number">
69
+ <optional>
70
+ <attribute name="part">
71
+ <data type="int"/>
72
+ </attribute>
73
+ </optional>
74
+ <optional>
75
+ <attribute name="subpart">
76
+ <data type="int"/>
77
+ </attribute>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="amendment">
81
+ <data type="int"/>
82
+ </attribute>
83
+ </optional>
84
+ <optional>
85
+ <attribute name="corrigendum">
86
+ <data type="int"/>
87
+ </attribute>
88
+ </optional>
89
+ <optional>
90
+ <attribute name="origyr">
91
+ <ref name="ISO8601Date"/>
92
+ </attribute>
93
+ </optional>
94
+ <text/>
95
+ </element>
96
+ </define>
97
+ <define name="tc-documentnumber">
98
+ <element name="tc-document-number">
99
+ <data type="int"/>
100
+ </element>
101
+ </define>
102
+ <define name="subcommittee">
103
+ <element name="subcommittee">
104
+ <ref name="IsoWorkgroup"/>
105
+ </element>
106
+ </define>
107
+ <define name="workgroup">
108
+ <element name="workgroup">
109
+ <ref name="IsoWorkgroup"/>
110
+ </element>
111
+ </define>
112
+ <define name="secretariat">
113
+ <element name="secretariat">
114
+ <text/>
115
+ </element>
116
+ </define>
117
+ <define name="stagename">
118
+ <element name="stagename">
119
+ <optional>
120
+ <attribute name="abbreviation"/>
121
+ </optional>
122
+ <text/>
123
+ </element>
124
+ </define>
125
+ </grammar>