metanorma-iso 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +4 -0
  3. data/.gitignore +11 -0
  4. data/.hound.yml +3 -0
  5. data/.oss-guides.rubocop.yml +1077 -0
  6. data/.rubocop.ribose.yml +66 -0
  7. data/.rubocop.tb.yml +650 -0
  8. data/.rubocop.yml +15 -0
  9. data/.travis.yml +21 -0
  10. data/CODE_OF_CONDUCT.md +46 -0
  11. data/Gemfile +7 -0
  12. data/LICENSE +25 -0
  13. data/Makefile +39 -0
  14. data/README.adoc +882 -0
  15. data/Rakefile +6 -0
  16. data/asciidoctor-iso.gemspec.old +50 -0
  17. data/bin/rspec +18 -0
  18. data/docs/customisation.adoc +186 -0
  19. data/docs/guidance.adoc +436 -0
  20. data/docs/htmloutput.adoc +115 -0
  21. data/docs/quickstart.adoc +375 -0
  22. data/lib/asciidoctor-iso.rb +11 -0
  23. data/lib/asciidoctor/iso/base.rb +48 -0
  24. data/lib/asciidoctor/iso/biblio.rng +836 -0
  25. data/lib/asciidoctor/iso/cleanup.rb +39 -0
  26. data/lib/asciidoctor/iso/converter.rb +19 -0
  27. data/lib/asciidoctor/iso/front.rb +131 -0
  28. data/lib/asciidoctor/iso/isodoc.rng +1059 -0
  29. data/lib/asciidoctor/iso/isostandard.rnc +176 -0
  30. data/lib/asciidoctor/iso/isostandard.rng +1001 -0
  31. data/lib/asciidoctor/iso/section.rb +72 -0
  32. data/lib/asciidoctor/iso/validate.rb +190 -0
  33. data/lib/asciidoctor/iso/validate_requirements.rb +105 -0
  34. data/lib/asciidoctor/iso/validate_section.rb +214 -0
  35. data/lib/asciidoctor/iso/validate_style.rb +134 -0
  36. data/lib/asciidoctor/iso/version.rb +5 -0
  37. data/lib/isodoc/iso/html/header.html +206 -0
  38. data/lib/isodoc/iso/html/html_iso_intro.html +34 -0
  39. data/lib/isodoc/iso/html/html_iso_titlepage.html +34 -0
  40. data/lib/isodoc/iso/html/htmlstyle.scss +46 -0
  41. data/lib/isodoc/iso/html/isodoc.scss +696 -0
  42. data/lib/isodoc/iso/html/scripts.html +174 -0
  43. data/lib/isodoc/iso/html/style-human.scss +1277 -0
  44. data/lib/isodoc/iso/html/style-iso.scss +1257 -0
  45. data/lib/isodoc/iso/html/word_iso_intro.html +72 -0
  46. data/lib/isodoc/iso/html/word_iso_titlepage.html +62 -0
  47. data/lib/isodoc/iso/html/wordstyle.scss +1175 -0
  48. data/lib/isodoc/iso/html_convert.rb +118 -0
  49. data/lib/isodoc/iso/metadata.rb +107 -0
  50. data/lib/isodoc/iso/word_convert.rb +141 -0
  51. data/lib/metanorma/iso.rb +7 -0
  52. data/lib/metanorma/iso/processor.rb +44 -0
  53. data/spec/asciidoctor-iso/base_spec.rb +350 -0
  54. data/spec/asciidoctor-iso/blocks_spec.rb +469 -0
  55. data/spec/asciidoctor-iso/cleanup_spec.rb +765 -0
  56. data/spec/asciidoctor-iso/inline_spec.rb +162 -0
  57. data/spec/asciidoctor-iso/isobib_cache_spec.rb +332 -0
  58. data/spec/asciidoctor-iso/lists_spec.rb +190 -0
  59. data/spec/asciidoctor-iso/macros_spec.rb +111 -0
  60. data/spec/asciidoctor-iso/refs_spec.rb +643 -0
  61. data/spec/asciidoctor-iso/section_spec.rb +334 -0
  62. data/spec/asciidoctor-iso/table_spec.rb +307 -0
  63. data/spec/asciidoctor-iso/validate_spec.rb +907 -0
  64. data/spec/assets/header.html +7 -0
  65. data/spec/assets/html.css +2 -0
  66. data/spec/assets/htmlcover.html +4 -0
  67. data/spec/assets/htmlintro.html +5 -0
  68. data/spec/assets/i18n.yaml +2 -0
  69. data/spec/assets/iso.doc +1093 -0
  70. data/spec/assets/iso.headless.html +33 -0
  71. data/spec/assets/iso.html +278 -0
  72. data/spec/assets/iso.xml +8 -0
  73. data/spec/assets/rice_image1.png +0 -0
  74. data/spec/assets/scripts.html +3 -0
  75. data/spec/assets/std.css +2 -0
  76. data/spec/assets/word.css +2 -0
  77. data/spec/assets/wordcover.html +3 -0
  78. data/spec/assets/wordintro.html +4 -0
  79. data/spec/examples/103_01_02.html +247 -0
  80. data/spec/examples/english.yaml +69 -0
  81. data/spec/examples/iso_123_.xml +45 -0
  82. data/spec/examples/iso_123_all_parts.xml +45 -0
  83. data/spec/examples/iso_123_no_year_note.xml +46 -0
  84. data/spec/examples/iso_124_.xml +41 -0
  85. data/spec/examples/iso_216_.xml +47 -0
  86. data/spec/examples/iso_iec_12382_.xml +48 -0
  87. data/spec/examples/rice.adoc +715 -0
  88. data/spec/examples/rice.preview.html +1877 -0
  89. data/spec/examples/rice.sh +4 -0
  90. data/spec/examples/rice_images/rice_image1.png +0 -0
  91. data/spec/examples/rice_images/rice_image2.png +0 -0
  92. data/spec/examples/rice_images/rice_image3_1.png +0 -0
  93. data/spec/examples/rice_images/rice_image3_2.png +0 -0
  94. data/spec/examples/rice_images/rice_image3_3.png +0 -0
  95. data/spec/isodoc/i18n_spec.rb +642 -0
  96. data/spec/isodoc/iso_spec.rb +168 -0
  97. data/spec/isodoc/metadata_spec.rb +152 -0
  98. data/spec/isodoc/postproc_spec.rb +405 -0
  99. data/spec/isodoc/section_spec.rb +522 -0
  100. data/spec/isodoc/xref_spec.rb +1337 -0
  101. data/spec/metanorma/processor_spec.rb +70 -0
  102. data/spec/spec_helper.rb +227 -0
  103. metadata +402 -0
