isodoc 1.6.0 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -12
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/Rakefile +2 -2
- data/bin/rspec +1 -2
- data/isodoc.gemspec +4 -3
- data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
- data/lib/isodoc-yaml/i18n-de.yaml +149 -0
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-es.yaml +151 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc.rb +0 -2
- data/lib/isodoc/common.rb +2 -0
- data/lib/isodoc/convert.rb +10 -4
- data/lib/isodoc/css.rb +30 -26
- data/lib/isodoc/function/blocks.rb +26 -8
- data/lib/isodoc/function/blocks_example_note.rb +2 -2
- data/lib/isodoc/function/cleanup.rb +53 -45
- data/lib/isodoc/function/form.rb +51 -0
- data/lib/isodoc/function/inline.rb +8 -7
- data/lib/isodoc/function/references.rb +71 -77
- data/lib/isodoc/function/section.rb +28 -16
- data/lib/isodoc/function/table.rb +22 -22
- data/lib/isodoc/function/terms.rb +6 -7
- data/lib/isodoc/function/to_word_html.rb +19 -25
- data/lib/isodoc/function/utils.rb +180 -160
- data/lib/isodoc/gem_tasks.rb +36 -38
- data/lib/isodoc/headlesshtml_convert.rb +8 -7
- data/lib/isodoc/html_convert.rb +10 -4
- data/lib/isodoc/html_function/comments.rb +14 -12
- data/lib/isodoc/html_function/footnotes.rb +14 -7
- data/lib/isodoc/html_function/form.rb +62 -0
- data/lib/isodoc/html_function/html.rb +30 -26
- data/lib/isodoc/html_function/postprocess.rb +191 -226
- data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
- data/lib/isodoc/html_function/sectionsplit.rb +230 -0
- data/lib/isodoc/i18n.rb +33 -31
- data/lib/isodoc/metadata.rb +22 -20
- data/lib/isodoc/metadata_contributor.rb +31 -28
- data/lib/isodoc/pdf_convert.rb +11 -13
- data/lib/isodoc/presentation_function/bibdata.rb +54 -30
- data/lib/isodoc/presentation_function/block.rb +17 -8
- data/lib/isodoc/presentation_function/inline.rb +72 -120
- data/lib/isodoc/presentation_function/math.rb +84 -0
- data/lib/isodoc/presentation_function/section.rb +55 -19
- data/lib/isodoc/presentation_xml_convert.rb +2 -0
- data/lib/isodoc/sassc_importer.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +28 -24
- data/lib/isodoc/word_function/footnotes.rb +22 -15
- data/lib/isodoc/word_function/postprocess.rb +50 -36
- data/lib/isodoc/xref.rb +11 -10
- data/lib/isodoc/xref/xref_counter.rb +32 -17
- data/lib/isodoc/xref/xref_gen.rb +33 -21
- data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
- data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
- data/spec/assets/scripts_override.html +3 -0
- data/spec/isodoc/blocks_spec.rb +2258 -2622
- data/spec/isodoc/cleanup_spec.rb +1103 -1107
- data/spec/isodoc/form_spec.rb +156 -0
- data/spec/isodoc/i18n_spec.rb +802 -917
- data/spec/isodoc/inline_spec.rb +1105 -921
- data/spec/isodoc/lists_spec.rb +316 -315
- data/spec/isodoc/metadata_spec.rb +384 -379
- data/spec/isodoc/postproc_spec.rb +1783 -1549
- data/spec/isodoc/presentation_xml_spec.rb +355 -278
- data/spec/isodoc/ref_spec.rb +718 -723
- data/spec/isodoc/section_spec.rb +216 -199
- data/spec/isodoc/sectionsplit_spec.rb +190 -0
- data/spec/isodoc/table_spec.rb +41 -42
- data/spec/isodoc/terms_spec.rb +84 -84
- data/spec/isodoc/xref_spec.rb +1024 -930
- metadata +33 -7
data/spec/isodoc/section_spec.rb
CHANGED
@@ -129,30 +129,32 @@ RSpec.describe IsoDoc do
|
|
129
129
|
end
|
130
130
|
|
131
131
|
it "processes document with no content" do
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
</iso-standard>
|
132
|
+
input = <<~INPUT
|
133
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
134
|
+
<preface/>
|
135
|
+
<sections/>
|
136
|
+
</iso-standard>
|
138
137
|
INPUT
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
138
|
+
output = <<~OUTPUT
|
139
|
+
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
|
140
|
+
<head/>
|
141
|
+
<body lang="en">
|
142
|
+
<div class="title-section">
|
143
|
+
<p> </p>
|
144
|
+
</div>
|
145
|
+
<br/>
|
146
|
+
<div class="prefatory-section">
|
147
|
+
<p> </p>
|
148
|
+
</div>
|
149
|
+
<br/>
|
150
|
+
<div class="main-section">
|
151
|
+
<p class="zzSTDTitle1"/>
|
152
|
+
</div>
|
153
|
+
</body>
|
154
|
+
</html>
|
155
155
|
OUTPUT
|
156
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({})
|
157
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
156
158
|
end
|
157
159
|
|
158
160
|
it "processes section names" do
|
@@ -261,50 +263,50 @@ RSpec.describe IsoDoc do
|
|
261
263
|
INPUT
|
262
264
|
|
263
265
|
presxml = <<~"PRESXML"
|
264
|
-
|
266
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
265
267
|
<boilerplate>
|
266
268
|
<copyright-statement>
|
267
269
|
<clause>
|
268
|
-
<title depth=
|
270
|
+
<title depth='1'>Copyright</title>
|
269
271
|
</clause>
|
270
272
|
</copyright-statement>
|
271
273
|
<license-statement>
|
272
274
|
<clause>
|
273
|
-
<title depth=
|
275
|
+
<title depth='1'>License</title>
|
274
276
|
</clause>
|
275
277
|
</license-statement>
|
276
278
|
<legal-statement>
|
277
279
|
<clause>
|
278
|
-
<title depth=
|
280
|
+
<title depth='1'>Legal</title>
|
279
281
|
</clause>
|
280
282
|
</legal-statement>
|
281
283
|
<feedback-statement>
|
282
284
|
<clause>
|
283
|
-
<title depth=
|
285
|
+
<title depth='1'>Feedback</title>
|
284
286
|
</clause>
|
285
287
|
</feedback-statement>
|
286
288
|
</boilerplate>
|
287
289
|
<preface>
|
288
|
-
<abstract obligation='informative'>
|
290
|
+
<abstract obligation='informative' displayorder='1'>
|
289
291
|
<title>Abstract</title>
|
290
292
|
</abstract>
|
291
|
-
<foreword obligation='informative'>
|
293
|
+
<foreword obligation='informative' displayorder='2'>
|
292
294
|
<title>Foreword</title>
|
293
295
|
<p id='A'>This is a preamble</p>
|
294
296
|
</foreword>
|
295
|
-
<introduction id='B' obligation='informative'>
|
297
|
+
<introduction id='B' obligation='informative' displayorder='3'>
|
296
298
|
<title>Introduction</title>
|
297
299
|
<clause id='C' inline-header='false' obligation='informative'>
|
298
300
|
<title depth='2'>Introduction Subsection</title>
|
299
301
|
</clause>
|
300
302
|
</introduction>
|
301
|
-
<clause id='B1'>
|
303
|
+
<clause id='B1' displayorder='4'>
|
302
304
|
<title depth='1'>Dedication</title>
|
303
305
|
</clause>
|
304
|
-
<clause id='B2'>
|
306
|
+
<clause id='B2' displayorder='5'>
|
305
307
|
<title depth='1'>Note to reader</title>
|
306
308
|
</clause>
|
307
|
-
<acknowledgements obligation='informative'>
|
309
|
+
<acknowledgements obligation='informative' displayorder='6'>
|
308
310
|
<title>Acknowledgements</title>
|
309
311
|
</acknowledgements>
|
310
312
|
</preface>
|
@@ -316,11 +318,11 @@ RSpec.describe IsoDoc do
|
|
316
318
|
<admonition id='NN2' type='warning'>
|
317
319
|
<p>Initial admonition</p>
|
318
320
|
</admonition>
|
319
|
-
<clause id='D' obligation='normative' type='scope'>
|
321
|
+
<clause id='D' obligation='normative' type='scope' displayorder='7'>
|
320
322
|
<title depth='1'>1.<tab/>Scope</title>
|
321
323
|
<p id='E'>Text</p>
|
322
324
|
</clause>
|
323
|
-
<clause id='H' obligation='normative'>
|
325
|
+
<clause id='H' obligation='normative' displayorder='9'>
|
324
326
|
<title depth='1'>3.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
325
327
|
<terms id='I' obligation='normative'>
|
326
328
|
<title depth='2'>3.1.<tab/>Normal Terms</title>
|
@@ -330,21 +332,21 @@ RSpec.describe IsoDoc do
|
|
330
332
|
</term>
|
331
333
|
</terms>
|
332
334
|
<definitions id='K'>
|
333
|
-
|
335
|
+
<title depth='2'>3.2.<tab/>Definitions</title>
|
334
336
|
<dl>
|
335
337
|
<dt>Symbol</dt>
|
336
338
|
<dd>Definition</dd>
|
337
339
|
</dl>
|
338
340
|
</definitions>
|
339
341
|
</clause>
|
340
|
-
<definitions id='L'>
|
341
|
-
|
342
|
+
<definitions id='L' displayorder='10'>
|
343
|
+
<title depth='1'>4.<tab/>Symbols and abbreviated terms</title>
|
342
344
|
<dl>
|
343
345
|
<dt>Symbol</dt>
|
344
346
|
<dd>Definition</dd>
|
345
347
|
</dl>
|
346
348
|
</definitions>
|
347
|
-
<clause id='M' inline-header='false' obligation='normative'>
|
349
|
+
<clause id='M' inline-header='false' obligation='normative' displayorder='11'>
|
348
350
|
<title depth='1'>5.<tab/>Clause 4</title>
|
349
351
|
<clause id='N' inline-header='false' obligation='normative'>
|
350
352
|
<title depth='2'>5.1.<tab/>Introduction</title>
|
@@ -357,8 +359,14 @@ RSpec.describe IsoDoc do
|
|
357
359
|
</clause>
|
358
360
|
</clause>
|
359
361
|
</sections>
|
360
|
-
<annex id='P' inline-header='false' obligation='normative'>
|
361
|
-
<title>
|
362
|
+
<annex id='P' inline-header='false' obligation='normative' displayorder='12'>
|
363
|
+
<title>
|
364
|
+
<strong>Annex A</strong>
|
365
|
+
<br/>
|
366
|
+
(normative)
|
367
|
+
<br/>
|
368
|
+
<br/>
|
369
|
+
<strong>Annex</strong>
|
362
370
|
</title>
|
363
371
|
<clause id='Q' inline-header='false' obligation='normative'>
|
364
372
|
<title depth='2'>A.1.<tab/>Annex A.1</title>
|
@@ -370,17 +378,21 @@ RSpec.describe IsoDoc do
|
|
370
378
|
</references>
|
371
379
|
</clause>
|
372
380
|
</annex>
|
373
|
-
<annex id='P1' inline-header='false' obligation='normative'>
|
374
|
-
<title
|
381
|
+
<annex id='P1' inline-header='false' obligation='normative' displayorder='13'>
|
382
|
+
<title>
|
383
|
+
<strong>Annex B</strong>
|
384
|
+
<br/>
|
385
|
+
(normative)
|
386
|
+
</title>
|
375
387
|
</annex>
|
376
388
|
<bibliography>
|
377
|
-
<references id='R' obligation='informative' normative='true'>
|
378
|
-
|
389
|
+
<references id='R' obligation='informative' normative='true' displayorder='8'>
|
390
|
+
<title depth='1'>2.<tab/>Normative References</title>
|
379
391
|
</references>
|
380
|
-
<clause id='S' obligation='informative'>
|
392
|
+
<clause id='S' obligation='informative' displayorder='14'>
|
381
393
|
<title depth='1'>Bibliography</title>
|
382
394
|
<references id='T' obligation='informative' normative='false'>
|
383
|
-
<title depth=
|
395
|
+
<title depth='2'>Bibliography Subsection</title>
|
384
396
|
</references>
|
385
397
|
</clause>
|
386
398
|
</bibliography>
|
@@ -691,96 +703,95 @@ RSpec.describe IsoDoc do
|
|
691
703
|
end
|
692
704
|
|
693
705
|
it "processes section names suppressing section numbering" do
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
</clause>
|
706
|
+
input = <<~INPUT
|
707
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
708
|
+
<preface>
|
709
|
+
<foreword obligation="informative">
|
710
|
+
<title>Foreword</title>
|
711
|
+
<p id="A">This is a preamble</p>
|
712
|
+
</foreword>
|
713
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
714
|
+
<title>Introduction Subsection</title>
|
715
|
+
</clause>
|
716
|
+
</introduction></preface><sections>
|
717
|
+
<clause id="D" obligation="normative" type="scope">
|
718
|
+
<title>Scope</title>
|
719
|
+
<p id="E">Text</p>
|
720
|
+
</clause>
|
710
721
|
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
722
|
+
<clause id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title><terms id="I" obligation="normative">
|
723
|
+
<title>Normal Terms</title>
|
724
|
+
<term id="J">
|
725
|
+
<preferred>Term2</preferred>
|
726
|
+
</term>
|
727
|
+
</terms>
|
728
|
+
<definitions id="K">
|
729
|
+
<dl>
|
730
|
+
<dt>Symbol</dt>
|
731
|
+
<dd>Definition</dd>
|
732
|
+
</dl>
|
733
|
+
</definitions>
|
734
|
+
</clause>
|
735
|
+
<definitions id="L">
|
736
|
+
<dl>
|
737
|
+
<dt>Symbol</dt>
|
738
|
+
<dd>Definition</dd>
|
739
|
+
</dl>
|
740
|
+
</definitions>
|
741
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
742
|
+
<title>Introduction</title>
|
743
|
+
</clause>
|
744
|
+
<clause id="O" inline-header="false" obligation="normative">
|
745
|
+
<title>Clause 4.2</title>
|
746
|
+
</clause>
|
747
|
+
<clause id="O1" inline-header="false" obligation="normative">
|
748
|
+
</clause>
|
749
|
+
</clause>
|
739
750
|
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
751
|
+
</sections><annex id="P" inline-header="false" obligation="normative">
|
752
|
+
<title>Annex</title>
|
753
|
+
<clause id="Q" inline-header="false" obligation="normative">
|
754
|
+
<title>Annex A.1</title>
|
755
|
+
<clause id="Q1" inline-header="false" obligation="normative">
|
756
|
+
<title>Annex A.1a</title>
|
757
|
+
</clause>
|
758
|
+
</clause>
|
759
|
+
</annex><bibliography><references id="R" obligation="informative" normative="true">
|
760
|
+
<title>Normative References</title>
|
761
|
+
</references><clause id="S" obligation="informative">
|
762
|
+
<title>Bibliography</title>
|
763
|
+
<references id="T" obligation="informative" normative="false">
|
764
|
+
<title>Bibliography Subsection</title>
|
765
|
+
</references>
|
766
|
+
</clause>
|
767
|
+
</bibliography>
|
768
|
+
</iso-standard>
|
758
769
|
INPUT
|
759
|
-
|
760
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type=
|
770
|
+
output = <<~OUTPUT
|
771
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
761
772
|
<preface>
|
762
|
-
<foreword obligation='informative'>
|
773
|
+
<foreword obligation='informative' displayorder='1'>
|
763
774
|
<title>Foreword</title>
|
764
775
|
<p id='A'>This is a preamble</p>
|
765
776
|
</foreword>
|
766
|
-
<introduction id='B' obligation='informative'>
|
777
|
+
<introduction id='B' obligation='informative' displayorder='2'>
|
767
778
|
<title>Introduction</title>
|
768
779
|
<clause id='C' inline-header='false' obligation='informative'>
|
769
|
-
<title depth=
|
780
|
+
<title depth='2'>Introduction Subsection</title>
|
770
781
|
</clause>
|
771
782
|
</introduction>
|
772
783
|
</preface>
|
773
784
|
<sections>
|
774
|
-
<clause id='D' obligation='normative' type=
|
775
|
-
<title depth=
|
785
|
+
<clause id='D' obligation='normative' type='scope' displayorder='3'>
|
786
|
+
<title depth='1'>Scope</title>
|
776
787
|
<p id='E'>Text</p>
|
777
788
|
</clause>
|
778
|
-
<clause id='H' obligation='normative'>
|
779
|
-
<title depth=
|
789
|
+
<clause id='H' obligation='normative' displayorder='5'>
|
790
|
+
<title depth='1'>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
780
791
|
<terms id='I' obligation='normative'>
|
781
|
-
<title depth=
|
792
|
+
<title depth='2'>Normal Terms</title>
|
782
793
|
<term id='J'>
|
783
|
-
|
794
|
+
<name>3.1.1.</name>
|
784
795
|
<preferred>Term2</preferred>
|
785
796
|
</term>
|
786
797
|
</terms>
|
@@ -791,24 +802,24 @@ RSpec.describe IsoDoc do
|
|
791
802
|
</dl>
|
792
803
|
</definitions>
|
793
804
|
</clause>
|
794
|
-
<definitions id='L'>
|
805
|
+
<definitions id='L' displayorder='6'>
|
795
806
|
<dl>
|
796
807
|
<dt>Symbol</dt>
|
797
808
|
<dd>Definition</dd>
|
798
809
|
</dl>
|
799
810
|
</definitions>
|
800
|
-
<clause id='M' inline-header='false' obligation='normative'>
|
801
|
-
<title depth=
|
811
|
+
<clause id='M' inline-header='false' obligation='normative' displayorder='7'>
|
812
|
+
<title depth='1'>Clause 4</title>
|
802
813
|
<clause id='N' inline-header='false' obligation='normative'>
|
803
|
-
<title depth=
|
814
|
+
<title depth='2'>Introduction</title>
|
804
815
|
</clause>
|
805
816
|
<clause id='O' inline-header='false' obligation='normative'>
|
806
|
-
<title depth=
|
817
|
+
<title depth='2'>Clause 4.2</title>
|
807
818
|
</clause>
|
808
819
|
<clause id='O1' inline-header='false' obligation='normative'> </clause>
|
809
820
|
</clause>
|
810
821
|
</sections>
|
811
|
-
<annex id='P' inline-header='false' obligation='normative'>
|
822
|
+
<annex id='P' inline-header='false' obligation='normative' displayorder='8'>
|
812
823
|
<title>
|
813
824
|
<strong>Annex A</strong>
|
814
825
|
<br/>
|
@@ -818,51 +829,55 @@ RSpec.describe IsoDoc do
|
|
818
829
|
<strong>Annex</strong>
|
819
830
|
</title>
|
820
831
|
<clause id='Q' inline-header='false' obligation='normative'>
|
821
|
-
<title depth=
|
832
|
+
<title depth='2'>Annex A.1</title>
|
822
833
|
<clause id='Q1' inline-header='false' obligation='normative'>
|
823
|
-
<title depth=
|
834
|
+
<title depth='3'>Annex A.1a</title>
|
824
835
|
</clause>
|
825
836
|
</clause>
|
826
837
|
</annex>
|
827
838
|
<bibliography>
|
828
|
-
<references id='R' obligation='informative' normative='true'>
|
829
|
-
<title depth=
|
839
|
+
<references id='R' obligation='informative' normative='true' displayorder='4'>
|
840
|
+
<title depth='1'>Normative References</title>
|
830
841
|
</references>
|
831
|
-
<clause id='S' obligation='informative'>
|
832
|
-
<title depth=
|
842
|
+
<clause id='S' obligation='informative' displayorder='9'>
|
843
|
+
<title depth='1'>Bibliography</title>
|
833
844
|
<references id='T' obligation='informative' normative='false'>
|
834
|
-
<title depth=
|
845
|
+
<title depth='2'>Bibliography Subsection</title>
|
835
846
|
</references>
|
836
847
|
</clause>
|
837
848
|
</bibliography>
|
838
849
|
</iso-standard>
|
839
850
|
OUTPUT
|
851
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
|
852
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
840
853
|
end
|
841
854
|
|
842
855
|
it "processes section titles without ID" do
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
</iso-standard>
|
856
|
+
input = <<~INPUT
|
857
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
858
|
+
<preface>
|
859
|
+
<introduction id="B" obligation="informative"><title>Introduction</title><clause obligation="informative">
|
860
|
+
<title>Introduction Subsection</title>
|
861
|
+
</clause>
|
862
|
+
</introduction>
|
863
|
+
</preface>
|
864
|
+
</iso-standard>
|
853
865
|
INPUT
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
866
|
+
output = <<~OUTPUT
|
867
|
+
<?xml version='1.0'?>
|
868
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
869
|
+
<preface>
|
870
|
+
<introduction id='B' obligation='informative' displayorder="1">
|
871
|
+
<title>Introduction</title>
|
872
|
+
<clause obligation='informative'>
|
873
|
+
<title depth="1">Introduction Subsection</title>
|
874
|
+
</clause>
|
875
|
+
</introduction>
|
876
|
+
</preface>
|
877
|
+
</iso-standard>
|
865
878
|
OUTPUT
|
879
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({ suppressheadingnumbers: true })
|
880
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
866
881
|
end
|
867
882
|
|
868
883
|
it "processes simple terms & definitions" do
|
@@ -881,7 +896,7 @@ RSpec.describe IsoDoc do
|
|
881
896
|
presxml = <<~"OUTPUT"
|
882
897
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
883
898
|
<sections>
|
884
|
-
<terms id='H' obligation='normative'>
|
899
|
+
<terms id='H' obligation='normative' displayorder="1">
|
885
900
|
<title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
886
901
|
<term id='J'>
|
887
902
|
<name>1.1.</name>
|
@@ -928,7 +943,7 @@ RSpec.describe IsoDoc do
|
|
928
943
|
presxml = <<~"PRESXML"
|
929
944
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
930
945
|
<sections>
|
931
|
-
<clause id='M' inline-header='false' obligation='normative'>
|
946
|
+
<clause id='M' inline-header='false' obligation='normative' displayorder="1">
|
932
947
|
<title depth='1'>1.<tab/>Clause 4</title>
|
933
948
|
<clause id='N' inline-header='false' obligation='normative'>
|
934
949
|
<title depth='2'>1.1.<tab/>Introduction</title>
|
@@ -983,7 +998,7 @@ RSpec.describe IsoDoc do
|
|
983
998
|
<?xml version='1.0'?>
|
984
999
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
985
1000
|
<sections>
|
986
|
-
<clause id='M' inline-header='false' obligation='normative'>
|
1001
|
+
<clause id='M' inline-header='false' obligation='normative' displayorder="1">
|
987
1002
|
<title depth="1">Clause 4</title>
|
988
1003
|
<clause id='N' inline-header='false' obligation='normative'>
|
989
1004
|
<title depth="2">Introduction</title>
|
@@ -998,48 +1013,50 @@ RSpec.describe IsoDoc do
|
|
998
1013
|
end
|
999
1014
|
|
1000
1015
|
it "processes sections without titles" do
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
<
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
</sections>
|
1016
|
+
input = <<~INPUT
|
1017
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
1018
|
+
<preface>
|
1019
|
+
<introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
|
1020
|
+
<title>Intro</title>
|
1021
|
+
</clause>
|
1022
|
+
<clause id="O" inline-header="true" obligation="normative">
|
1023
|
+
</clause></clause>
|
1024
|
+
</preface>
|
1025
|
+
<sections>
|
1026
|
+
<clause id="M1" inline-header="false" obligation="normative"><clause id="N1" inline-header="false" obligation="normative">
|
1027
|
+
</clause>
|
1028
|
+
<clause id="O1" inline-header="true" obligation="normative">
|
1029
|
+
</clause></clause>
|
1030
|
+
</sections>
|
1017
1031
|
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
</
|
1027
|
-
<clause id='O' inline-header='true' obligation='normative'> </clause>
|
1028
|
-
</introduction>
|
1029
|
-
</preface>
|
1030
|
-
<sections>
|
1031
|
-
<clause id='M1' inline-header='false' obligation='normative'>
|
1032
|
-
<title>1.</title>
|
1033
|
-
<clause id='N1' inline-header='false' obligation='normative'>
|
1034
|
-
<title>1.1.</title>
|
1035
|
-
</clause>
|
1036
|
-
<clause id='O1' inline-header='true' obligation='normative'>
|
1037
|
-
<title>1.2.</title>
|
1038
|
-
</clause>
|
1032
|
+
</iso-standard>
|
1033
|
+
INPUT
|
1034
|
+
output = <<~OUTPUT
|
1035
|
+
<?xml version='1.0'?>
|
1036
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
1037
|
+
<preface>
|
1038
|
+
<introduction id='M' inline-header='false' obligation='normative' displayorder="1">
|
1039
|
+
<clause id='N' inline-header='false' obligation='normative'>
|
1040
|
+
<title depth="2">Intro</title>
|
1039
1041
|
</clause>
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1042
|
+
<clause id='O' inline-header='true' obligation='normative'> </clause>
|
1043
|
+
</introduction>
|
1044
|
+
</preface>
|
1045
|
+
<sections>
|
1046
|
+
<clause id='M1' inline-header='false' obligation='normative' displayorder="2">
|
1047
|
+
<title>1.</title>
|
1048
|
+
<clause id='N1' inline-header='false' obligation='normative'>
|
1049
|
+
<title>1.1.</title>
|
1050
|
+
</clause>
|
1051
|
+
<clause id='O1' inline-header='true' obligation='normative'>
|
1052
|
+
<title>1.2.</title>
|
1053
|
+
</clause>
|
1054
|
+
</clause>
|
1055
|
+
</sections>
|
1056
|
+
</iso-standard>
|
1057
|
+
OUTPUT
|
1058
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1059
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
1043
1060
|
end
|
1044
1061
|
|
1045
1062
|
it "processes clauses containing normative references" do
|
@@ -1070,7 +1087,7 @@ RSpec.describe IsoDoc do
|
|
1070
1087
|
presxml = <<~OUTPUT
|
1071
1088
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
1072
1089
|
<bibliography>
|
1073
|
-
<clause id="D" obligation="informative">
|
1090
|
+
<clause id="D" obligation="informative" displayorder="2">
|
1074
1091
|
<title depth="1">Bibliography</title>
|
1075
1092
|
<references id="E" obligation="informative" normative="false">
|
1076
1093
|
<title depth="2">Bibliography Subsection 1</title>
|
@@ -1079,7 +1096,7 @@ RSpec.describe IsoDoc do
|
|
1079
1096
|
<title depth="2">Bibliography Subsection 2</title>
|
1080
1097
|
</references>
|
1081
1098
|
</clause>
|
1082
|
-
<clause id="A" obligation="informative"><title depth="1">1.<tab/>First References</title>
|
1099
|
+
<clause id="A" obligation="informative" displayorder="1"><title depth="1">1.<tab/>First References</title>
|
1083
1100
|
<references id="B" obligation="informative" normative="true">
|
1084
1101
|
<title depth="2">1.1.<tab/>Normative References 1</title>
|
1085
1102
|
</references>
|