metanorma-jis 0.0.1

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.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.hound.yml +5 -0
  3. data/.rubocop.yml +10 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +12 -0
  6. data/LICENSE +25 -0
  7. data/README.adoc +81 -0
  8. data/lib/html2doc/lists.rb +166 -0
  9. data/lib/isodoc/jis/base_convert.rb +41 -0
  10. data/lib/isodoc/jis/html/header.html +934 -0
  11. data/lib/isodoc/jis/html/html_jis_intro.html +8 -0
  12. data/lib/isodoc/jis/html/html_jis_titlepage.html +79 -0
  13. data/lib/isodoc/jis/html/htmlstyle.css +47 -0
  14. data/lib/isodoc/jis/html/htmlstyle.scss +45 -0
  15. data/lib/isodoc/jis/html/isodoc.css +12080 -0
  16. data/lib/isodoc/jis/html/isodoc.scss +11551 -0
  17. data/lib/isodoc/jis/html/style-human.css +1107 -0
  18. data/lib/isodoc/jis/html/style-human.scss +783 -0
  19. data/lib/isodoc/jis/html/style-iso.css +1133 -0
  20. data/lib/isodoc/jis/html/style-iso.scss +800 -0
  21. data/lib/isodoc/jis/html/word_jis_intro.html +14 -0
  22. data/lib/isodoc/jis/html/word_jis_titlepage.html +128 -0
  23. data/lib/isodoc/jis/html/wordstyle.css +3477 -0
  24. data/lib/isodoc/jis/html/wordstyle.scss +3378 -0
  25. data/lib/isodoc/jis/html_convert.rb +37 -0
  26. data/lib/isodoc/jis/i18n-ja.yaml +214 -0
  27. data/lib/isodoc/jis/i18n.rb +15 -0
  28. data/lib/isodoc/jis/init.rb +34 -0
  29. data/lib/isodoc/jis/metadata.rb +52 -0
  30. data/lib/isodoc/jis/pdf_convert.rb +17 -0
  31. data/lib/isodoc/jis/presentation_xml_convert.rb +11 -0
  32. data/lib/isodoc/jis/word_convert.rb +153 -0
  33. data/lib/isodoc/jis/xref.rb +6 -0
  34. data/lib/metanorma/jis/basicdoc.rng +1125 -0
  35. data/lib/metanorma/jis/biblio-standoc.rng +164 -0
  36. data/lib/metanorma/jis/biblio.rng +1461 -0
  37. data/lib/metanorma/jis/converter.rb +71 -0
  38. data/lib/metanorma/jis/front.rb +51 -0
  39. data/lib/metanorma/jis/isodoc.rng +2450 -0
  40. data/lib/metanorma/jis/isostandard.rng +316 -0
  41. data/lib/metanorma/jis/jis.rng +63 -0
  42. data/lib/metanorma/jis/processor.rb +53 -0
  43. data/lib/metanorma/jis/relaton-jis.rng +231 -0
  44. data/lib/metanorma/jis/reqt.rng +226 -0
  45. data/lib/metanorma/jis/version.rb +6 -0
  46. data/lib/metanorma/jis.rb +6 -0
  47. data/lib/metanorma-jis.rb +16 -0
  48. data/metanorma-jis.gemspec +49 -0
  49. metadata +303 -0
