metanorma-iso 1.5.8 → 1.5.13
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/.github/workflows/rake.yml +66 -0
- data/README.adoc +5 -6
- data/lib/asciidoctor/iso/base.rb +5 -0
- data/lib/asciidoctor/iso/basicdoc.rng +4 -11
- data/lib/asciidoctor/iso/boilerplate-fr.xml +40 -0
- data/lib/asciidoctor/iso/boilerplate.xml +1 -0
- data/lib/asciidoctor/iso/cleanup.rb +38 -0
- data/lib/asciidoctor/iso/front.rb +14 -15
- data/lib/asciidoctor/iso/isodoc.rng +27 -50
- data/lib/asciidoctor/iso/isostandard.rng +16 -1
- data/lib/asciidoctor/iso/validate.rb +1 -1
- data/lib/asciidoctor/iso/validate_section.rb +9 -0
- data/lib/isodoc/iso/base_convert.rb +2 -1
- data/lib/isodoc/iso/html/header.html +12 -24
- data/lib/isodoc/iso/html/htmlstyle.css +1 -1
- data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
- data/lib/isodoc/iso/html/isodoc.css +42 -42
- data/lib/isodoc/iso/html/isodoc.scss +42 -42
- data/lib/isodoc/iso/html/style-human.css +14 -10
- data/lib/isodoc/iso/html/style-human.scss +7 -7
- data/lib/isodoc/iso/html/style-iso.css +12 -8
- data/lib/isodoc/iso/html/style-iso.scss +5 -5
- data/lib/isodoc/iso/html/wordstyle.css +67 -67
- data/lib/isodoc/iso/html/wordstyle.scss +67 -67
- data/lib/isodoc/iso/html_convert.rb +4 -0
- data/lib/isodoc/iso/i18n-en.yaml +4 -0
- data/lib/isodoc/iso/i18n-fr.yaml +5 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
- data/lib/isodoc/iso/i18n.rb +10 -11
- data/lib/isodoc/iso/iso.amendment.xsl +739 -141
- data/lib/isodoc/iso/iso.international-standard.xsl +739 -141
- data/lib/isodoc/iso/metadata.rb +20 -19
- data/lib/isodoc/iso/word_convert.rb +4 -0
- data/lib/isodoc/iso/xref.rb +10 -0
- data/lib/metanorma/iso/fonts_manifest.yaml +6 -0
- data/lib/metanorma/iso/processor.rb +0 -9
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/amd_spec.rb +7 -7
- data/spec/asciidoctor-iso/base_spec.rb +146 -18
- data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
- data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
- data/spec/asciidoctor-iso/lists_spec.rb +6 -6
- data/spec/asciidoctor-iso/refs_spec.rb +174 -143
- data/spec/asciidoctor-iso/section_spec.rb +5 -0
- data/spec/asciidoctor-iso/validate_spec.rb +52 -15
- data/spec/assets/xref_error.adoc +7 -0
- data/spec/isodoc/amd_spec.rb +191 -17
- data/spec/isodoc/blocks_spec.rb +2 -1
- data/spec/isodoc/i18n_spec.rb +13 -13
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/iso_spec.rb +2 -2
- data/spec/isodoc/metadata_spec.rb +172 -19
- data/spec/isodoc/postproc_spec.rb +3 -3
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +22 -2
- data/spec/isodoc/table_spec.rb +1 -1
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +23 -11
- data/spec/metanorma/processor_spec.rb +1 -1
- data/spec/spec_helper.rb +22 -2
- metadata +10 -9
- data/.github/workflows/macos.yml +0 -41
- data/.github/workflows/ubuntu.yml +0 -45
- data/.github/workflows/windows.yml +0 -43
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -272,7 +272,7 @@ RSpec.describe IsoDoc do
|
|
272
272
|
</iso-standard>
|
273
273
|
INPUT
|
274
274
|
<?xml version='1.0'?>
|
275
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
275
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
276
276
|
<preface>
|
277
277
|
<foreword>
|
278
278
|
<formula id='_be9158af-7e93-4ee2-90c5-26d31c181934' unnumbered='true'>
|
@@ -436,6 +436,7 @@ OUTPUT
|
|
436
436
|
<div id='_be9158af-7e93-4ee2-90c5-26d31c181934'><div class='formula'>
|
437
437
|
<p>
|
438
438
|
<span class='stem'>(#(r = 1 %)#)</span>
|
439
|
+
<span style='mso-tab-count:1'>  </span>
|
439
440
|
</p>
|
440
441
|
</div>
|
441
442
|
<p>where</p>
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -72,9 +72,9 @@ RSpec.describe IsoDoc do
|
|
72
72
|
INPUT
|
73
73
|
|
74
74
|
presxml = <<~OUTPUT
|
75
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
75
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
76
76
|
<bibdata>
|
77
|
-
<language>en</language>
|
77
|
+
<language current="true">en</language>
|
78
78
|
</bibdata>
|
79
79
|
<preface>
|
80
80
|
<foreword obligation='informative'>
|
@@ -238,12 +238,12 @@ RSpec.describe IsoDoc do
|
|
238
238
|
</body>
|
239
239
|
</html>
|
240
240
|
OUTPUT
|
241
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
241
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
242
242
|
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
243
243
|
end
|
244
244
|
|
245
245
|
it "defaults to English" do
|
246
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
246
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
247
247
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
248
248
|
<bibdata>
|
249
249
|
<language>tlh</language>
|
@@ -311,9 +311,9 @@ RSpec.describe IsoDoc do
|
|
311
311
|
</bibliography>
|
312
312
|
</iso-standard>
|
313
313
|
INPUT
|
314
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
314
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
315
315
|
<bibdata>
|
316
|
-
<language>tlh</language>
|
316
|
+
<language current="true">tlh</language>
|
317
317
|
</bibdata>
|
318
318
|
<preface>
|
319
319
|
<foreword obligation='informative'>
|
@@ -520,9 +520,9 @@ RSpec.describe IsoDoc do
|
|
520
520
|
INPUT
|
521
521
|
|
522
522
|
presxml = <<~OUTPUT
|
523
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
523
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
524
524
|
<bibdata>
|
525
|
-
<language>fr</language>
|
525
|
+
<language current="true">fr</language>
|
526
526
|
</bibdata>
|
527
527
|
<preface>
|
528
528
|
<foreword obligation='informative'>
|
@@ -685,7 +685,7 @@ OUTPUT
|
|
685
685
|
</body>
|
686
686
|
</html>
|
687
687
|
OUTPUT
|
688
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
688
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
689
689
|
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
690
690
|
end
|
691
691
|
|
@@ -770,10 +770,10 @@ OUTPUT
|
|
770
770
|
</iso-standard>
|
771
771
|
INPUT
|
772
772
|
presxml = <<~OUTPUT
|
773
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
773
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
774
774
|
<bibdata>
|
775
|
-
<language>zh</language>
|
776
|
-
<script>Hans</script>
|
775
|
+
<language current="true">zh</language>
|
776
|
+
<script current="true">Hans</script>
|
777
777
|
</bibdata>
|
778
778
|
<preface>
|
779
779
|
<foreword obligation='informative'>
|
@@ -947,7 +947,7 @@ OUTPUT
|
|
947
947
|
</body>
|
948
948
|
</html>
|
949
949
|
OUTPUT
|
950
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
950
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
951
951
|
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
952
952
|
end
|
953
953
|
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -194,7 +194,7 @@ RSpec.describe IsoDoc do
|
|
194
194
|
end
|
195
195
|
|
196
196
|
it "processes eref content" do
|
197
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
197
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)).sub(%r{<i18nyaml>.*</i18nyaml>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
198
198
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
199
199
|
<preface><foreword>
|
200
200
|
<p>
|
@@ -229,7 +229,7 @@ RSpec.describe IsoDoc do
|
|
229
229
|
</iso-standard>
|
230
230
|
INPUT
|
231
231
|
<?xml version='1.0'?>
|
232
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
232
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
233
233
|
<preface>
|
234
234
|
<foreword>
|
235
235
|
<p>
|
data/spec/isodoc/iso_spec.rb
CHANGED
@@ -175,7 +175,7 @@ end
|
|
175
175
|
</iso-standard>
|
176
176
|
INPUT
|
177
177
|
<?xml version='1.0'?>
|
178
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
178
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
179
179
|
<preface>
|
180
180
|
<foreword>
|
181
181
|
<example id='samplecode'>
|
@@ -231,7 +231,7 @@ OUTPUT
|
|
231
231
|
</iso-standard>
|
232
232
|
INPUT
|
233
233
|
<?xml version='1.0'?>
|
234
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
234
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
235
235
|
<preface>
|
236
236
|
<foreword>
|
237
237
|
<example id='samplecode'>
|
@@ -7,7 +7,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
7
7
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
8
8
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
9
9
|
INPUT
|
10
|
-
expect(
|
10
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
11
11
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
12
12
|
<bibdata type="standard">
|
13
13
|
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
@@ -64,6 +64,7 @@ RSpec.describe IsoDoc::Iso::Metadata do
|
|
64
64
|
<keyword>kw1</keyword>
|
65
65
|
<ext>
|
66
66
|
<doctype>international-standard</doctype>
|
67
|
+
<horizontal>true</horizontal>
|
67
68
|
<editorialgroup>
|
68
69
|
<technical-committee number="34">Food products</technical-committee>
|
69
70
|
<subcommittee number="4">Cereals and pulses</subcommittee>
|
@@ -81,8 +82,9 @@ INPUT
|
|
81
82
|
{:accesseddate=>"2012",
|
82
83
|
:activateddate=>"2013",
|
83
84
|
:agency=>"ISO",
|
84
|
-
:
|
85
|
-
:
|
85
|
+
:circulateddate=>"XXX",
|
86
|
+
:confirmeddate=>"XXX",
|
87
|
+
:copieddate=>"XXX",
|
86
88
|
:createddate=>"2010–2011",
|
87
89
|
:docnumber=>"ISO/PreCD3 17301-1",
|
88
90
|
:docnumber_lang=>"ISO/PreCD3 17301-1 (E)",
|
@@ -99,21 +101,25 @@ INPUT
|
|
99
101
|
:doctitlepart=>"Rice",
|
100
102
|
:doctitlepartlabel=>"Part 1",
|
101
103
|
:doctype=>"International Standard",
|
104
|
+
:doctype_display=>"International Standard",
|
102
105
|
:docyear=>"2016",
|
103
106
|
:draft=>"0.4",
|
104
107
|
:draftinfo=>" (draft 0.4, 2016-05-01)",
|
105
108
|
:edition=>"2",
|
106
109
|
:editorialgroup=>["TC 34", "SC 4", "WG 3"],
|
107
|
-
:
|
110
|
+
:horizontal=>"true",
|
111
|
+
:implementeddate=>"XXX",
|
112
|
+
:issueddate=>"XXX",
|
108
113
|
:keywords=>["kw2", "kw1"],
|
114
|
+
:lang=>"en",
|
109
115
|
:obsoleteddate=>"2014",
|
110
|
-
:obsoletes=>nil,
|
111
|
-
:obsoletes_part=>nil,
|
112
116
|
:publisheddate=>"2011",
|
113
117
|
:publisher=>"International Organization for Standardization",
|
118
|
+
:receiveddate=>"XXX",
|
114
119
|
:revdate=>"2016-05-01",
|
115
120
|
:revdate_monthyear=>"May 2016",
|
116
121
|
:sc=>"SC 4",
|
122
|
+
:script=>"Latn",
|
117
123
|
:secretariat=>"GB",
|
118
124
|
:stage=>"30",
|
119
125
|
:stage_int=>30,
|
@@ -121,17 +127,22 @@ INPUT
|
|
121
127
|
:statusabbr=>"PreCD3",
|
122
128
|
:tc=>"TC 34",
|
123
129
|
:tc_docnumber=>["17301", "17302"],
|
130
|
+
:transmitteddate=>"XXX",
|
131
|
+
:unchangeddate=>"XXX",
|
124
132
|
:unpublished=>true,
|
133
|
+
:updateddate=>"XXX",
|
134
|
+
:vote_endeddate=>"XXX",
|
135
|
+
:vote_starteddate=>"XXX",
|
125
136
|
:wg=>"WG 3"}
|
126
137
|
OUTPUT
|
127
138
|
end
|
128
139
|
|
129
|
-
it "processes IsoXML metadata" do
|
140
|
+
it "processes IsoXML metadata #2" do
|
130
141
|
c = IsoDoc::Iso::HtmlConvert.new({})
|
131
142
|
arr = c.convert_init(<<~"INPUT", "test", false)
|
132
143
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
133
144
|
INPUT
|
134
|
-
expect(
|
145
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
135
146
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
136
147
|
<bibdata type="standard">
|
137
148
|
<title>
|
@@ -203,13 +214,15 @@ OUTPUT
|
|
203
214
|
</bibdata>
|
204
215
|
</iso-standard>
|
205
216
|
INPUT
|
206
|
-
{:
|
207
|
-
:
|
208
|
-
:
|
217
|
+
{:accesseddate=>"XXX",
|
218
|
+
:agency=>"ISO/IEC",
|
219
|
+
:circulateddate=>"XXX",
|
220
|
+
:confirmeddate=>"XXX",
|
221
|
+
:copieddate=>"XXX",
|
222
|
+
:createddate=>"XXX",
|
209
223
|
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
210
224
|
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
211
225
|
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
212
|
-
:docnumeric=>nil,
|
213
226
|
:docsubtitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
214
227
|
:docsubtitleintro=>"Céréales et légumineuses",
|
215
228
|
:docsubtitlemain=>"Spécification et méthodes d'essai",
|
@@ -221,26 +234,166 @@ INPUT
|
|
221
234
|
:doctitlepart=>"Rice",
|
222
235
|
:doctitlepartlabel=>"Part 1–3",
|
223
236
|
:doctype=>"International Standard",
|
237
|
+
:doctype_display=>"International Standard",
|
224
238
|
:docyear=>"2016",
|
225
|
-
:draft=>nil,
|
226
|
-
:draftinfo=>"",
|
227
|
-
:edition=>nil,
|
228
239
|
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
229
240
|
:ics=>"1.2.3, 1.2.3",
|
230
|
-
:
|
241
|
+
:implementeddate=>"XXX",
|
242
|
+
:issueddate=>"XXX",
|
243
|
+
:lang=>"en",
|
244
|
+
:obsoleteddate=>"XXX",
|
231
245
|
:obsoletes=>"IEC 8121",
|
232
246
|
:obsoletes_part=>"3.1",
|
247
|
+
:publisheddate=>"XXX",
|
233
248
|
:publisher=>"International Organization for Standardization and International Electrotechnical Commission",
|
234
|
-
:
|
235
|
-
:
|
249
|
+
:receiveddate=>"XXX",
|
250
|
+
:sc=>"DEF 4",
|
251
|
+
:script=>"Latn",
|
252
|
+
:secretariat=>"XXX",
|
253
|
+
:stage=>"60",
|
254
|
+
:stage_int=>60,
|
255
|
+
:statusabbr=>"IS",
|
256
|
+
:tc=>"ABC 34",
|
257
|
+
:tc_docnumber=>["17301"],
|
258
|
+
:transmitteddate=>"XXX",
|
259
|
+
:unchangeddate=>"XXX",
|
260
|
+
:unpublished=>false,
|
261
|
+
:updateddate=>"XXX",
|
262
|
+
:vote_endeddate=>"XXX",
|
263
|
+
:vote_starteddate=>"XXX",
|
264
|
+
:wg=>"GHI 3"}
|
265
|
+
OUTPUT
|
266
|
+
end
|
267
|
+
|
268
|
+
it "processes IsoXML metadata in French" do
|
269
|
+
c = IsoDoc::Iso::HtmlConvert.new({})
|
270
|
+
arr = c.convert_init(<<~"INPUT", "test", false)
|
271
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
272
|
+
<bibdata>
|
273
|
+
<language>fr</language>
|
274
|
+
</bibdata>
|
275
|
+
</iso-standard>
|
276
|
+
INPUT
|
277
|
+
expect(metadata(c.info(Nokogiri::XML(<<~"INPUT"), nil))).to be_equivalent_to <<~"OUTPUT"
|
278
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
279
|
+
<bibdata type="standard">
|
280
|
+
<title>
|
281
|
+
<title type="title-intro" language="en" format="text/plain">Cereals and pulses</title>
|
282
|
+
<title type="title-main" language="en" format="text/plain">Specifications and test methods</title>
|
283
|
+
<title type="title-part" language="en" format="text/plain">Rice</title>
|
284
|
+
</title>
|
285
|
+
<title>
|
286
|
+
<title type="title-intro" language="fr" format="text/plain">Céréales et légumineuses</title>
|
287
|
+
<title type="title-main" language="fr" format="text/plain">Spécification et méthodes d'essai</title>
|
288
|
+
<title type="title-part" language="fr" format="text/plain">Riz</title>
|
289
|
+
</title>
|
290
|
+
<docidentifier type="ISO">ISO/IEC/CD 17301-1-3</docidentifier>
|
291
|
+
<docidentifier type="iso-with-lang">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
292
|
+
<docidentifier type="iso-reference">ISO/IEC/CD 17301-1-3 (E)</docidentifier>
|
293
|
+
<docidentifier type="iso-tc">17301</docidentifier>
|
294
|
+
<contributor>
|
295
|
+
<role type="author"/>
|
296
|
+
<organization>
|
297
|
+
<name>ISO</name>
|
298
|
+
</organization>
|
299
|
+
</contributor>
|
300
|
+
<contributor>
|
301
|
+
<role type="publisher"/>
|
302
|
+
<organization>
|
303
|
+
<name>International Organization for Standardization</name>
|
304
|
+
<abbreviation>ISO</abbreviation>
|
305
|
+
</organization>
|
306
|
+
</contributor>
|
307
|
+
<contributor>
|
308
|
+
<role type="publisher"/>
|
309
|
+
<organization>
|
310
|
+
<name>International Electrotechnical Commission</name>
|
311
|
+
<abbreviation>IEC</abbreviation>
|
312
|
+
</organization>
|
313
|
+
</contributor>
|
314
|
+
<language>fr</language>
|
315
|
+
<script>Latn</script>
|
316
|
+
<status>
|
317
|
+
<stage abbreviation="IS">60</stage>
|
318
|
+
<substage>92</substage>
|
319
|
+
</status>
|
320
|
+
<copyright>
|
321
|
+
<from>2016</from>
|
322
|
+
<owner>
|
323
|
+
<organization>
|
324
|
+
<name>International Organization for Standardization</name>
|
325
|
+
</organization>
|
326
|
+
</owner>
|
327
|
+
</copyright>
|
328
|
+
<relation type="obsoletes">
|
329
|
+
<locality type="clause"><referenceFrom>3.1</referenceFrom></locality>
|
330
|
+
<docidentifier>IEC 8121</docidentifier>
|
331
|
+
</relation>
|
332
|
+
<ext>
|
333
|
+
<doctype language="">international-standard</doctype>
|
334
|
+
<doctype language="fr">Standard International</doctype>
|
335
|
+
<editorialgroup>
|
336
|
+
<technical-committee number="34" type="ABC">Food products</technical-committee>
|
337
|
+
<subcommittee number="4" type="DEF">Cereals and pulses</subcommittee>
|
338
|
+
<workgroup number="3" type="GHI">Rice Group</workgroup>
|
339
|
+
</editorialgroup>
|
340
|
+
<ics><code>1.2.3</code></ics>
|
341
|
+
<ics><code>1.2.3</code></ics>
|
342
|
+
<structuredidentifier>
|
343
|
+
<project-number part="1" subpart="3">ISO/IEC/CD 17301</project-number>
|
344
|
+
</strucuredidentifier>
|
345
|
+
<stagename>International standard</stagename>
|
346
|
+
</ext>
|
347
|
+
</bibdata>
|
348
|
+
</iso-standard>
|
349
|
+
INPUT
|
350
|
+
{:accesseddate=>"XXX",
|
351
|
+
:agency=>"ISO/IEC",
|
352
|
+
:circulateddate=>"XXX",
|
353
|
+
:confirmeddate=>"XXX",
|
354
|
+
:copieddate=>"XXX",
|
355
|
+
:createddate=>"XXX",
|
356
|
+
:docnumber=>"ISO/IEC/CD 17301-1-3",
|
357
|
+
:docnumber_lang=>"ISO/IEC/CD 17301-1-3 (E)",
|
358
|
+
:docnumber_reference=>"ISO/IEC/CD 17301-1-3 (E)",
|
359
|
+
:docsubtitle=>"Cereals and pulses — Specifications and test methods — Part 1–3: Rice",
|
360
|
+
:docsubtitleintro=>"Cereals and pulses",
|
361
|
+
:docsubtitlemain=>"Specifications and test methods",
|
362
|
+
:docsubtitlepart=>"Rice",
|
363
|
+
:docsubtitlepartlabel=>"Part 1–3",
|
364
|
+
:doctitle=>"Céréales et légumineuses — Spécification et méthodes d'essai — Partie 1–3: Riz",
|
365
|
+
:doctitleintro=>"Céréales et légumineuses",
|
366
|
+
:doctitlemain=>"Spécification et méthodes d'essai",
|
367
|
+
:doctitlepart=>"Riz",
|
368
|
+
:doctitlepartlabel=>"Partie 1–3",
|
369
|
+
:doctype=>"International Standard",
|
370
|
+
:doctype_display=>"Standard International",
|
371
|
+
:docyear=>"2016",
|
372
|
+
:editorialgroup=>["ABC 34", "DEF 4", "GHI 3"],
|
373
|
+
:ics=>"1.2.3, 1.2.3",
|
374
|
+
:implementeddate=>"XXX",
|
375
|
+
:issueddate=>"XXX",
|
376
|
+
:lang=>"fr",
|
377
|
+
:obsoleteddate=>"XXX",
|
378
|
+
:obsoletes=>"IEC 8121",
|
379
|
+
:obsoletes_part=>"3.1",
|
380
|
+
:publisheddate=>"XXX",
|
381
|
+
:publisher=>"International Organization for Standardization et International Electrotechnical Commission",
|
382
|
+
:receiveddate=>"XXX",
|
236
383
|
:sc=>"DEF 4",
|
237
|
-
:
|
384
|
+
:script=>"Latn",
|
385
|
+
:secretariat=>"XXX",
|
238
386
|
:stage=>"60",
|
239
387
|
:stage_int=>60,
|
240
388
|
:statusabbr=>"IS",
|
241
389
|
:tc=>"ABC 34",
|
242
390
|
:tc_docnumber=>["17301"],
|
391
|
+
:transmitteddate=>"XXX",
|
392
|
+
:unchangeddate=>"XXX",
|
243
393
|
:unpublished=>false,
|
394
|
+
:updateddate=>"XXX",
|
395
|
+
:vote_endeddate=>"XXX",
|
396
|
+
:vote_starteddate=>"XXX",
|
244
397
|
:wg=>"GHI 3"}
|
245
398
|
OUTPUT
|
246
399
|
end
|
@@ -611,9 +611,9 @@ documentation.</p>
|
|
611
611
|
INPUT
|
612
612
|
|
613
613
|
presxml = <<~OUTPUT
|
614
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
614
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
615
615
|
<bibdata type="standard">
|
616
|
-
<status><stage>30</stage></status>
|
616
|
+
<status><stage language="">30</stage></status>
|
617
617
|
</bibdata>
|
618
618
|
<boilerplate>
|
619
619
|
<copyright-statement>
|
@@ -661,7 +661,7 @@ documentation.</p>
|
|
661
661
|
|
662
662
|
FileUtils.rm_f "test.doc"
|
663
663
|
FileUtils.rm_f "test.html"
|
664
|
-
expect((IsoDoc::Iso::PresentationXMLConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
664
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
665
665
|
IsoDoc::Iso::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", presxml, false)
|
666
666
|
word = File.read("test.html", encoding: "UTF-8")
|
667
667
|
expect((word)).to include '<h1 class="IntroTitle">Warning for Stuff</h1>'
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -42,7 +42,7 @@ RSpec.describe IsoDoc do
|
|
42
42
|
<abbreviation>ISO</abbreviation>
|
43
43
|
</organization>
|
44
44
|
</contributor>
|
45
|
-
<note format="text/plain" reference="1" type="
|
45
|
+
<note format="text/plain" reference="1" type="Unpublished-Status">Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
|
46
46
|
<extent type="part">
|
47
47
|
<referenceFrom>all</referenceFrom>
|
48
48
|
</extent>
|
@@ -121,9 +121,9 @@ RSpec.describe IsoDoc do
|
|
121
121
|
</iso-standard>
|
122
122
|
INPUT
|
123
123
|
presxml = <<~OUTPUT
|
124
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
124
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
125
125
|
<bibdata>
|
126
|
-
<language>en</language>
|
126
|
+
<language current="true">en</language>
|
127
127
|
</bibdata>
|
128
128
|
<preface>
|
129
129
|
<foreword>
|
@@ -175,7 +175,7 @@ RSpec.describe IsoDoc do
|
|
175
175
|
<abbreviation>ISO</abbreviation>
|
176
176
|
</organization>
|
177
177
|
</contributor>
|
178
|
-
<note format='text/plain' reference='1' type='
|
178
|
+
<note format='text/plain' reference='1' type='Unpublished-Status'>Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
|
179
179
|
<extent type='part'>
|
180
180
|
<referenceFrom>all</referenceFrom>
|
181
181
|
</extent>
|
@@ -339,7 +339,7 @@ html = <<~OUTPUT
|
|
339
339
|
</body>
|
340
340
|
</html>
|
341
341
|
OUTPUT
|
342
|
-
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
342
|
+
expect(xmlpp(IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", input, true)).sub(%r{<localized-strings>.*</localized-strings>}m, "")).to be_equivalent_to xmlpp(presxml)
|
343
343
|
expect(xmlpp(IsoDoc::Iso::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
344
344
|
end
|
345
345
|
|