@@ -0,0 +1,4 @@
1
+ asciidoctor rice.adoc
2
+ mv rice.html rice.preview.html
3
+ asciidoctor --trace -b iso -r 'asciidoctor-iso' rice.adoc
4
+
@@ -0,0 +1,642 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe IsoDoc do
4
+ it "processes English" do
5
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
6
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
7
+ <bibdata>
8
+ <language>en</language>
9
+ </bibdata>
10
+ <preface>
11
+ <foreword obligation="informative">
12
+ <title>Foreword</title>
13
+ <p id="A">This is a preamble</p>
14
+ </foreword>
15
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
16
+ <title>Introduction Subsection</title>
17
+ </clause>
18
+ <patent-notice>
19
+ <p>This is patent boilerplate</p>
20
+ </patent-notice>
21
+ </introduction></preface><sections>
22
+ <clause id="D" obligation="normative">
23
+ <title>Scope</title>
24
+ <p id="E">Text</p>
25
+ </clause>
26
+
27
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
28
+ <title>Normal Terms</title>
29
+ <term id="J">
30
+ <preferred>Term2</preferred>
31
+ </term>
32
+ </terms>
33
+ <definitions id="K">
34
+ <dl>
35
+ <dt>Symbol</dt>
36
+ <dd>Definition</dd>
37
+ </dl>
38
+ </definitions>
39
+ </clause>
40
+ <definitions id="L">
41
+ <dl>
42
+ <dt>Symbol</dt>
43
+ <dd>Definition</dd>
44
+ </dl>
45
+ </definitions>
46
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
47
+ <title>Introduction</title>
48
+ </clause>
49
+ <clause id="O" inline-header="false" obligation="normative">
50
+ <title>Clause 4.2</title>
51
+ </clause></clause>
52
+
53
+ </sections><annex id="P" inline-header="false" obligation="normative">
54
+ <title>Annex</title>
55
+ <clause id="Q" inline-header="false" obligation="normative">
56
+ <title>Annex A.1</title>
57
+ <clause id="Q1" inline-header="false" obligation="normative">
58
+ <title>Annex A.1a</title>
59
+ </clause>
60
+ </clause>
61
+ <appendix id="Q2" inline-header="false" obligation="normative">
62
+ <title>An Appendix</title>
63
+ </appendix>
64
+ </annex><bibliography><references id="R" obligation="informative">
65
+ <title>Normative References</title>
66
+ </references><clause id="S" obligation="informative">
67
+ <title>Bibliography</title>
68
+ <references id="T" obligation="informative">
69
+ <title>Bibliography Subsection</title>
70
+ </references>
71
+ </clause>
72
+ </bibliography>
73
+ </iso-standard>
74
+ INPUT
75
+ #{HTML_HDR}
76
+ <br/>
77
+ <div>
78
+ <h1 class="ForewordTitle">Foreword</h1>
79
+ <p id="A">This is a preamble</p>
80
+ </div>
81
+ <br/>
82
+ <div class="Section3" id="B">
83
+ <h1 class="IntroTitle">0.&#160; Introduction</h1>
84
+ <div id="C">
85
+ <h2>0.1. Introduction Subsection</h2>
86
+ </div>
87
+ <p>This is patent boilerplate</p>
88
+ </div>
89
+ <p class="zzSTDTitle1"/>
90
+ <div id="D">
91
+ <h1>1.&#160; Scope</h1>
92
+ <p id="E">Text</p>
93
+ </div>
94
+ <div>
95
+ <h1>2.&#160; Normative references</h1>
96
+ <p>There are no normative references in this document.</p>
97
+ </div>
98
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
99
+ the following terms and definitions apply.</p>
100
+ <p>ISO and IEC maintain terminological databases for use in
101
+ standardization at the following addresses:</p>
102
+
103
+ <ul>
104
+ <li> <p>ISO Online browsing platform: available at
105
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
106
+ <li> <p>IEC Electropedia: available at
107
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
108
+ </p> </li> </ul>
109
+ <div id="I">
110
+ <h2>3.1. Normal Terms</h2>
111
+ <p class="TermNum" id="J">3.1.1</p>
112
+ <p class="Terms" style="text-align:left;">Term2</p>
113
+
114
+ </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
115
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
116
+ </div></div>
117
+ <div id="L" class="Symbols">
118
+ <h1>4.&#160; Symbols and abbreviated terms</h1>
119
+ <dl>
120
+ <dt>
121
+ <p>Symbol</p>
122
+ </dt>
123
+ <dd>Definition</dd>
124
+ </dl>
125
+ </div>
126
+ <div id="M">
127
+ <h1>5.&#160; Clause 4</h1>
128
+ <div id="N">
129
+ <h2>5.1. Introduction</h2>
130
+ </div>
131
+ <div id="O">
132
+ <h2>5.2. Clause 4.2</h2>
133
+ </div>
134
+ </div>
135
+ <br/>
136
+ <div id="P" class="Section3">
137
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
138
+ <div id="Q">
139
+ <h2>A.1. Annex A.1</h2>
140
+ <div id="Q1">
141
+ <h3>A.1.1. Annex A.1a</h3>
142
+ </div>
143
+ </div>
144
+ <div id="Q2">
145
+ <h2>Appendix 1. An Appendix</h2>
146
+ </div>
147
+ </div>
148
+ <br/>
149
+ <div>
150
+ <h1 class="Section3">Bibliography</h1>
151
+ <div>
152
+ <h2 class="Section3">Bibliography Subsection</h2>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </body>
157
+ </html>
158
+ OUTPUT
159
+ end
160
+
161
+ it "defaults to English" do
162
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
163
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
164
+ <bibdata>
165
+ <language>tlh</language>
166
+ </bibdata>
167
+ <preface>
168
+ <foreword obligation="informative">
169
+ <title>Foreword</title>
170
+ <p id="A">This is a preamble</p>
171
+ </foreword>
172
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
173
+ <title>Introduction Subsection</title>
174
+ </clause>
175
+ <patent-notice>
176
+ <p>This is patent boilerplate</p>
177
+ </patent-notice>
178
+ </introduction></preface><sections>
179
+ <clause id="D" obligation="normative">
180
+ <title>Scope</title>
181
+ <p id="E">Text</p>
182
+ </clause>
183
+
184
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
185
+ <title>Normal Terms</title>
186
+ <term id="J">
187
+ <preferred>Term2</preferred>
188
+ </term>
189
+ </terms>
190
+ <definitions id="K">
191
+ <dl>
192
+ <dt>Symbol</dt>
193
+ <dd>Definition</dd>
194
+ </dl>
195
+ </definitions>
196
+ </clause>
197
+ <definitions id="L">
198
+ <dl>
199
+ <dt>Symbol</dt>
200
+ <dd>Definition</dd>
201
+ </dl>
202
+ </definitions>
203
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
204
+ <title>Introduction</title>
205
+ </clause>
206
+ <clause id="O" inline-header="false" obligation="normative">
207
+ <title>Clause 4.2</title>
208
+ </clause></clause>
209
+
210
+ </sections><annex id="P" inline-header="false" obligation="normative">
211
+ <title>Annex</title>
212
+ <clause id="Q" inline-header="false" obligation="normative">
213
+ <title>Annex A.1</title>
214
+ <clause id="Q1" inline-header="false" obligation="normative">
215
+ <title>Annex A.1a</title>
216
+ </clause>
217
+ </clause>
218
+ <appendix id="Q2" inline-header="false" obligation="normative">
219
+ <title>An Appendix</title>
220
+ </appendix>
221
+ </annex><bibliography><references id="R" obligation="informative">
222
+ <title>Normative References</title>
223
+ </references><clause id="S" obligation="informative">
224
+ <title>Bibliography</title>
225
+ <references id="T" obligation="informative">
226
+ <title>Bibliography Subsection</title>
227
+ </references>
228
+ </clause>
229
+ </bibliography>
230
+ </iso-standard>
231
+ INPUT
232
+ #{HTML_HDR}
233
+ <br/>
234
+ <div>
235
+ <h1 class="ForewordTitle">Foreword</h1>
236
+ <p id="A">This is a preamble</p>
237
+ </div>
238
+ <br/>
239
+ <div class="Section3" id="B">
240
+ <h1 class="IntroTitle">0.&#160; Introduction</h1>
241
+ <div id="C">
242
+ <h2>0.1. Introduction Subsection</h2>
243
+ </div>
244
+ <p>This is patent boilerplate</p>
245
+ </div>
246
+ <p class="zzSTDTitle1"/>
247
+ <div id="D">
248
+ <h1>1.&#160; Scope</h1>
249
+ <p id="E">Text</p>
250
+ </div>
251
+ <div>
252
+ <h1>2.&#160; Normative references</h1>
253
+ <p>There are no normative references in this document.</p>
254
+ </div>
255
+ <div id="H"><h1>3.&#160; Terms, definitions, symbols and abbreviated terms</h1><p>For the purposes of this document,
256
+ the following terms and definitions apply.</p>
257
+ <p>ISO and IEC maintain terminological databases for use in
258
+ standardization at the following addresses:</p>
259
+
260
+ <ul>
261
+ <li> <p>ISO Online browsing platform: available at
262
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
263
+ <li> <p>IEC Electropedia: available at
264
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
265
+ </p> </li> </ul>
266
+ <div id="I">
267
+ <h2>3.1. Normal Terms</h2>
268
+ <p class="TermNum" id="J">3.1.1</p>
269
+ <p class="Terms" style="text-align:left;">Term2</p>
270
+
271
+ </div><div id="K"><h2>3.2. Symbols and abbreviated terms</h2>
272
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
273
+ </div></div>
274
+ <div id="L" class="Symbols">
275
+ <h1>4.&#160; Symbols and abbreviated terms</h1>
276
+ <dl>
277
+ <dt>
278
+ <p>Symbol</p>
279
+ </dt>
280
+ <dd>Definition</dd>
281
+ </dl>
282
+ </div>
283
+ <div id="M">
284
+ <h1>5.&#160; Clause 4</h1>
285
+ <div id="N">
286
+ <h2>5.1. Introduction</h2>
287
+ </div>
288
+ <div id="O">
289
+ <h2>5.2. Clause 4.2</h2>
290
+ </div>
291
+ </div>
292
+ <br/>
293
+ <div id="P" class="Section3">
294
+ <h1 class="Annex"><b>Annex A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
295
+ <div id="Q">
296
+ <h2>A.1. Annex A.1</h2>
297
+ <div id="Q1">
298
+ <h3>A.1.1. Annex A.1a</h3>
299
+ </div>
300
+ </div>
301
+ <div id="Q2">
302
+ <h2>Appendix 1. An Appendix</h2>
303
+ </div>
304
+ </div>
305
+ <br/>
306
+ <div>
307
+ <h1 class="Section3">Bibliography</h1>
308
+ <div>
309
+ <h2 class="Section3">Bibliography Subsection</h2>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ </body>
314
+ </html>
315
+ OUTPUT
316
+ end
317
+
318
+ it "processes French" do
319
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
320
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
321
+ <bibdata>
322
+ <language>fr</language>
323
+ </bibdata>
324
+ <preface>
325
+ <foreword obligation="informative">
326
+ <title>Foreword</title>
327
+ <p id="A">This is a preamble</p>
328
+ </foreword>
329
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
330
+ <title>Introduction Subsection</title>
331
+ </clause>
332
+ <patent-notice>
333
+ <p>This is patent boilerplate</p>
334
+ </patent-notice>
335
+ </introduction></preface><sections>
336
+ <clause id="D" obligation="normative">
337
+ <title>Scope</title>
338
+ <p id="E">Text</p>
339
+ </clause>
340
+
341
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
342
+ <title>Normal Terms</title>
343
+ <term id="J">
344
+ <preferred>Term2</preferred>
345
+ </term>
346
+ </terms>
347
+ <definitions id="K">
348
+ <dl>
349
+ <dt>Symbol</dt>
350
+ <dd>Definition</dd>
351
+ </dl>
352
+ </definitions>
353
+ </clause>
354
+ <definitions id="L">
355
+ <dl>
356
+ <dt>Symbol</dt>
357
+ <dd>Definition</dd>
358
+ </dl>
359
+ </definitions>
360
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
361
+ <title>Introduction</title>
362
+ </clause>
363
+ <clause id="O" inline-header="false" obligation="normative">
364
+ <title>Clause 4.2</title>
365
+ </clause></clause>
366
+
367
+ </sections><annex id="P" inline-header="false" obligation="normative">
368
+ <title>Annex</title>
369
+ <clause id="Q" inline-header="false" obligation="normative">
370
+ <title>Annex A.1</title>
371
+ <clause id="Q1" inline-header="false" obligation="normative">
372
+ <title>Annex A.1a</title>
373
+ </clause>
374
+ </clause>
375
+ <appendix id="Q2" inline-header="false" obligation="normative">
376
+ <title>An Appendix</title>
377
+ </appendix>
378
+ </annex><bibliography><references id="R" obligation="informative">
379
+ <title>Normative References</title>
380
+ </references><clause id="S" obligation="informative">
381
+ <title>Bibliography</title>
382
+ <references id="T" obligation="informative">
383
+ <title>Bibliography Subsection</title>
384
+ </references>
385
+ </clause>
386
+ </bibliography>
387
+ </iso-standard>
388
+ INPUT
389
+ #{HTML_HDR}
390
+ <br/>
391
+ <div>
392
+ <h1 class="ForewordTitle">Avant-propos</h1>
393
+ <p id="A">This is a preamble</p>
394
+ </div>
395
+ <br/>
396
+ <div class="Section3" id="B">
397
+ <h1 class="IntroTitle">0.&#160; Introduction</h1>
398
+ <div id="C">
399
+ <h2>0.1. Introduction Subsection</h2>
400
+ </div>
401
+ <p>This is patent boilerplate</p>
402
+ </div>
403
+ <p class="zzSTDTitle1"/>
404
+ <div id="D">
405
+ <h1>1.&#160; Domaine d'application</h1>
406
+ <p id="E">Text</p>
407
+ </div>
408
+ <div>
409
+ <h1>2.&#160; R&#233;f&#233;rences normatives</h1>
410
+ <p>Le pr&#233;sent document ne contient aucune r&#233;f&#233;rence normative.</p>
411
+ </div>
412
+ <div id="H"><h1>3.&#160; Terms, d&#233;finitions, symboles et termes abr&#233;g&#233;s</h1><p>Pour les besoins du pr&#233;sent document, les termes et d&#233;finitions suivants s'appliquent.</p>
413
+ <p>L'ISO et l'IEC tiennent &#224; jour des bases de donn&#233;es terminologiques
414
+ destin&#233;es &#224; &#234;tre utilis&#233;es en normalisation, consultables aux adresses
415
+ suivantes:</p>
416
+ <ul>
417
+ <li> <p>ISO Online browsing platform: disponible &#224; l'adresse
418
+ <a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
419
+ <li> <p>IEC Electropedia: disponible &#224; l'adresse
420
+ <a href="http://www.electropedia.org">http://www.electropedia.org</a>
421
+ </p> </li> </ul>
422
+ <div id="I">
423
+ <h2>3.1. Normal Terms</h2>
424
+ <p class="TermNum" id="J">3.1.1</p>
425
+ <p class="Terms" style="text-align:left;">Term2</p>
426
+
427
+ </div><div id="K"><h2>3.2. Symboles et termes abr&#233;g&#233;s</h2>
428
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
429
+ </div></div>
430
+ <div id="L" class="Symbols">
431
+ <h1>4.&#160; Symboles et termes abr&#233;g&#233;s</h1>
432
+ <dl>
433
+ <dt>
434
+ <p>Symbol</p>
435
+ </dt>
436
+ <dd>Definition</dd>
437
+ </dl>
438
+ </div>
439
+ <div id="M">
440
+ <h1>5.&#160; Clause 4</h1>
441
+ <div id="N">
442
+ <h2>5.1. Introduction</h2>
443
+ </div>
444
+ <div id="O">
445
+ <h2>5.2. Clause 4.2</h2>
446
+ </div>
447
+ </div>
448
+ <br/>
449
+ <div id="P" class="Section3">
450
+ <h1 class="Annex"><b>Annexe A</b><br/>(normative)<br/><br/><b>Annex</b></h1>
451
+ <div id="Q">
452
+ <h2>A.1. Annex A.1</h2>
453
+ <div id="Q1">
454
+ <h3>A.1.1. Annex A.1a</h3>
455
+ </div>
456
+ </div>
457
+ <div id="Q2">
458
+ <h2>Appendice 1. An Appendix</h2>
459
+ </div>
460
+ </div>
461
+ <br/>
462
+ <div>
463
+ <h1 class="Section3">Bibliographie</h1>
464
+ <div>
465
+ <h2 class="Section3">Bibliography Subsection</h2>
466
+ </div>
467
+ </div>
468
+ </div>
469
+ </body>
470
+ </html>
471
+ OUTPUT
472
+ end
473
+
474
+ it "processes Simplified Chinese" do
475
+ expect(IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
476
+ <iso-standard xmlns="http://riboseinc.com/isoxml">
477
+ <bibdata>
478
+ <language>zh</language>
479
+ <script>Hans</script>
480
+ </bibdata>
481
+ <preface>
482
+ <foreword obligation="informative">
483
+ <title>Foreword</title>
484
+ <p id="A">This is a preamble</p>
485
+ </foreword>
486
+ <introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
487
+ <title>Introduction Subsection</title>
488
+ </clause>
489
+ <patent-notice>
490
+ <p>This is patent boilerplate</p>
491
+ </patent-notice>
492
+ </introduction></preface><sections>
493
+ <clause id="D" obligation="normative">
494
+ <title>Scope</title>
495
+ <p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref></p>
496
+ </clause>
497
+
498
+ <clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
499
+ <title>Normal Terms</title>
500
+ <term id="J">
501
+ <preferred>Term2</preferred>
502
+ </term>
503
+ </terms>
504
+ <definitions id="K">
505
+ <dl>
506
+ <dt>Symbol</dt>
507
+ <dd>Definition</dd>
508
+ </dl>
509
+ </definitions>
510
+ </clause>
511
+ <definitions id="L">
512
+ <dl>
513
+ <dt>Symbol</dt>
514
+ <dd>Definition</dd>
515
+ </dl>
516
+ </definitions>
517
+ <clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
518
+ <title>Introduction</title>
519
+ </clause>
520
+ <clause id="O" inline-header="false" obligation="normative">
521
+ <title>Clause 4.2</title>
522
+ </clause></clause>
523
+
524
+ </sections><annex id="P" inline-header="false" obligation="normative">
525
+ <title>Annex</title>
526
+ <clause id="Q" inline-header="false" obligation="normative">
527
+ <title>Annex A.1</title>
528
+ <clause id="Q1" inline-header="false" obligation="normative">
529
+ <title>Annex A.1a</title>
530
+ </clause>
531
+ </clause>
532
+ <appendix id="Q2" inline-header="false" obligation="normative">
533
+ <title>An Appendix</title>
534
+ </appendix>
535
+ </annex><bibliography><references id="R" obligation="informative">
536
+ <title>Normative References</title>
537
+ <bibitem id="ISO712" type="standard">
538
+ <title format="text/plain">Cereals and cereal products</title>
539
+ <docidentifier>ISO 712</docidentifier>
540
+ <contributor>
541
+ <role type="publisher"/>
542
+ <organization>
543
+ <abbreviation>ISO</abbreviation>
544
+ </organization>
545
+ </contributor>
546
+ </bibitem>
547
+ </references><clause id="S" obligation="informative">
548
+ <title>Bibliography</title>
549
+ <references id="T" obligation="informative">
550
+ <title>Bibliography Subsection</title>
551
+ </references>
552
+ </clause>
553
+ </bibliography>
554
+ </iso-standard>
555
+ INPUT
556
+ #{HTML_HDR}
557
+ <br/>
558
+ <div>
559
+ <h1 class="ForewordTitle">&#21069;&#35328;</h1>
560
+ <p id="A">This is a preamble</p>
561
+ </div>
562
+ <br/>
563
+ <div class="Section3" id="B">
564
+ <h1 class="IntroTitle">0.&#160; &#24341;&#35328;</h1>
565
+ <div id="C">
566
+ <h2>0.1. Introduction Subsection</h2>
567
+ </div>
568
+ <p>This is patent boilerplate</p>
569
+ </div>
570
+ <p class="zzSTDTitle1"/>
571
+ <div id="D">
572
+ <h1>1.&#160; &#33539;&#22260;</h1>
573
+ <p id="E">
574
+ <a href="#ISO712">ISO 712&#12289;&#31532;1&#8211;<referenceto>1</referenceto>&#34920;</a>
575
+ </p>
576
+ </div>
577
+ <div>
578
+ <h1>2.&#160; &#35268;&#33539;&#24615;&#24341;&#29992;&#25991;&#20214;</h1>
579
+ <p>&#19979;&#21015;&#25991;&#20214;&#23545;&#20110;&#26412;&#25991;&#20214;&#30340;&#24212;&#29992;&#26159;&#24517;&#19981;&#21487;&#23569;&#30340;&#12290; &#20961;&#26159;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20165;&#27880;&#26085;&#26399;&#30340;&#29256;&#26412;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290; &#20961;&#26159;&#19981;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20854;&#26368;&#26032;&#29256;&#26412;&#65288;&#21253;&#25324;&#25152;&#26377;&#30340;&#20462;&#25913;&#21333;&#65289;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
580
+ <p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
581
+ </div>
582
+ <div id="H"><h1>3.&#160; &#26415;&#35821;&#12289;&#23450;&#20041;&#12289;&#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h1><p>&#19979;&#21015;&#26415;&#35821;&#21644;&#23450;&#20041;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
583
+ <p>ISO&#21644;IEC&#29992;&#20110;&#26631;&#20934;&#21270;&#30340;&#26415;&#35821;&#25968;&#25454;&#24211;&#22320;&#22336;&#22914;&#19979;&#65306;</p>
584
+ <ul>
585
+ <li> <p>ISO&#22312;&#32447;&#27983;&#35272;&#24179;&#21488;:
586
+ &#20301;&#20110;<a href="http://www.iso.org/obp">http://www.iso.org/obp</a></p> </li>
587
+ <li> <p>IEC Electropedia:
588
+ &#20301;&#20110;<a href="http://www.electropedia.org">http://www.electropedia.org</a>
589
+ </p> </li> </ul>
590
+ <div id="I">
591
+ <h2>3.1. Normal Terms</h2>
592
+ <p class="TermNum" id="J">3.1.1</p>
593
+ <p class="Terms" style="text-align:left;">Term2</p>
594
+
595
+ </div><div id="K"><h2>3.2. &#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h2>
596
+ <dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
597
+ </div></div>
598
+ <div id="L" class="Symbols">
599
+ <h1>4.&#160; &#31526;&#21495;&#12289;&#20195;&#21495;&#21644;&#32553;&#30053;&#35821;</h1>
600
+ <dl>
601
+ <dt>
602
+ <p>Symbol</p>
603
+ </dt>
604
+ <dd>Definition</dd>
605
+ </dl>
606
+ </div>
607
+ <div id="M">
608
+ <h1>5.&#160; Clause 4</h1>
609
+ <div id="N">
610
+ <h2>5.1. Introduction</h2>
611
+ </div>
612
+ <div id="O">
613
+ <h2>5.2. Clause 4.2</h2>
614
+ </div>
615
+ </div>
616
+ <br/>
617
+ <div id="P" class="Section3">
618
+ <h1 class="Annex">&#38468;&#20214;A<br/>&#65288;&#35268;&#33539;&#24615;&#38468;&#24405;&#65289;<br/><br/><b>Annex</b></h1>
619
+ <div id="Q">
620
+ <h2>A.1. Annex A.1</h2>
621
+ <div id="Q1">
622
+ <h3>A.1.1. Annex A.1a</h3>
623
+ </div>
624
+ </div>
625
+ <div id="Q2">
626
+ <h2>&#38468;&#24405;1. An Appendix</h2>
627
+ </div>
628
+ </div>
629
+ <br/>
630
+ <div>
631
+ <h1 class="Section3">&#21442;&#32771;&#25991;&#29486;</h1>
632
+ <div>
633
+ <h2 class="Section3">Bibliography Subsection</h2>
634
+ </div>
635
+ </div>
636
+ </div>
637
+ </body>
638
+ </html>
639
+ OUTPUT
640
+ end
641
+
642
+ end