@@ -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
+ <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
4
+ <include href="isodoc.rng">
5
+ <start>
6
+ <ref name="iso-standard"/>
7
+ </start>
8
+ <define name="sections">
9
+ <element name="sections">
10
+ <zeroOrMore>
11
+ <choice>
12
+ <ref name="note"/>
13
+ <ref name="admonition"/>
14
+ </choice>
15
+ </zeroOrMore>
16
+ <ref name="clause"/>
17
+ <optional>
18
+ <choice>
19
+ <ref name="term-clause"/>
20
+ <ref name="terms"/>
21
+ </choice>
22
+ </optional>
23
+ <optional>
24
+ <ref name="definitions"/>
25
+ </optional>
26
+ <oneOrMore>
27
+ <choice>
28
+ <ref name="clause"/>
29
+ <ref name="term-clause"/>
30
+ <ref name="terms"/>
31
+ </choice>
32
+ </oneOrMore>
33
+ </element>
34
+ </define>
35
+ <define name="Clause-Section">
36
+ <optional>
37
+ <attribute name="id">
38
+ <data type="ID"/>
39
+ </attribute>
40
+ </optional>
41
+ <optional>
42
+ <attribute name="language"/>
43
+ </optional>
44
+ <optional>
45
+ <attribute name="script"/>
46
+ </optional>
47
+ <optional>
48
+ <attribute name="inline-header">
49
+ <data type="boolean"/>
50
+ </attribute>
51
+ </optional>
52
+ <optional>
53
+ <attribute name="obligation">
54
+ <choice>
55
+ <value>normative</value>
56
+ <value>informative</value>
57
+ </choice>
58
+ </attribute>
59
+ </optional>
60
+ <optional>
61
+ <attribute name="type"/>
62
+ </optional>
63
+ <optional>
64
+ <ref name="section-title"/>
65
+ </optional>
66
+ <choice>
67
+ <choice>
68
+ <oneOrMore>
69
+ <ref name="BasicBlock"/>
70
+ </oneOrMore>
71
+ <ref name="amend"/>
72
+ </choice>
73
+ <oneOrMore>
74
+ <ref name="clause-subsection"/>
75
+ </oneOrMore>
76
+ </choice>
77
+ </define>
78
+ <define name="term">
79
+ <element name="term">
80
+ <optional>
81
+ <attribute name="id">
82
+ <data type="ID"/>
83
+ </attribute>
84
+ </optional>
85
+ <optional>
86
+ <attribute name="language"/>
87
+ </optional>
88
+ <optional>
89
+ <attribute name="script"/>
90
+ </optional>
91
+ <ref name="BlockAttributes"/>
92
+ <ref name="preferred"/>
93
+ <zeroOrMore>
94
+ <ref name="admitted"/>
95
+ </zeroOrMore>
96
+ <zeroOrMore>
97
+ <ref name="deprecates"/>
98
+ </zeroOrMore>
99
+ <optional>
100
+ <ref name="termdomain"/>
101
+ </optional>
102
+ <ref name="termdefinition"/>
103
+ <zeroOrMore>
104
+ <ref name="termnote"/>
105
+ </zeroOrMore>
106
+ <zeroOrMore>
107
+ <ref name="termexample"/>
108
+ </zeroOrMore>
109
+ <zeroOrMore>
110
+ <ref name="termsource"/>
111
+ </zeroOrMore>
112
+ <zeroOrMore>
113
+ <ref name="term"/>
114
+ </zeroOrMore>
115
+ </element>
116
+ </define>
117
+ <define name="annex">
118
+ <element name="annex">
119
+ <optional>
120
+ <attribute name="id">
121
+ <data type="ID"/>
122
+ </attribute>
123
+ </optional>
124
+ <optional>
125
+ <attribute name="language"/>
126
+ </optional>
127
+ <optional>
128
+ <attribute name="script"/>
129
+ </optional>
130
+ <optional>
131
+ <attribute name="inline-header">
132
+ <data type="boolean"/>
133
+ </attribute>
134
+ </optional>
135
+ <optional>
136
+ <attribute name="obligation">
137
+ <choice>
138
+ <value>normative</value>
139
+ <value>informative</value>
140
+ </choice>
141
+ </attribute>
142
+ </optional>
143
+ <optional>
144
+ <ref name="section-title"/>
145
+ </optional>
146
+ <zeroOrMore>
147
+ <!--
148
+ allow hanging paragraps in annexes: they introduce lists
149
+ ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
150
+ -->
151
+ <ref name="BasicBlock"/>
152
+ </zeroOrMore>
153
+ <zeroOrMore>
154
+ <ref name="clause-hanging-paragraph-with-footnote"/>
155
+ </zeroOrMore>
156
+ <zeroOrMore>
157
+ <ref name="annex-appendix"/>
158
+ </zeroOrMore>
159
+ </element>
160
+ </define>
161
+ <define name="AdmonitionType">
162
+ <choice>
163
+ <value>danger</value>
164
+ <value>caution</value>
165
+ <value>warning</value>
166
+ <value>important</value>
167
+ <value>safety precautions</value>
168
+ <value>editorial</value>
169
+ </choice>
170
+ </define>
171
+ <define name="preface">
172
+ <element name="preface">
173
+ <optional>
174
+ <ref name="abstract"/>
175
+ </optional>
176
+ <ref name="foreword"/>
177
+ <optional>
178
+ <ref name="introduction"/>
179
+ </optional>
180
+ </element>
181
+ </define>
182
+ <define name="foreword">
183
+ <element name="foreword">
184
+ <ref name="Basic-Section"/>
185
+ </element>
186
+ </define>
187
+ <define name="introduction">
188
+ <element name="introduction">
189
+ <ref name="Content-Section"/>
190
+ </element>
191
+ </define>
192
+ <define name="Content-Section">
193
+ <optional>
194
+ <attribute name="id">
195
+ <data type="ID"/>
196
+ </attribute>
197
+ </optional>
198
+ <optional>
199
+ <attribute name="language"/>
200
+ </optional>
201
+ <optional>
202
+ <attribute name="script"/>
203
+ </optional>
204
+ <optional>
205
+ <attribute name="inline-header">
206
+ <data type="boolean"/>
207
+ </attribute>
208
+ </optional>
209
+ <optional>
210
+ <attribute name="obligation">
211
+ <choice>
212
+ <value>normative</value>
213
+ <value>informative</value>
214
+ </choice>
215
+ </attribute>
216
+ </optional>
217
+ <optional>
218
+ <attribute name="number"/>
219
+ </optional>
220
+ <optional>
221
+ <attribute name="type"/>
222
+ </optional>
223
+ <optional>
224
+ <ref name="section-title"/>
225
+ </optional>
226
+ <choice>
227
+ <zeroOrMore>
228
+ <ref name="BasicBlock"/>
229
+ </zeroOrMore>
230
+ <oneOrMore>
231
+ <ref name="content-subsection"/>
232
+ </oneOrMore>
233
+ </choice>
234
+ </define>
235
+ </include>
236
+ <!-- end overrides -->
237
+ <!--
238
+ We display the Normative References between scope and terms; but to keep the
239
+ grammar simple, we keep the references together
240
+ -->
241
+ <define name="iso-standard">
242
+ <element name="iso-standard">
243
+ <attribute name="version"/>
244
+ <attribute name="type">
245
+ <choice>
246
+ <value>semantic</value>
247
+ <value>presentation</value>
248
+ </choice>
249
+ </attribute>
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,63 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar ns="https://www.metanorma.org/ns/jis" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <!-- default namespace = "https://www.metanorma.com/ns/jis" -->
4
+ <include href="relaton-jis.rng"/>
5
+ <include href="isostandard.rng">
6
+ <start>
7
+ <ref name="jis-standard"/>
8
+ </start>
9
+ </include>
10
+ <!-- end overrides -->
11
+ <define name="floating-section-title">
12
+ <element name="section-title">
13
+ <attribute name="id">
14
+ <data type="ID"/>
15
+ </attribute>
16
+ <attribute name="depth">
17
+ <data type="int"/>
18
+ </attribute>
19
+ <zeroOrMore>
20
+ <ref name="TextElement"/>
21
+ </zeroOrMore>
22
+ </element>
23
+ </define>
24
+ <!--
25
+ We display the Normative References between scope and terms; but to keep the
26
+ grammar simple, we keep the references together
27
+ -->
28
+ <define name="jis-standard">
29
+ <element name="jis-standard">
30
+ <attribute name="version"/>
31
+ <attribute name="type">
32
+ <choice>
33
+ <value>semantic</value>
34
+ <value>presentation</value>
35
+ </choice>
36
+ </attribute>
37
+ <ref name="bibdata"/>
38
+ <zeroOrMore>
39
+ <ref name="termdocsource"/>
40
+ </zeroOrMore>
41
+ <optional>
42
+ <ref name="misccontainer"/>
43
+ </optional>
44
+ <optional>
45
+ <ref name="boilerplate"/>
46
+ </optional>
47
+ <ref name="preface"/>
48
+ <oneOrMore>
49
+ <ref name="sections"/>
50
+ </oneOrMore>
51
+ <zeroOrMore>
52
+ <ref name="annex"/>
53
+ </zeroOrMore>
54
+ <ref name="bibliography"/>
55
+ <zeroOrMore>
56
+ <ref name="indexsect"/>
57
+ </zeroOrMore>
58
+ <optional>
59
+ <ref name="colophon"/>
60
+ </optional>
61
+ </element>
62
+ </define>
63
+ </grammar>
@@ -0,0 +1,53 @@
1
+ require "metanorma/processor"
2
+
3
+ module Metanorma
4
+ module JIS
5
+ class Processor < Metanorma::Processor
6
+
7
+ def initialize # rubocop:disable Lint/MissingSuper
8
+ @short = :jis
9
+ @input_format = :asciidoc
10
+ @asciidoctor_backend = :jis
11
+ end
12
+
13
+ def output_formats
14
+ super.merge(
15
+ html: "html",
16
+ # pdf: "pdf",
17
+ doc: "doc",
18
+ )
19
+ end
20
+
21
+ def fonts_manifest
22
+ {
23
+ "STIX Two Math" => nil,
24
+ "MS Gothic" => nil,
25
+ "MS Mincho" => nil,
26
+ "Courier New" => nil,
27
+ "Cambria Math" => nil,
28
+ "Times New Roman" => nil,
29
+ "Arial" => nil,
30
+ }
31
+ end
32
+
33
+ def version
34
+ "Metanorma::JIS #{Metanorma::JIS::VERSION}"
35
+ end
36
+
37
+ def output(xml, inname, outname, format, options = {})
38
+ case format
39
+ when :html
40
+ IsoDoc::JIS::HtmlConvert.new(options).convert(inname, xml, nil, outname)
41
+ when :doc
42
+ IsoDoc::JIS::WordConvert.new(options).convert(inname, xml, nil, outname)
43
+ when :pdf
44
+ IsoDoc::JIS::PdfConvert.new(options).convert(inname, xml, nil, outname)
45
+ when :presentation
46
+ IsoDoc::JIS::PresentationXMLConvert.new(options).convert(inname, xml, nil, outname)
47
+ else
48
+ super
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,231 @@
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
+ <optional>
10
+ <ref name="docsubtype"/>
11
+ </optional>
12
+ <ref name="editorialgroup"/>
13
+ <zeroOrMore>
14
+ <ref name="ics"/>
15
+ </zeroOrMore>
16
+ <ref name="structuredidentifier"/>
17
+ <optional>
18
+ <ref name="stagename"/>
19
+ </optional>
20
+ </define>
21
+ <define name="bdate">
22
+ <element name="date">
23
+ <attribute name="type">
24
+ <choice>
25
+ <ref name="BibliographicDateType"/>
26
+ <text/>
27
+ </choice>
28
+ </attribute>
29
+ <choice>
30
+ <group>
31
+ <element name="from">
32
+ <ref name="ISO8601Date"/>
33
+ </element>
34
+ <optional>
35
+ <element name="to">
36
+ <ref name="ISO8601Date"/>
37
+ </element>
38
+ </optional>
39
+ </group>
40
+ <element name="on">
41
+ <choice>
42
+ <ref name="ISO8601Date"/>
43
+ <value>--</value>
44
+ <value>–</value>
45
+ </choice>
46
+ </element>
47
+ </choice>
48
+ </element>
49
+ </define>
50
+ <define name="organization">
51
+ <element name="organization">
52
+ <oneOrMore>
53
+ <ref name="orgname"/>
54
+ </oneOrMore>
55
+ <optional>
56
+ <ref name="abbreviation"/>
57
+ </optional>
58
+ <optional>
59
+ <ref name="uri"/>
60
+ </optional>
61
+ <zeroOrMore>
62
+ <ref name="org-identifier"/>
63
+ </zeroOrMore>
64
+ <zeroOrMore>
65
+ <ref name="contact"/>
66
+ </zeroOrMore>
67
+ <optional>
68
+ <ref name="technical-committee"/>
69
+ </optional>
70
+ <optional>
71
+ <ref name="subcommittee"/>
72
+ </optional>
73
+ <optional>
74
+ <ref name="workgroup"/>
75
+ </optional>
76
+ <optional>
77
+ <ref name="secretariat"/>
78
+ </optional>
79
+ </element>
80
+ </define>
81
+ <define name="DocumentType">
82
+ <choice>
83
+ <value>british-standard</value>
84
+ <value>draft-for-development</value>
85
+ <value>published-document</value>
86
+ <value>privately-subscribed-standard</value>
87
+ <value>publicly-available-specification</value>
88
+ <value>flex-standard</value>
89
+ <value>international-standard</value>
90
+ <value>technical-specification</value>
91
+ <value>technical-report</value>
92
+ <value>guide</value>
93
+ <value>international-workshop-agreement</value>
94
+ <value>industry-technical-agreement</value>
95
+ <value>standard</value>
96
+ <value>european-workshop-agreement</value>
97
+ <value>fast-track-standard</value>
98
+ <value>expert-commentary</value>
99
+ </choice>
100
+ </define>
101
+ <define name="DocumentSubtype">
102
+ <choice>
103
+ <value>specification</value>
104
+ <value>method-of-test</value>
105
+ <value>method-of-specifying</value>
106
+ <value>vocabulary</value>
107
+ <value>code-of-practice</value>
108
+ </choice>
109
+ </define>
110
+ <define name="structuredidentifier">
111
+ <element name="structuredidentifier">
112
+ <optional>
113
+ <attribute name="type"/>
114
+ </optional>
115
+ <group>
116
+ <ref name="documentnumber"/>
117
+ <optional>
118
+ <ref name="tc-documentnumber"/>
119
+ </optional>
120
+ </group>
121
+ </element>
122
+ </define>
123
+ <define name="editorialgroup">
124
+ <element name="editorialgroup">
125
+ <ref name="ISOProjectGroup"/>
126
+ </element>
127
+ </define>
128
+ </include>
129
+ <define name="updates_document_type">
130
+ <element name="updates-document-type">
131
+ <ref name="DocumentType"/>
132
+ </element>
133
+ </define>
134
+ <define name="ISOProjectGroup">
135
+ <zeroOrMore>
136
+ <ref name="agency"/>
137
+ </zeroOrMore>
138
+ <oneOrMore>
139
+ <ref name="technical-committee"/>
140
+ </oneOrMore>
141
+ <zeroOrMore>
142
+ <ref name="subcommittee"/>
143
+ </zeroOrMore>
144
+ <zeroOrMore>
145
+ <ref name="workgroup"/>
146
+ </zeroOrMore>
147
+ <optional>
148
+ <ref name="secretariat"/>
149
+ </optional>
150
+ </define>
151
+ <define name="approvalgroup">
152
+ <element name="approvalgroup">
153
+ <ref name="ISOProjectGroup"/>
154
+ </element>
155
+ </define>
156
+ <define name="agency">
157
+ <element name="agency">
158
+ <text/>
159
+ </element>
160
+ </define>
161
+ <define name="horizontal">
162
+ <element name="horizontal">
163
+ <data type="boolean"/>
164
+ </element>
165
+ </define>
166
+ <define name="documentnumber">
167
+ <element name="project-number">
168
+ <optional>
169
+ <attribute name="part">
170
+ <data type="int"/>
171
+ </attribute>
172
+ </optional>
173
+ <optional>
174
+ <attribute name="subpart">
175
+ <data type="int"/>
176
+ </attribute>
177
+ </optional>
178
+ <optional>
179
+ <attribute name="amendment">
180
+ <data type="int"/>
181
+ </attribute>
182
+ </optional>
183
+ <optional>
184
+ <attribute name="corrigendum">
185
+ <data type="int"/>
186
+ </attribute>
187
+ </optional>
188
+ <optional>
189
+ <attribute name="origyr">
190
+ <ref name="ISO8601Date"/>
191
+ </attribute>
192
+ </optional>
193
+ <text/>
194
+ </element>
195
+ </define>
196
+ <define name="tc-documentnumber">
197
+ <element name="tc-document-number">
198
+ <data type="int"/>
199
+ </element>
200
+ </define>
201
+ <define name="subcommittee">
202
+ <element name="subcommittee">
203
+ <ref name="IsoWorkgroup"/>
204
+ </element>
205
+ </define>
206
+ <define name="workgroup">
207
+ <element name="workgroup">
208
+ <ref name="IsoWorkgroup"/>
209
+ </element>
210
+ </define>
211
+ <define name="secretariat">
212
+ <element name="secretariat">
213
+ <text/>
214
+ </element>
215
+ </define>
216
+ <define name="stagename">
217
+ <element name="stagename">
218
+ <optional>
219
+ <attribute name="abbreviation"/>
220
+ </optional>
221
+ <text/>
222
+ </element>
223
+ </define>
224
+ <define name="coverimages">
225
+ <element name="coverimages">
226
+ <oneOrMore>
227
+ <ref name="image"/>
228
+ </oneOrMore>
229
+ </element>
230
+ </define>
231
+ </grammar>