isodoc 1.0.26 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +12 -8
- data/.github/workflows/ubuntu.yml +26 -16
- data/.github/workflows/windows.yml +12 -8
- data/isodoc.gemspec +2 -2
- data/lib/isodoc.rb +2 -0
- data/lib/isodoc/common.rb +0 -4
- data/lib/isodoc/convert.rb +18 -8
- data/lib/isodoc/function/blocks.rb +43 -54
- data/lib/isodoc/function/blocks_example_note.rb +108 -0
- data/lib/isodoc/function/cleanup.rb +14 -2
- data/lib/isodoc/function/i18n.rb +1 -0
- data/lib/isodoc/function/inline.rb +76 -82
- data/lib/isodoc/function/inline_simple.rb +72 -0
- data/lib/isodoc/function/lists.rb +12 -6
- data/lib/isodoc/function/references.rb +65 -57
- data/lib/isodoc/function/reqt.rb +14 -5
- data/lib/isodoc/function/section.rb +8 -11
- data/lib/isodoc/function/table.rb +4 -5
- data/lib/isodoc/function/terms.rb +3 -3
- data/lib/isodoc/function/to_word_html.rb +22 -13
- data/lib/isodoc/function/utils.rb +9 -3
- data/lib/isodoc/headlesshtml_convert.rb +7 -6
- data/lib/isodoc/html_convert.rb +2 -1
- data/lib/isodoc/html_function/footnotes.rb +1 -1
- data/lib/isodoc/html_function/html.rb +16 -1
- data/lib/isodoc/html_function/postprocess.rb +6 -5
- data/lib/isodoc/metadata.rb +6 -0
- data/lib/isodoc/pdf_convert.rb +8 -6
- data/lib/isodoc/presentation_xml_convert.rb +29 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_convert.rb +2 -1
- data/lib/isodoc/word_function/body.rb +14 -48
- data/lib/isodoc/word_function/footnotes.rb +1 -1
- data/lib/isodoc/word_function/inline.rb +75 -0
- data/lib/isodoc/word_function/postprocess.rb +1 -0
- data/lib/isodoc/word_function/table.rb +3 -3
- data/lib/isodoc/xref.rb +59 -0
- data/lib/isodoc/{function → xref}/xref_anchor.rb +10 -21
- data/lib/isodoc/xref/xref_counter.rb +74 -0
- data/lib/isodoc/{function → xref}/xref_gen.rb +9 -22
- data/lib/isodoc/{function → xref}/xref_gen_seq.rb +41 -32
- data/lib/isodoc/{function → xref}/xref_sect_gen.rb +33 -23
- data/lib/isodoc/xslfo_convert.rb +16 -4
- data/spec/assets/i18n.yaml +4 -1
- data/spec/assets/odf.emf +0 -0
- data/spec/assets/odf.svg +4 -0
- data/spec/assets/odf1.svg +4 -0
- data/spec/isodoc/blocks_spec.rb +240 -59
- data/spec/isodoc/cleanup_spec.rb +139 -17
- data/spec/isodoc/footnotes_spec.rb +20 -5
- data/spec/isodoc/inline_spec.rb +296 -1
- data/spec/isodoc/lists_spec.rb +8 -8
- data/spec/isodoc/metadata_spec.rb +110 -3
- data/spec/isodoc/postproc_spec.rb +10 -14
- data/spec/isodoc/presentation_xml_spec.rb +20 -0
- data/spec/isodoc/ref_spec.rb +119 -50
- data/spec/isodoc/section_spec.rb +84 -18
- data/spec/isodoc/table_spec.rb +28 -28
- data/spec/isodoc/terms_spec.rb +7 -7
- data/spec/isodoc/xref_spec.rb +177 -57
- metadata +24 -17
- data/lib/isodoc/function/blocks_example.rb +0 -53
- data/lib/isodoc/function/xref_counter.rb +0 -50
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -154,9 +154,9 @@ RSpec.describe IsoDoc do
|
|
154
154
|
<br/>
|
155
155
|
<div>
|
156
156
|
<h1 class="ForewordTitle">Foreword</h1>
|
157
|
-
<p>A.<a
|
158
|
-
<p>B.<a
|
159
|
-
<p>C.<a
|
157
|
+
<p>A.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
158
|
+
<p>B.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
159
|
+
<p>C.<a class="FootnoteRef" href="#fn:1" epub:type="footnote"><sup>1</sup></a></p>
|
160
160
|
</div>
|
161
161
|
<p class="zzSTDTitle1"/>
|
162
162
|
<aside id="fn:2" class="footnote">
|
@@ -173,9 +173,9 @@ RSpec.describe IsoDoc do
|
|
173
173
|
<br/>
|
174
174
|
<div>
|
175
175
|
<h1 class="ForewordTitle">Foreword</h1>
|
176
|
-
<p>A.<a
|
177
|
-
<p>B.<a
|
178
|
-
<p>C.<a
|
176
|
+
<p>A.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>1</sup></a></p>
|
177
|
+
<p>B.<a class="FootnoteRef" href="#fn:2" epub:type="footnote"><sup>2</sup></a></p>
|
178
|
+
<p>C.<a class="FootnoteRef" href="#fn:1" epub:type="footnote"><sup>3</sup></a></p>
|
179
179
|
</div>
|
180
180
|
<p class="zzSTDTitle1"/>
|
181
181
|
<aside id="fn:2" class="footnote">
|
@@ -798,7 +798,7 @@ INPUT
|
|
798
798
|
OUTPUT
|
799
799
|
end
|
800
800
|
|
801
|
-
it "
|
801
|
+
it "does not break up very long strings in tables on request in HTML" do
|
802
802
|
expect(xmlpp(IsoDoc::HtmlConvert.new({break_up_urls_in_tables: "true"}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
803
803
|
<html xmlns:epub="http://www.idpf.org/2007/ops">
|
804
804
|
<head>
|
@@ -863,19 +863,12 @@ INPUT
|
|
863
863
|
<tbody>
|
864
864
|
<tr>
|
865
865
|
<td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
|
866
|
-
http://www.example.com/
|
867
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA/
|
868
|
-
BBBBBBBBBBBBBBBBBBBBBBBBBBBB
|
866
|
+
http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/BBBBBBBBBBBBBBBBBBBBBBBBBBBB
|
869
867
|
</td>
|
870
868
|
<td align='left' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;'>
|
871
|
-
http://www.example.com/
|
872
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
873
|
-
AAAAAAAABBBBBBBBBBBBBBBBBBBBBB BBBBBB
|
874
|
-
</td>
|
869
|
+
http://www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB</td>
|
875
870
|
<td align='center' style='border-top:solid windowtext 1.5pt;border-bottom:solid windowtext 1.0pt;'>
|
876
|
-
www.example.com/
|
877
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
878
|
-
ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
|
871
|
+
www.example.com/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB
|
879
872
|
</td>
|
880
873
|
</tr>
|
881
874
|
</tbody>
|
@@ -1063,4 +1056,133 @@ ABBBBBBBBBBBBBBBBBBBBBBBBBBBB
|
|
1063
1056
|
OUTPUT
|
1064
1057
|
end
|
1065
1058
|
|
1059
|
+
it "cleans up term sources" do
|
1060
|
+
c = IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"})
|
1061
|
+
c.i18n_init("en", "Latn")
|
1062
|
+
expect(xmlpp(c.textcleanup(<<~"INPUT").to_s)).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1063
|
+
#{HTML_HDR}
|
1064
|
+
<p class="zzSTDTitle1"/>
|
1065
|
+
<div id="_terms_and_definitions"><h1>1.  Terms and Definitions</h1><p>For the purposes of this document,
|
1066
|
+
the following terms and definitions apply.</p>
|
1067
|
+
<p class="TermNum" id="paddy1">1.1.</p><p class="Terms" style="text-align:left;">paddy</p>
|
1068
|
+
|
1069
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"><rice> rice retaining its husk after threshing</p>
|
1070
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f892" class="example"><p class="example-title">EXAMPLE 1</p>
|
1071
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
1072
|
+
<ul>
|
1073
|
+
<li>A</li>
|
1074
|
+
</ul>
|
1075
|
+
</div>
|
1076
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f894" class="example"><p class="example-title">EXAMPLE 2</p>
|
1077
|
+
<ul>
|
1078
|
+
<li>A</li>
|
1079
|
+
</ul>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
<p>[TERMREF]
|
1083
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1084
|
+
[MODIFICATION]The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here
|
1085
|
+
[/TERMREF]</p>
|
1086
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [/TERMREF]</p>
|
1087
|
+
<p>[TERMREF] Termbase IEV, term ID xyz [MODIFICATION]with adjustments [/TERMREF]</p>
|
1088
|
+
<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
|
+
<p class="AltTerms" style="text-align:left;">rough rice</p>
|
1090
|
+
<p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
|
1091
|
+
<p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p>
|
1092
|
+
<div id="_bd57bbf1-f948-4bae-b0ce-73c00431f893" class="example"><p class="example-title">EXAMPLE</p>
|
1093
|
+
<ul>
|
1094
|
+
<li>A</li>
|
1095
|
+
</ul>
|
1096
|
+
</div>
|
1097
|
+
<div class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
|
1098
|
+
<div class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
|
1099
|
+
<p>[TERMREF]
|
1100
|
+
<a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>
|
1101
|
+
[/TERMREF]</p></div>
|
1102
|
+
</div>
|
1103
|
+
</body>
|
1104
|
+
</html>
|
1105
|
+
INPUT
|
1106
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
1107
|
+
<head/>
|
1108
|
+
<body lang='en'>
|
1109
|
+
<div class='title-section'>
|
1110
|
+
<p> </p>
|
1111
|
+
</div>
|
1112
|
+
<br/>
|
1113
|
+
<div class='prefatory-section'>
|
1114
|
+
<p> </p>
|
1115
|
+
</div>
|
1116
|
+
<br/>
|
1117
|
+
<div class='main-section'>
|
1118
|
+
<p class='zzSTDTitle1'/>
|
1119
|
+
<div id='_terms_and_definitions'>
|
1120
|
+
<h1>1.  Terms and Definitions</h1>
|
1121
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
1122
|
+
<p class='TermNum' id='paddy1'>1.1.</p>
|
1123
|
+
<p class='Terms' style='text-align:left;'>paddy</p>
|
1124
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'><rice> rice retaining its husk after threshing</p>
|
1125
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f892' class='example'>
|
1126
|
+
<p class='example-title'>EXAMPLE 1</p>
|
1127
|
+
<p id='_65c9a509-9a89-4b54-a890-274126aeb55c'>Foreign seeds, husks, bran, sand, dust.</p>
|
1128
|
+
<ul>
|
1129
|
+
<li>A</li>
|
1130
|
+
</ul>
|
1131
|
+
</div>
|
1132
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f894' class='example'>
|
1133
|
+
<p class='example-title'>EXAMPLE 2</p>
|
1134
|
+
<ul>
|
1135
|
+
<li>A</li>
|
1136
|
+
</ul>
|
1137
|
+
</div>
|
1138
|
+
<p>
|
1139
|
+
[SOURCE:
|
1140
|
+
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1141
|
+
, modified — The term "cargo rice" is shown as deprecated, and
|
1142
|
+
Note 1 to entry is not included here; Termbase IEV, term ID xyz;
|
1143
|
+
Termbase IEV, term ID xyz, modified — with adjustments]
|
1144
|
+
</p>
|
1145
|
+
<p class='TermNum' id='paddy'>1.2.</p>
|
1146
|
+
<p class='Terms' style='text-align:left;'>paddy</p>
|
1147
|
+
<p class='AltTerms' style='text-align:left;'>paddy rice</p>
|
1148
|
+
<p class='AltTerms' style='text-align:left;'>rough rice</p>
|
1149
|
+
<p class='DeprecatedTerms' style='text-align:left;'>DEPRECATED: cargo rice</p>
|
1150
|
+
<p id='_eb29b35e-123e-4d1c-b50b-2714d41e747f'>rice retaining its husk after threshing</p>
|
1151
|
+
<div id='_bd57bbf1-f948-4bae-b0ce-73c00431f893' class='example'>
|
1152
|
+
<p class='example-title'>EXAMPLE</p>
|
1153
|
+
<ul>
|
1154
|
+
<li>A</li>
|
1155
|
+
</ul>
|
1156
|
+
</div>
|
1157
|
+
<div class='Note'>
|
1158
|
+
<p>
|
1159
|
+
Note 1 to entry: The starch of waxy rice consists almost entirely of
|
1160
|
+
amylopectin. The kernels have a tendency to stick together after
|
1161
|
+
cooking.
|
1162
|
+
</p>
|
1163
|
+
</div>
|
1164
|
+
<div class='Note'>
|
1165
|
+
<p>
|
1166
|
+
Note 2 to entry:
|
1167
|
+
<ul>
|
1168
|
+
<li>A</li>
|
1169
|
+
</ul>
|
1170
|
+
<p id='_19830f33-e46c-42cc-94ca-a5ef101132d5'>
|
1171
|
+
The starch of waxy rice consists almost entirely of amylopectin.
|
1172
|
+
The kernels have a tendency to stick together after cooking.
|
1173
|
+
</p>
|
1174
|
+
</p>
|
1175
|
+
</div>
|
1176
|
+
<p>
|
1177
|
+
[SOURCE:
|
1178
|
+
<a href='#ISO7301'>ISO 7301:2011, Clause 3.1</a>
|
1179
|
+
]
|
1180
|
+
</p>
|
1181
|
+
</div>
|
1182
|
+
</div>
|
1183
|
+
</body>
|
1184
|
+
</html>
|
1185
|
+
OUTPUT
|
1186
|
+
end
|
1187
|
+
|
1066
1188
|
end
|
@@ -24,9 +24,24 @@ RSpec.describe IsoDoc do
|
|
24
24
|
<br/>
|
25
25
|
<div>
|
26
26
|
<h1 class="ForewordTitle">Foreword</h1>
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
<p>
|
28
|
+
A.
|
29
|
+
<a class='FootnoteRef' href='#fn:2'>
|
30
|
+
<sup>2</sup>
|
31
|
+
</a>
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
B.
|
35
|
+
<a class='FootnoteRef' href='#fn:2'>
|
36
|
+
<sup>2</sup>
|
37
|
+
</a>
|
38
|
+
</p>
|
39
|
+
<p>
|
40
|
+
C.
|
41
|
+
<a class='FootnoteRef' href='#fn:1'>
|
42
|
+
<sup>1</sup>
|
43
|
+
</a>
|
44
|
+
</p>
|
30
45
|
</div>
|
31
46
|
<p class="zzSTDTitle1"/>
|
32
47
|
<aside id="fn:2" class="footnote">
|
@@ -80,7 +95,7 @@ RSpec.describe IsoDoc do
|
|
80
95
|
<p>
|
81
96
|
A.
|
82
97
|
<span style='mso-bookmark:_Ref'>
|
83
|
-
<a href='#ftn2' epub:type='footnote'>
|
98
|
+
<a href='#ftn2' epub:type='footnote' class='FootnoteRef'>
|
84
99
|
<sup>2</sup>
|
85
100
|
</a>
|
86
101
|
</span>
|
@@ -96,7 +111,7 @@ RSpec.describe IsoDoc do
|
|
96
111
|
<p>
|
97
112
|
C.
|
98
113
|
<span style='mso-bookmark:_Ref'>
|
99
|
-
<a href='#ftn1' epub:type='footnote'>
|
114
|
+
<a href='#ftn1' epub:type='footnote' class='FootnoteRef'>
|
100
115
|
<sup>1</sup>
|
101
116
|
</a>
|
102
117
|
</span>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -467,6 +467,8 @@ OUTPUT
|
|
467
467
|
<eref type="inline" bibitemid="ISO712"><locality type="whole"></locality></eref>
|
468
468
|
<eref type="inline" bibitemid="ISO712"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
469
469
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</eref>
|
470
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality></eref>
|
471
|
+
<eref type="inline" bibitemid="ISO712"><locality type="anchor"><referenceFrom>1</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
470
472
|
</p>
|
471
473
|
</foreword></preface>
|
472
474
|
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
@@ -499,9 +501,11 @@ OUTPUT
|
|
499
501
|
<a href="#ISO712">ISO 712, Clause 1</a>
|
500
502
|
<a href="#ISO712">ISO 712, Clause 1.5</a>
|
501
503
|
<a href="#ISO712">A</a>
|
502
|
-
<a href="#ISO712">ISO 712, </a>
|
504
|
+
<a href="#ISO712">ISO 712, Whole of text</a>
|
503
505
|
<a href="#ISO712">ISO 712, Prelude 7</a>
|
504
506
|
<a href="#ISO712">A</a>
|
507
|
+
<a href='#ISO712'>ISO 712</a>
|
508
|
+
<a href='#ISO712'>ISO 712, Clause 1</a>
|
505
509
|
</p>
|
506
510
|
</div>
|
507
511
|
<p class="zzSTDTitle1"/>
|
@@ -515,5 +519,296 @@ OUTPUT
|
|
515
519
|
OUTPUT
|
516
520
|
end
|
517
521
|
|
522
|
+
it "processes eref content pointing to reference with citation URL" do
|
523
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
524
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
525
|
+
<preface><foreword>
|
526
|
+
<p>
|
527
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
528
|
+
<eref type="inline" bibitemid="ISO712"/>
|
529
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
530
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
531
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
532
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
533
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
534
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
535
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
536
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
537
|
+
<eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
|
538
|
+
<eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
539
|
+
<eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
|
540
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
|
541
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
542
|
+
</p>
|
543
|
+
</foreword></preface>
|
544
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
545
|
+
<bibitem id="ISO712" type="standard">
|
546
|
+
<title format="text/plain">Cereals and cereal products</title>
|
547
|
+
<uri type="citation">http://www.example.com</uri>
|
548
|
+
<docidentifier>ISO 712</docidentifier>
|
549
|
+
<contributor>
|
550
|
+
<role type="publisher"/>
|
551
|
+
<organization>
|
552
|
+
<abbreviation>ISO</abbreviation>
|
553
|
+
</organization>
|
554
|
+
</contributor>
|
555
|
+
</bibitem>
|
556
|
+
<bibitem id="ISO713" type="standard">
|
557
|
+
<title format="text/plain">Cereals and cereal products</title>
|
558
|
+
<uri type="citation">spec/assets/iso713</uri>
|
559
|
+
<docidentifier>ISO 713</docidentifier>
|
560
|
+
<contributor>
|
561
|
+
<role type="publisher"/>
|
562
|
+
<organization>
|
563
|
+
<abbreviation>ISO</abbreviation>
|
564
|
+
</organization>
|
565
|
+
</contributor>
|
566
|
+
</bibitem>
|
567
|
+
</references>
|
568
|
+
</bibliography>
|
569
|
+
</iso-standard>
|
570
|
+
INPUT
|
571
|
+
#{HTML_HDR}
|
572
|
+
<br/>
|
573
|
+
<div>
|
574
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
575
|
+
<p>
|
576
|
+
<a href='http://www.example.com'>ISO 712</a>
|
577
|
+
<a href='http://www.example.com'>ISO 712</a>
|
578
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
579
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1</a>
|
580
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1; Clause 1</a>
|
581
|
+
<a href='spec/assets/iso713.html'>ISO 713, Table 1–1</a>
|
582
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1, Table 1</a>
|
583
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1</a>
|
584
|
+
<a href='spec/assets/iso713.html'>ISO 713, Clause 1.5</a>
|
585
|
+
<a href='spec/assets/iso713.html'>A</a>
|
586
|
+
<a href='spec/assets/iso713.html'>ISO 713, Whole of text</a>
|
587
|
+
<a href='spec/assets/iso713.html'>ISO 713, Prelude 7</a>
|
588
|
+
<a href='spec/assets/iso713.html'>A</a>
|
589
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713</a>
|
590
|
+
<a href='spec/assets/iso713.html#xyz'>ISO 713, Clause 1</a>
|
591
|
+
</p>
|
592
|
+
</div>
|
593
|
+
<p class='zzSTDTitle1'/>
|
594
|
+
<div>
|
595
|
+
<h1>1.  Normative references</h1>
|
596
|
+
<p id='ISO712' class='NormRef'>
|
597
|
+
ISO 712,
|
598
|
+
<i>Cereals and cereal products</i>
|
599
|
+
</p>
|
600
|
+
<p id='ISO713' class='NormRef'>
|
601
|
+
ISO 713,
|
602
|
+
<i>Cereals and cereal products</i>
|
603
|
+
</p>
|
604
|
+
</div>
|
605
|
+
</div>
|
606
|
+
</body>
|
607
|
+
</html>
|
608
|
+
OUTPUT
|
609
|
+
end
|
610
|
+
|
611
|
+
it "processes eref content pointing to reference with citation URL (Word)" do
|
612
|
+
expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
613
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
614
|
+
<preface><foreword>
|
615
|
+
<p>
|
616
|
+
<eref type="inline" bibitemid="ISO712" citeas="ISO 712"/>
|
617
|
+
<eref type="inline" bibitemid="ISO712"/>
|
618
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
619
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
620
|
+
<eref type="inline" bibitemid="ISO713"><localityStack><locality type="table"><referenceFrom>1</referenceFrom></locality></localityStack><localityStack><locality type="clause"><referenceFrom>1</referenceFrom></locality></localityStack></eref>
|
621
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality></eref>
|
622
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality><locality type="table"><referenceFrom>1</referenceFrom></locality></eref>
|
623
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
624
|
+
<eref type="inline" bibitemid="ISO713"><locality type="clause"><referenceFrom>1.5</referenceFrom></locality></eref>
|
625
|
+
<eref type="inline" bibitemid="ISO713"><locality type="table"><referenceFrom>1</referenceFrom></locality>A</eref>
|
626
|
+
<eref type="inline" bibitemid="ISO713"><locality type="whole"></locality></eref>
|
627
|
+
<eref type="inline" bibitemid="ISO713"><locality type="locality:prelude"><referenceFrom>7</referenceFrom></locality></eref>
|
628
|
+
<eref type="inline" bibitemid="ISO713" citeas="ISO 713">A</eref>
|
629
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality></eref>
|
630
|
+
<eref type="inline" bibitemid="ISO713"><locality type="anchor"><referenceFrom>xyz</referenceFrom></locality><locality type="clause"><referenceFrom>1</referenceFrom></locality></eref>
|
631
|
+
</p>
|
632
|
+
</foreword></preface>
|
633
|
+
<bibliography><references id="_normative_references" obligation="informative" normative="true"><title>Normative References</title>
|
634
|
+
<bibitem id="ISO712" type="standard">
|
635
|
+
<title format="text/plain">Cereals and cereal products</title>
|
636
|
+
<uri type="citation">http://www.example.com</uri>
|
637
|
+
<docidentifier>ISO 712</docidentifier>
|
638
|
+
<contributor>
|
639
|
+
<role type="publisher"/>
|
640
|
+
<organization>
|
641
|
+
<abbreviation>ISO</abbreviation>
|
642
|
+
</organization>
|
643
|
+
</contributor>
|
644
|
+
</bibitem>
|
645
|
+
<bibitem id="ISO713" type="standard">
|
646
|
+
<title format="text/plain">Cereals and cereal products</title>
|
647
|
+
<uri type="citation">spec/assets/iso713</uri>
|
648
|
+
<docidentifier>ISO 713</docidentifier>
|
649
|
+
<contributor>
|
650
|
+
<role type="publisher"/>
|
651
|
+
<organization>
|
652
|
+
<abbreviation>ISO</abbreviation>
|
653
|
+
</organization>
|
654
|
+
</contributor>
|
655
|
+
</bibitem>
|
656
|
+
</references>
|
657
|
+
</bibliography>
|
658
|
+
</iso-standard>
|
659
|
+
INPUT
|
660
|
+
<html xmlns:epub='http://www.idpf.org/2007/ops' lang='en'>
|
661
|
+
<head>
|
662
|
+
<style>
|
663
|
+
</style>
|
664
|
+
</head>
|
665
|
+
<body lang='EN-US' link='blue' vlink='#954F72'>
|
666
|
+
<div class='WordSection1'>
|
667
|
+
<p> </p>
|
668
|
+
</div>
|
669
|
+
<p>
|
670
|
+
<br clear='all' class='section'/>
|
671
|
+
</p>
|
672
|
+
<div class='WordSection2'>
|
673
|
+
<p>
|
674
|
+
<br clear='all' style='mso-special-character:line-break;page-break-before:always'/>
|
675
|
+
</p>
|
676
|
+
<div>
|
677
|
+
<h1 class='ForewordTitle'>Foreword</h1>
|
678
|
+
<p>
|
679
|
+
<a href='http://www.example.com'>ISO 712</a>
|
680
|
+
<a href='http://www.example.com'>ISO 712</a>
|
681
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
682
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1</a>
|
683
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1; Clause 1</a>
|
684
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Table 1–1</a>
|
685
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1, Table 1</a>
|
686
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1</a>
|
687
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Clause 1.5</a>
|
688
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
689
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Whole of text</a>
|
690
|
+
<a href='spec/assets/iso713.doc'>ISO 713, Prelude 7</a>
|
691
|
+
<a href='spec/assets/iso713.doc'>A</a>
|
692
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713</a>
|
693
|
+
<a href='spec/assets/iso713.doc#xyz'>ISO 713, Clause 1</a>
|
694
|
+
</p>
|
695
|
+
</div>
|
696
|
+
<p> </p>
|
697
|
+
</div>
|
698
|
+
<p>
|
699
|
+
<br clear='all' class='section'/>
|
700
|
+
</p>
|
701
|
+
<div class='WordSection3'>
|
702
|
+
<p class='zzSTDTitle1'/>
|
703
|
+
<div>
|
704
|
+
<h1>
|
705
|
+
1.
|
706
|
+
<span style='mso-tab-count:1'>  </span>
|
707
|
+
Normative references
|
708
|
+
</h1>
|
709
|
+
<p id='ISO712' class='NormRef'>
|
710
|
+
ISO 712,
|
711
|
+
<i>Cereals and cereal products</i>
|
712
|
+
</p>
|
713
|
+
<p id='ISO713' class='NormRef'>
|
714
|
+
ISO 713,
|
715
|
+
<i>Cereals and cereal products</i>
|
716
|
+
</p>
|
717
|
+
</div>
|
718
|
+
</div>
|
719
|
+
</body>
|
720
|
+
</html>
|
721
|
+
|
722
|
+
OUTPUT
|
723
|
+
end
|
724
|
+
|
725
|
+
it "processes variant" do
|
726
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
727
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
728
|
+
<bibdata>
|
729
|
+
<language>en</language>
|
730
|
+
<script>Latn</script>
|
731
|
+
</bibdata>
|
732
|
+
<preface>
|
733
|
+
<clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
|
734
|
+
<clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
|
735
|
+
<clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
|
736
|
+
</preface>
|
737
|
+
</iso-standard>
|
738
|
+
INPUT
|
739
|
+
#{HTML_HDR}
|
740
|
+
<br/>
|
741
|
+
<div class='Section3' id='A'>
|
742
|
+
<h1 class='IntroTitle'>ABC</h1>
|
743
|
+
</div>
|
744
|
+
<br/>
|
745
|
+
<div class='Section3' id='B'>
|
746
|
+
<h1 class='IntroTitle'>GHI</h1>
|
747
|
+
</div>
|
748
|
+
<br/>
|
749
|
+
<div class='Section3' id='C'>
|
750
|
+
<h1 class='IntroTitle'>DEF</h1>
|
751
|
+
</div>
|
752
|
+
<p class='zzSTDTitle1'/>
|
753
|
+
</div>
|
754
|
+
</body>
|
755
|
+
</html>
|
756
|
+
OUTPUT
|
757
|
+
end
|
758
|
+
|
759
|
+
it "cases xrefs" do
|
760
|
+
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
761
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
762
|
+
<sections>
|
763
|
+
<clause id="A">
|
764
|
+
<table id="B">
|
765
|
+
</table>
|
766
|
+
</clause>
|
767
|
+
<clause id="C">
|
768
|
+
<p>This is <xref target="A"/> and <xref target="B"/>.
|
769
|
+
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
770
|
+
<xref target="A"/> is clause <em>initial.</em><br/>
|
771
|
+
<xref target="A"/> is too. </p>
|
772
|
+
<p><xref target="A"/> is also.</p>
|
773
|
+
</clause>
|
774
|
+
</sections>
|
775
|
+
</iso-standard>
|
776
|
+
INPUT
|
777
|
+
#{HTML_HDR}
|
778
|
+
<p class='zzSTDTitle1'/>
|
779
|
+
<div id='A'>
|
780
|
+
<h1>1.  </h1>
|
781
|
+
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
782
|
+
<table id='B' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
783
|
+
</div>
|
784
|
+
<div id='C'>
|
785
|
+
<h1>2.  </h1>
|
786
|
+
<p>
|
787
|
+
This is
|
788
|
+
<a href='#A'>klaŭzo 1</a>
|
789
|
+
and
|
790
|
+
<a href='#B'>Tabelo 1</a>
|
791
|
+
. This is
|
792
|
+
<a href='#A'>Klaŭzo 1</a>
|
793
|
+
and
|
794
|
+
<a href='#B'>tabelo 1</a>
|
795
|
+
.
|
796
|
+
<a href='#A'>Klaŭzo 1</a>
|
797
|
+
is clause
|
798
|
+
<i>initial.</i>
|
799
|
+
<br/>
|
800
|
+
<a href='#A'>Klaŭzo 1</a>
|
801
|
+
is too.
|
802
|
+
</p>
|
803
|
+
<p>
|
804
|
+
<a href='#A'>Klaŭzo 1</a>
|
805
|
+
is also.
|
806
|
+
</p>
|
807
|
+
</div>
|
808
|
+
</div>
|
809
|
+
</body>
|
810
|
+
</html>
|
811
|
+
OUTPUT
|
812
|
+
end
|
518
813
|
|
519
814
|
end
|