isodoc 1.2.0 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc-yaml/i18n-fr.yaml +1 -1
- data/lib/isodoc/base_style/metanorma_word.css +6 -0
- data/lib/isodoc/base_style/metanorma_word.scss +6 -0
- data/lib/isodoc/convert.rb +1 -1
- data/lib/isodoc/function/blocks.rb +1 -0
- data/lib/isodoc/function/cleanup.rb +1 -1
- data/lib/isodoc/function/references.rb +4 -2
- data/lib/isodoc/function/section.rb +13 -1
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +2 -0
- data/lib/isodoc/function/utils.rb +2 -2
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/i18n.rb +0 -1
- data/lib/isodoc/metadata.rb +10 -4
- data/lib/isodoc/presentation_function/bibdata.rb +24 -0
- data/lib/isodoc/presentation_function/block.rb +14 -0
- data/lib/isodoc/presentation_function/inline.rb +27 -14
- data/lib/isodoc/presentation_xml_convert.rb +4 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +1 -0
- data/lib/isodoc/word_function/postprocess.rb +1 -1
- data/lib/isodoc/word_function/table.rb +3 -2
- data/lib/isodoc/xref.rb +1 -0
- data/lib/isodoc/xref/xref_anchor.rb +8 -3
- data/lib/isodoc/xref/xref_counter.rb +21 -7
- data/lib/isodoc/xref/xref_gen.rb +29 -6
- data/lib/isodoc/xref/xref_sect_gen.rb +1 -1
- data/spec/assets/i18n.yaml +9 -0
- data/spec/isodoc/blocks_spec.rb +281 -13
- data/spec/isodoc/cleanup_spec.rb +3 -1
- data/spec/isodoc/i18n_spec.rb +43 -5
- data/spec/isodoc/inline_spec.rb +47 -5
- data/spec/isodoc/metadata_spec.rb +3 -1
- data/spec/isodoc/postproc_spec.rb +39 -3
- data/spec/isodoc/ref_spec.rb +4 -1
- data/spec/isodoc/section_spec.rb +134 -10
- data/spec/isodoc/table_spec.rb +306 -207
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +46 -18
- metadata +3 -2
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -1084,6 +1084,7 @@ INPUT
|
|
1084
1084
|
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1085
1085
|
[/TERMREF]</p>
|
1086
1086
|
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1087
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION] [/TERMREF]</p>
|
1087
1088
|
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1088
1089
|
<p class="TermNum" id="paddy">1.2.</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
|
1089
1090
|
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
@@ -1140,7 +1141,8 @@ INPUT
|
|
1140
1141
|
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1141
1142
|
, modified — The term "cargo rice" is shown as deprecated, and
|
1142
1143
|
Note 1 to entry is not included here; Termbase IEV, term ID xyz;
|
1143
|
-
Termbase IEV, term ID xyz, modified
|
1144
|
+
Termbase IEV, term ID xyz, modified; Termbase IEV, term ID xyz,
|
1145
|
+
modified — with adjustments]
|
1144
1146
|
</p>
|
1145
1147
|
<p class='TermNum' id='paddy'>1.2.</p>
|
1146
1148
|
<p class='Terms' style='text-align:left;'>paddy</p>
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -68,10 +68,13 @@ RSpec.describe IsoDoc do
|
|
68
68
|
INPUT
|
69
69
|
|
70
70
|
presxml = <<~"PRESXML"
|
71
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
71
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
72
72
|
<bibdata>
|
73
73
|
<language>en</language>
|
74
74
|
</bibdata>
|
75
|
+
<local_bibdata>
|
76
|
+
<language>en</language>
|
77
|
+
</local_bibdata>
|
75
78
|
<preface>
|
76
79
|
<foreword obligation='informative'>
|
77
80
|
<title>Foreword</title>
|
@@ -296,10 +299,13 @@ PRESXML
|
|
296
299
|
</iso-standard>
|
297
300
|
INPUT
|
298
301
|
<?xml version='1.0'?>
|
299
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
302
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
300
303
|
<bibdata>
|
301
304
|
<language>tlh</language>
|
302
305
|
</bibdata>
|
306
|
+
<local_bibdata>
|
307
|
+
<language>tlh</language>
|
308
|
+
</local_bibdata>
|
303
309
|
<preface>
|
304
310
|
<foreword obligation='informative'>
|
305
311
|
<title>Foreword</title>
|
@@ -449,10 +455,13 @@ PRESXML
|
|
449
455
|
INPUT
|
450
456
|
|
451
457
|
presxml = <<~"PRESXML"
|
452
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
458
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
453
459
|
<bibdata>
|
454
460
|
<language>fr</language>
|
455
461
|
</bibdata>
|
462
|
+
<local_bibdata>
|
463
|
+
<language>fr</language>
|
464
|
+
</local_bibdata>
|
456
465
|
<preface>
|
457
466
|
<foreword obligation='informative'>
|
458
467
|
<title>Foreword</title>
|
@@ -689,11 +698,15 @@ PRESXML
|
|
689
698
|
INPUT
|
690
699
|
|
691
700
|
presxml = <<~"PRESXML"
|
692
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
701
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
693
702
|
<bibdata>
|
694
703
|
<language>zh</language>
|
695
704
|
<script>Hans</script>
|
696
705
|
</bibdata>
|
706
|
+
<local_bibdata>
|
707
|
+
<language>zh</language>
|
708
|
+
<script>Hans</script>
|
709
|
+
</local_bibdata>
|
697
710
|
<preface>
|
698
711
|
<foreword obligation='informative'>
|
699
712
|
<title>Foreword</title>
|
@@ -872,6 +885,13 @@ PRESXML
|
|
872
885
|
<bibdata>
|
873
886
|
<language>eo</language>
|
874
887
|
<script>Latn</script>
|
888
|
+
<status>
|
889
|
+
<stage>published</stage>
|
890
|
+
<substage>withdrawn</substage>
|
891
|
+
</status>
|
892
|
+
<ext>
|
893
|
+
<doctype>brochure</doctype>
|
894
|
+
</ext>
|
875
895
|
</bibdata>
|
876
896
|
<preface>
|
877
897
|
<foreword obligation="informative">
|
@@ -944,11 +964,29 @@ PRESXML
|
|
944
964
|
INPUT
|
945
965
|
|
946
966
|
presxml = <<~OUTPUT
|
947
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
967
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
948
968
|
<bibdata>
|
949
969
|
<language>eo</language>
|
950
970
|
<script>Latn</script>
|
971
|
+
<status>
|
972
|
+
<stage>published</stage>
|
973
|
+
<substage>withdrawn</substage>
|
974
|
+
</status>
|
975
|
+
<ext>
|
976
|
+
<doctype>brochure</doctype>
|
977
|
+
</ext>
|
951
978
|
</bibdata>
|
979
|
+
<local_bibdata>
|
980
|
+
<language>eo</language>
|
981
|
+
<script>Latn</script>
|
982
|
+
<status>
|
983
|
+
<stage>publikigita</stage>
|
984
|
+
<substage>fortirita</substage>
|
985
|
+
</status>
|
986
|
+
<ext>
|
987
|
+
<doctype>broŝuro</doctype>
|
988
|
+
</ext>
|
989
|
+
</local_bibdata>
|
952
990
|
<preface>
|
953
991
|
<foreword obligation="informative">
|
954
992
|
<title>Foreword</title>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -20,7 +20,7 @@ RSpec.describe IsoDoc do
|
|
20
20
|
</iso-standard>
|
21
21
|
INPUT
|
22
22
|
<?xml version='1.0'?>
|
23
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
23
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
24
24
|
<sections>
|
25
25
|
<clause id='A'>
|
26
26
|
<title>1.</title>
|
@@ -57,6 +57,48 @@ INPUT
|
|
57
57
|
OUTPUT
|
58
58
|
end
|
59
59
|
|
60
|
+
it "droplocs xrefs" do
|
61
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
62
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
63
|
+
<sections>
|
64
|
+
<clause id="A">
|
65
|
+
<formula id="B">
|
66
|
+
</formula>
|
67
|
+
</clause>
|
68
|
+
<clause id="C">
|
69
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
70
|
+
This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
|
71
|
+
</clause>
|
72
|
+
</sections>
|
73
|
+
</iso-standard>
|
74
|
+
INPUT
|
75
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
76
|
+
<sections>
|
77
|
+
<clause id='A'>
|
78
|
+
<title>1.</title>
|
79
|
+
<formula id='B'>
|
80
|
+
<name>1</name>
|
81
|
+
</formula>
|
82
|
+
</clause>
|
83
|
+
<clause id='C'>
|
84
|
+
<title>2.</title>
|
85
|
+
<p>
|
86
|
+
This is
|
87
|
+
<xref target='A'>klaŭzo 1</xref>
|
88
|
+
and
|
89
|
+
<xref target='B'>klaŭzo 1, Formula (1)</xref>
|
90
|
+
. This is
|
91
|
+
<xref target='A' droploc='true'>1</xref>
|
92
|
+
and
|
93
|
+
<xref target='B' droploc='true'>(1)</xref>
|
94
|
+
.
|
95
|
+
</p>
|
96
|
+
</clause>
|
97
|
+
</sections>
|
98
|
+
</iso-standard>
|
99
|
+
OUTPUT
|
100
|
+
end
|
101
|
+
|
60
102
|
it "processes inline formatting" do
|
61
103
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
62
104
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -238,7 +280,7 @@ end
|
|
238
280
|
</iso-standard>
|
239
281
|
INPUT
|
240
282
|
presxml = <<~OUTPUT
|
241
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
283
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
242
284
|
<preface><foreword>
|
243
285
|
<p>
|
244
286
|
<ul>
|
@@ -606,7 +648,7 @@ OUTPUT
|
|
606
648
|
</iso-standard>
|
607
649
|
INPUT
|
608
650
|
presxml = <<~OUTPUT
|
609
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
651
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
610
652
|
<preface><foreword>
|
611
653
|
<p>
|
612
654
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
|
@@ -728,7 +770,7 @@ html = <<~OUTPUT
|
|
728
770
|
</iso-standard>
|
729
771
|
INPUT
|
730
772
|
presxml = <<~OUTPUT
|
731
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
773
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
732
774
|
<preface>
|
733
775
|
<foreword>
|
734
776
|
<p>
|
@@ -955,7 +997,7 @@ it "cases xrefs" do
|
|
955
997
|
</iso-standard>
|
956
998
|
INPUT
|
957
999
|
<?xml version='1.0'?>
|
958
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1000
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
959
1001
|
<sections>
|
960
1002
|
<clause id='A'>
|
961
1003
|
<title>1.</title>
|
@@ -95,6 +95,8 @@ RSpec.describe IsoDoc do
|
|
95
95
|
<doctype>international-standard</doctype>
|
96
96
|
</ext>
|
97
97
|
</bibdata>
|
98
|
+
<local_bibdata type="standard">
|
99
|
+
</local_bibdata>
|
98
100
|
</iso-standard>
|
99
101
|
INPUT
|
100
102
|
{:accesseddate=>"2012",
|
@@ -127,7 +129,7 @@ INPUT
|
|
127
129
|
:receiveddate=>"XXX",
|
128
130
|
:revdate=>"2016-05-01",
|
129
131
|
:revdate_monthyear=>"May 2016",
|
130
|
-
:stage=>"Committee
|
132
|
+
:stage=>"Committee Draft",
|
131
133
|
:stageabbr=>"CD",
|
132
134
|
:substage=>"Withdrawn",
|
133
135
|
:transmitteddate=>"2020",
|
@@ -846,6 +846,14 @@ TOCLEVEL
|
|
846
846
|
<formula id="_5fc1ef0f-75d2-4b54-802c-b1bad4a53b62">
|
847
847
|
<stem type="AsciiMath">D1</stem>
|
848
848
|
</formula>
|
849
|
+
<dl id="_f8fb7ed7-7874-44a8-933f-06e0e86fb264">
|
850
|
+
<dt>
|
851
|
+
<em>n</em>
|
852
|
+
</dt>
|
853
|
+
<dd>
|
854
|
+
<p id="_a27281a4-b20e-4d0b-a780-bab9e851b03e">is the number of coating layers</p>
|
855
|
+
</dd>
|
856
|
+
</dl>
|
849
857
|
</ul></li>
|
850
858
|
</ol>
|
851
859
|
</foreword></preface>
|
@@ -901,6 +909,23 @@ TOCLEVEL
|
|
901
909
|
</div>
|
902
910
|
</div>
|
903
911
|
</div>
|
912
|
+
<div class='ListContLevel2'>
|
913
|
+
<table class='dl'>
|
914
|
+
<tr>
|
915
|
+
<td valign='top' align='left'>
|
916
|
+
<p align='left' style='margin-left:0pt;text-align:left;' class='MsoNormal'>
|
917
|
+
<i>n</i>
|
918
|
+
</p>
|
919
|
+
</td>
|
920
|
+
<td valign='top'>
|
921
|
+
<p class='MsoNormal'>
|
922
|
+
<a name='_a27281a4-b20e-4d0b-a780-bab9e851b03e' id='_a27281a4-b20e-4d0b-a780-bab9e851b03e'/>
|
923
|
+
is the number of coating layers
|
924
|
+
</p>
|
925
|
+
</td>
|
926
|
+
</tr>
|
927
|
+
</table>
|
928
|
+
</div>
|
904
929
|
</p>
|
905
930
|
</div>
|
906
931
|
<p class='MsoNormal'> </p>
|
@@ -1062,9 +1087,20 @@ word = File.read("test.doc").sub(/^.*<div class="WordSection2">/m, '<div class="
|
|
1062
1087
|
<thead>
|
1063
1088
|
<tr>
|
1064
1089
|
<td rowspan="2" style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;mso-border-bottom-alt:solid windowtext 1.0pt;">
|
1065
|
-
<p class="MsoNormal"><a name="_c47d9b39-adb2-431d-9320-78cb148fdb56" id="_c47d9b39-adb2-431d-9320-78cb148fdb56"></a>Output wavelength <span class="stem"
|
1066
|
-
|
1067
|
-
|
1090
|
+
<p class="MsoNormal"><a name="_c47d9b39-adb2-431d-9320-78cb148fdb56" id="_c47d9b39-adb2-431d-9320-78cb148fdb56"></a>Output wavelength <span class="stem">
|
1091
|
+
<m:oMath>
|
1092
|
+
<span style='font-style:normal;'>
|
1093
|
+
<m:r>
|
1094
|
+
<m:rPr>
|
1095
|
+
<m:sty m:val='p'/>
|
1096
|
+
</m:rPr>
|
1097
|
+
<m:t>(</m:t>
|
1098
|
+
</m:r>
|
1099
|
+
</span>
|
1100
|
+
<m:r>
|
1101
|
+
<m:t>μm)</m:t>
|
1102
|
+
</m:r>
|
1103
|
+
</m:oMath>
|
1068
1104
|
</span></p>
|
1069
1105
|
</td>
|
1070
1106
|
<th colspan="3" align="left" style="font-weight:bold;border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;">Predictive wavelengths</th>
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -125,10 +125,13 @@ RSpec.describe IsoDoc do
|
|
125
125
|
</iso-standard>
|
126
126
|
INPUT
|
127
127
|
presxml = <<~PRESXML
|
128
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
128
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
129
129
|
<bibdata>
|
130
130
|
<language>en</language>
|
131
131
|
</bibdata>
|
132
|
+
<local_bibdata>
|
133
|
+
<language>en</language>
|
134
|
+
</local_bibdata>
|
132
135
|
<preface>
|
133
136
|
<foreword>
|
134
137
|
<p id='_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f'>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -1,6 +1,131 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
+
it "processes prefatory blocks" do
|
5
|
+
input = <<~INPUT
|
6
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
+
<preface>
|
8
|
+
<abstract id="A"><title>abstract</title></abstract>
|
9
|
+
<introduction id="B"><title>introduction</title></introduction>
|
10
|
+
<note id="C">note</note>
|
11
|
+
</preface>
|
12
|
+
<sections>
|
13
|
+
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
14
|
+
<title>Introduction</title>
|
15
|
+
</clause>
|
16
|
+
<clause id="O" inline-header="true" obligation="normative">
|
17
|
+
<title>Clause 4.2</title>
|
18
|
+
</clause></clause>
|
19
|
+
<admonition id="L" type="caution"><p>admonition</p></admonition>
|
20
|
+
</sections>
|
21
|
+
</iso-standard>
|
22
|
+
INPUT
|
23
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
+
<html lang='en'>
|
25
|
+
<head/>
|
26
|
+
<body lang='en'>
|
27
|
+
<div class='title-section'>
|
28
|
+
<p> </p>
|
29
|
+
</div>
|
30
|
+
<br/>
|
31
|
+
<div class='prefatory-section'>
|
32
|
+
<p> </p>
|
33
|
+
</div>
|
34
|
+
<br/>
|
35
|
+
<div class='main-section'>
|
36
|
+
<div id='C' class='Note'>note</div>
|
37
|
+
<br/>
|
38
|
+
<div id='A'>
|
39
|
+
<h1 class='AbstractTitle'>abstract</h1>
|
40
|
+
</div>
|
41
|
+
<br/>
|
42
|
+
<div class='Section3' id='B'>
|
43
|
+
<h1 class='IntroTitle'>introduction</h1>
|
44
|
+
</div>
|
45
|
+
<p class='zzSTDTitle1'/>
|
46
|
+
<div id='L' class='Admonition'>
|
47
|
+
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
48
|
+
<p>admonition</p>
|
49
|
+
</div>
|
50
|
+
<div id='M'>
|
51
|
+
<h1>Clause 4</h1>
|
52
|
+
<div id='N'>
|
53
|
+
<h2>Introduction</h2>
|
54
|
+
</div>
|
55
|
+
<div id='O'>
|
56
|
+
<span class='zzMoveToFollowing'>
|
57
|
+
<b>Clause 4.2  </b>
|
58
|
+
</span>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</body>
|
63
|
+
</html>
|
64
|
+
OUTPUT
|
65
|
+
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
66
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
67
|
+
<head>
|
68
|
+
<style>
|
69
|
+
</style>
|
70
|
+
</head>
|
71
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
72
|
+
<div class='WordSection1'>
|
73
|
+
<p> </p>
|
74
|
+
</div>
|
75
|
+
<p>
|
76
|
+
<br clear='all' class='section'/>
|
77
|
+
</p>
|
78
|
+
<div class='WordSection2'>
|
79
|
+
<div id='C' class='Note'>
|
80
|
+
<p class='Note'>
|
81
|
+
<span class='note_label'/>
|
82
|
+
<span style='mso-tab-count:1'>  </span>
|
83
|
+
</p>
|
84
|
+
note
|
85
|
+
</div>
|
86
|
+
<p>
|
87
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
88
|
+
</p>
|
89
|
+
<div id='A'>
|
90
|
+
<h1 class='AbstractTitle'>abstract</h1>
|
91
|
+
</div>
|
92
|
+
<p>
|
93
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
94
|
+
</p>
|
95
|
+
<div class='Section3' id='B'>
|
96
|
+
<h1 class='IntroTitle'>introduction</h1>
|
97
|
+
</div>
|
98
|
+
<p> </p>
|
99
|
+
</div>
|
100
|
+
<p>
|
101
|
+
<br clear='all' class='section'/>
|
102
|
+
</p>
|
103
|
+
<div class='WordSection3'>
|
104
|
+
<p class='zzSTDTitle1'/>
|
105
|
+
<div id='L' class='Admonition'>
|
106
|
+
<p class='AdmonitionTitle' style='text-align:center;'>CAUTION</p>
|
107
|
+
<p>admonition</p>
|
108
|
+
</div>
|
109
|
+
<div id='M'>
|
110
|
+
<h1>Clause 4</h1>
|
111
|
+
<div id='N'>
|
112
|
+
<h2>Introduction</h2>
|
113
|
+
</div>
|
114
|
+
<div id='O'>
|
115
|
+
<span class='zzMoveToFollowing'>
|
116
|
+
<b>
|
117
|
+
Clause 4.2
|
118
|
+
<span style='mso-tab-count:1'>  </span>
|
119
|
+
</b>
|
120
|
+
</span>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
</body>
|
125
|
+
</html>
|
126
|
+
OUTPUT
|
127
|
+
end
|
128
|
+
|
4
129
|
it "processes document with no content" do
|
5
130
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
131
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -135,7 +260,7 @@ RSpec.describe IsoDoc do
|
|
135
260
|
INPUT
|
136
261
|
|
137
262
|
presxml = <<~"PRESXML"
|
138
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
263
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
139
264
|
<boilerplate>
|
140
265
|
<copyright-statement>
|
141
266
|
<clause>
|
@@ -630,7 +755,7 @@ OUTPUT
|
|
630
755
|
</iso-standard>
|
631
756
|
INPUT
|
632
757
|
<?xml version='1.0'?>
|
633
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
758
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
634
759
|
<preface>
|
635
760
|
<foreword obligation='informative'>
|
636
761
|
<title>Foreword</title>
|
@@ -724,7 +849,7 @@ OUTPUT
|
|
724
849
|
</iso-standard>
|
725
850
|
INPUT
|
726
851
|
<?xml version='1.0'?>
|
727
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
852
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
728
853
|
<preface>
|
729
854
|
<introduction id='B' obligation='informative'>
|
730
855
|
<title>Introduction</title>
|
@@ -751,7 +876,7 @@ OUTPUT
|
|
751
876
|
INPUT
|
752
877
|
|
753
878
|
presxml = <<~"OUTPUT"
|
754
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
879
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
755
880
|
<sections>
|
756
881
|
<terms id='H' obligation='normative'>
|
757
882
|
<title depth='1'>1.<tab/>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
@@ -796,7 +921,7 @@ OUTPUT
|
|
796
921
|
INPUT
|
797
922
|
|
798
923
|
presxml = <<~"PRESXML"
|
799
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
924
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
800
925
|
<sections>
|
801
926
|
<clause id='M' inline-header='false' obligation='normative'>
|
802
927
|
<title depth='1'>1.<tab/>Clause 4</title>
|
@@ -848,7 +973,7 @@ OUTPUT
|
|
848
973
|
</iso-standard>
|
849
974
|
INPUT
|
850
975
|
<?xml version='1.0'?>
|
851
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
976
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
852
977
|
<sections>
|
853
978
|
<clause id='M' inline-header='false' obligation='normative'>
|
854
979
|
<title depth="1">Clause 4</title>
|
@@ -866,7 +991,7 @@ OUTPUT
|
|
866
991
|
|
867
992
|
it "processes sections without titles" do
|
868
993
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
869
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
994
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
870
995
|
<preface>
|
871
996
|
<introduction id="M" inline-header="false" obligation="normative"><clause id="N" inline-header="false" obligation="normative">
|
872
997
|
<title>Intro</title>
|
@@ -884,7 +1009,7 @@ OUTPUT
|
|
884
1009
|
</iso-standard>
|
885
1010
|
INPUT
|
886
1011
|
<?xml version='1.0'?>
|
887
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
1012
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
888
1013
|
<preface>
|
889
1014
|
<introduction id='M' inline-header='false' obligation='normative'>
|
890
1015
|
<clause id='N' inline-header='false' obligation='normative'>
|
@@ -934,7 +1059,7 @@ OUTPUT
|
|
934
1059
|
</iso-standard>
|
935
1060
|
INPUT
|
936
1061
|
presxml = <<~OUTPUT
|
937
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1062
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
938
1063
|
<bibliography>
|
939
1064
|
<clause id="D" obligation="informative">
|
940
1065
|
<title depth="1">Bibliography</title>
|
@@ -989,5 +1114,4 @@ OUTPUT
|
|
989
1114
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(html)
|
990
1115
|
end
|
991
1116
|
|
992
|
-
|
993
1117
|
end
|