isodoc 1.2.3 → 1.2.8
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 +69 -0
- data/README.adoc +1 -3
- data/isodoc.gemspec +3 -1
- data/lib/isodoc-yaml/i18n-en.yaml +1 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +9 -8
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/base_style/all.css +5 -1
- data/lib/isodoc/base_style/metanorma_word.css +6 -0
- data/lib/isodoc/base_style/metanorma_word.scss +6 -0
- data/lib/isodoc/base_style/reset.css +5 -1
- data/lib/isodoc/base_style/reset.scss +6 -1
- data/lib/isodoc/convert.rb +1 -14
- data/lib/isodoc/function/blocks.rb +1 -0
- data/lib/isodoc/function/inline.rb +0 -33
- data/lib/isodoc/function/references.rb +5 -3
- data/lib/isodoc/function/table.rb +1 -0
- data/lib/isodoc/function/to_word_html.rb +3 -2
- data/lib/isodoc/function/utils.rb +1 -1
- data/lib/isodoc/html_function/postprocess.rb +1 -0
- data/lib/isodoc/i18n.rb +23 -52
- data/lib/isodoc/metadata.rb +44 -111
- data/lib/isodoc/metadata_contributor.rb +90 -0
- data/lib/isodoc/metadata_date.rb +11 -0
- data/lib/isodoc/presentation_function/bibdata.rb +96 -0
- data/lib/isodoc/presentation_function/block.rb +28 -9
- data/lib/isodoc/presentation_function/inline.rb +149 -34
- data/lib/isodoc/presentation_xml_convert.rb +7 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +12 -0
- data/lib/isodoc/word_function/postprocess.rb +2 -2
- 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/lib/isodoc/xslfo_convert.rb +6 -1
- data/spec/assets/i18n.yaml +22 -5
- data/spec/isodoc/blocks_spec.rb +331 -215
- data/spec/isodoc/footnotes_spec.rb +4 -5
- data/spec/isodoc/i18n_spec.rb +89 -16
- data/spec/isodoc/inline_spec.rb +185 -163
- data/spec/isodoc/metadata_spec.rb +69 -19
- data/spec/isodoc/postproc_spec.rb +40 -3
- data/spec/isodoc/presentation_xml_spec.rb +584 -1
- data/spec/isodoc/ref_spec.rb +5 -5
- data/spec/isodoc/section_spec.rb +9 -9
- data/spec/isodoc/table_spec.rb +306 -207
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/isodoc/xref_spec.rb +46 -18
- data/spec/spec_helper.rb +6 -0
- metadata +35 -7
- data/.github/workflows/macos.yml +0 -42
- data/.github/workflows/ubuntu.yml +0 -62
- data/.github/workflows/windows.yml +0 -44
@@ -180,11 +180,10 @@ RSpec.describe IsoDoc do
|
|
180
180
|
</div>
|
181
181
|
<p class="zzSTDTitle1"></p>
|
182
182
|
</main>
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
</script>
|
183
|
+
<script type='text/x-mathjax-config'>
|
184
|
+
MathJax.Hub.Config({ "HTML-CSS": { preferredFont: "STIX" }, asciimath2jax:
|
185
|
+
{ delimiters: [['(#(', ')#)']] } });
|
186
|
+
</script>
|
188
187
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=MML_HTMLorMML-full" async="async"></script>
|
189
188
|
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script></body>
|
190
189
|
OUTPUT
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -68,9 +68,9 @@ 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
|
-
<language>en</language>
|
73
|
+
<language current="true">en</language>
|
74
74
|
</bibdata>
|
75
75
|
<preface>
|
76
76
|
<foreword obligation='informative'>
|
@@ -226,12 +226,12 @@ PRESXML
|
|
226
226
|
</body>
|
227
227
|
</html>
|
228
228
|
OUTPUT
|
229
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
229
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
230
230
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
231
231
|
end
|
232
232
|
|
233
233
|
it "defaults to English" do
|
234
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
234
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
235
235
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
236
236
|
<bibdata>
|
237
237
|
<language>tlh</language>
|
@@ -296,9 +296,9 @@ PRESXML
|
|
296
296
|
</iso-standard>
|
297
297
|
INPUT
|
298
298
|
<?xml version='1.0'?>
|
299
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
299
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
300
300
|
<bibdata>
|
301
|
-
<language>tlh</language>
|
301
|
+
<language current="true">tlh</language>
|
302
302
|
</bibdata>
|
303
303
|
<preface>
|
304
304
|
<foreword obligation='informative'>
|
@@ -449,9 +449,9 @@ PRESXML
|
|
449
449
|
INPUT
|
450
450
|
|
451
451
|
presxml = <<~"PRESXML"
|
452
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
452
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
453
453
|
<bibdata>
|
454
|
-
<language>fr</language>
|
454
|
+
<language current="true">fr</language>
|
455
455
|
</bibdata>
|
456
456
|
<preface>
|
457
457
|
<foreword obligation='informative'>
|
@@ -607,7 +607,7 @@ PRESXML
|
|
607
607
|
</body>
|
608
608
|
</html>
|
609
609
|
OUTPUT
|
610
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
610
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
611
611
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
612
612
|
end
|
613
613
|
|
@@ -689,10 +689,10 @@ PRESXML
|
|
689
689
|
INPUT
|
690
690
|
|
691
691
|
presxml = <<~"PRESXML"
|
692
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
692
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
693
693
|
<bibdata>
|
694
|
-
<language>zh</language>
|
695
|
-
<script>Hans</script>
|
694
|
+
<language current="true">zh</language>
|
695
|
+
<script current="true">Hans</script>
|
696
696
|
</bibdata>
|
697
697
|
<preface>
|
698
698
|
<foreword obligation='informative'>
|
@@ -862,21 +862,31 @@ PRESXML
|
|
862
862
|
</body>
|
863
863
|
</html>
|
864
864
|
OUTPUT
|
865
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
865
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", input, true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(presxml)
|
866
866
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
867
867
|
end
|
868
868
|
|
869
869
|
it "processes i18n file" do
|
870
|
+
mock_i18n
|
870
871
|
input = <<~"INPUT"
|
871
872
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
872
873
|
<bibdata>
|
873
874
|
<language>eo</language>
|
874
875
|
<script>Latn</script>
|
876
|
+
<status>
|
877
|
+
<stage>published</stage>
|
878
|
+
<substage>withdrawn</substage>
|
879
|
+
</status>
|
880
|
+
<ext>
|
881
|
+
<doctype>brochure</doctype>
|
882
|
+
</ext>
|
875
883
|
</bibdata>
|
876
884
|
<preface>
|
877
885
|
<foreword obligation="informative">
|
878
886
|
<title>Foreword</title>
|
879
887
|
<p id="A">See <xref target="M"/></p>
|
888
|
+
<p id="A">See <xref target="tab"/></p>
|
889
|
+
<table id="tab"/>
|
880
890
|
</foreword>
|
881
891
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
882
892
|
<title>Introduction Subsection</title>
|
@@ -908,6 +918,7 @@ PRESXML
|
|
908
918
|
</definitions>
|
909
919
|
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
910
920
|
<title>Introduction</title>
|
921
|
+
<note id="M-n1"/>
|
911
922
|
</clause>
|
912
923
|
<clause id="O" inline-header="false" obligation="normative">
|
913
924
|
<title>Clause 4.2</title>
|
@@ -944,15 +955,57 @@ PRESXML
|
|
944
955
|
INPUT
|
945
956
|
|
946
957
|
presxml = <<~OUTPUT
|
947
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
958
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
948
959
|
<bibdata>
|
949
|
-
<language>eo</language>
|
950
|
-
<script>Latn</script>
|
960
|
+
<language current="true">eo</language>
|
961
|
+
<script current="true">Latn</script>
|
962
|
+
<status>
|
963
|
+
<stage language=''>published</stage>
|
964
|
+
<stage language='eo'>publikigita</stage>
|
965
|
+
<substage language=''>withdrawn</substage>
|
966
|
+
<substage language='eo'>fortirita</substage>
|
967
|
+
</status>
|
968
|
+
<ext>
|
969
|
+
<doctype language=''>brochure</doctype>
|
970
|
+
<doctype language='eo'>broŝuro</doctype>
|
971
|
+
</ext>
|
951
972
|
</bibdata>
|
973
|
+
<localized-strings>
|
974
|
+
<localized-string key='foreword' language='eo'>Antaŭparolo</localized-string>
|
975
|
+
<localized-string key='introduction' language='eo'>Enkonduko</localized-string>
|
976
|
+
<localized-string key='clause' language='eo'>klaŭzo</localized-string>
|
977
|
+
<localized-string key='table' language='eo'>tabelo</localized-string>
|
978
|
+
<localized-string key='source' language='eo'>SOURCE</localized-string>
|
979
|
+
<localized-string key='modified' language='eo'>modified</localized-string>
|
980
|
+
<localized-string key='scope' language='eo'>Amplekso</localized-string>
|
981
|
+
<localized-string key='symbols' language='eo'>Simboloj kai mallongigitaj terminoj</localized-string>
|
982
|
+
<localized-string key='annex' language='eo'>Aldono</localized-string>
|
983
|
+
<localized-string key='normref' language='eo'>Normaj citaĵoj</localized-string>
|
984
|
+
<localized-string key='bibliography' language='eo'>Bibliografio</localized-string>
|
985
|
+
<localized-string key='inform_annex' language='eo'>informa</localized-string>
|
986
|
+
<localized-string key='all_parts' language='eo'>ĉiuj partoj</localized-string>
|
987
|
+
<localized-string key='norm_annex' language='eo'>normative</localized-string>
|
988
|
+
<localized-string key='note' language='eo'>NOTO</localized-string>
|
989
|
+
<localized-string key='locality.table' language='eo'>Tabelo</localized-string>
|
990
|
+
<localized-string key='doctype_dict.brochure' language='eo'>broŝuro</localized-string>
|
991
|
+
<localized-string key='doctype_dict.conference_proceedings' language='eo'>konferencaktoj</localized-string>
|
992
|
+
<localized-string key='stage_dict.published' language='eo'>publikigita</localized-string>
|
993
|
+
<localized-string key='substage_dict.withdrawn' language='eo'>fortirita</localized-string>
|
994
|
+
<localized-string key='array.0' language='eo'>elem1</localized-string>
|
995
|
+
<localized-string key='array.1' language='eo'>elem2</localized-string>
|
996
|
+
<localized-string key='array.2.elem3' language='eo'>elem4</localized-string>
|
997
|
+
<localized-string key='array.2.elem5' language='eo'>elem6</localized-string>
|
998
|
+
<localized-string key='language' language='eo'>eo</localized-string>
|
999
|
+
<localized-string key='script' language='eo'>Latn</localized-string>
|
1000
|
+
</localized-strings>
|
952
1001
|
<preface>
|
953
1002
|
<foreword obligation="informative">
|
954
1003
|
<title>Foreword</title>
|
955
1004
|
<p id='A'>See <xref target='M'>klaŭzo 5</xref></p>
|
1005
|
+
<p id='A'>See <xref target='tab'>tabelo 1</xref></p>
|
1006
|
+
<table id='tab'>
|
1007
|
+
<name>Tabelo 1</name>
|
1008
|
+
</table>
|
956
1009
|
</foreword>
|
957
1010
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
958
1011
|
<title depth="2">Introduction Subsection</title>
|
@@ -984,6 +1037,7 @@ PRESXML
|
|
984
1037
|
</definitions>
|
985
1038
|
<clause id="M" inline-header="false" obligation="normative"><title depth="1">5.<tab/>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
986
1039
|
<title depth="2">5.1.<tab/>Introduction</title>
|
1040
|
+
<note id='M-n1'><name>NOTO </name></note>
|
987
1041
|
</clause>
|
988
1042
|
<clause id="O" inline-header="false" obligation="normative">
|
989
1043
|
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
@@ -1039,6 +1093,12 @@ PRESXML
|
|
1039
1093
|
See
|
1040
1094
|
<a href='#M'>klaŭzo 5</a>
|
1041
1095
|
</p>
|
1096
|
+
<p id='A'>
|
1097
|
+
See
|
1098
|
+
<a href='#tab'>tabelo 1</a>
|
1099
|
+
</p>
|
1100
|
+
<p class='TableTitle' style='text-align:center;'>Tabelo 1</p>
|
1101
|
+
<table id='tab' class='MsoISOTable' style='border-width:1px;border-spacing:0;'/>
|
1042
1102
|
</div>
|
1043
1103
|
<br/>
|
1044
1104
|
<div class='Section3' id='B'>
|
@@ -1091,6 +1151,12 @@ PRESXML
|
|
1091
1151
|
<h1>5.  Clause 4</h1>
|
1092
1152
|
<div id='N'>
|
1093
1153
|
<h2>5.1.  Introduction</h2>
|
1154
|
+
<div id='M-n1' class='Note'>
|
1155
|
+
<p>
|
1156
|
+
<span class='note_label'>NOTO </span>
|
1157
|
+
 
|
1158
|
+
</p>
|
1159
|
+
</div>
|
1094
1160
|
</div>
|
1095
1161
|
<div id='O'>
|
1096
1162
|
<h2>5.2.  Clause 4.2</h2>
|
@@ -1128,4 +1194,11 @@ PRESXML
|
|
1128
1194
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1129
1195
|
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
1130
1196
|
end
|
1197
|
+
|
1198
|
+
private
|
1199
|
+
|
1200
|
+
def mock_i18n
|
1201
|
+
allow_any_instance_of(::IsoDoc::I18n).to receive(:load_yaml).with("eo", "Latn", "spec/assets/i18n.yaml").and_return(IsoDoc::I18n.new("eo", "Latn").normalise_hash(YAML.load_file("spec/assets/i18n.yaml")))
|
1202
|
+
end
|
1203
|
+
|
1131
1204
|
end
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -1,61 +1,47 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
-
|
4
|
+
it "droplocs xrefs" do
|
5
5
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
7
|
<sections>
|
8
8
|
<clause id="A">
|
9
|
-
<
|
10
|
-
</
|
9
|
+
<formula id="B">
|
10
|
+
</formula>
|
11
11
|
</clause>
|
12
12
|
<clause id="C">
|
13
13
|
<p>This is <xref target="A"/> and <xref target="B"/>.
|
14
|
-
This is <xref target="A"
|
15
|
-
<xref target="A"/> is clause <em>initial.</em><br/>
|
16
|
-
<xref target="A"/> is too. </p>
|
17
|
-
<p><xref target="A"/> is also.</p>
|
14
|
+
This is <xref target="A" droploc="true"/> and <xref target="B" droploc="true"/>.</p>
|
18
15
|
</clause>
|
19
16
|
</sections>
|
20
17
|
</iso-standard>
|
21
18
|
INPUT
|
22
|
-
|
23
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
19
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
24
20
|
<sections>
|
25
21
|
<clause id='A'>
|
26
|
-
|
27
|
-
<
|
28
|
-
<name>
|
29
|
-
</
|
22
|
+
<title>1.</title>
|
23
|
+
<formula id='B'>
|
24
|
+
<name>1</name>
|
25
|
+
</formula>
|
30
26
|
</clause>
|
31
27
|
<clause id='C'>
|
32
|
-
|
28
|
+
<title>2.</title>
|
33
29
|
<p>
|
34
30
|
This is
|
35
31
|
<xref target='A'>klaŭzo 1</xref>
|
36
32
|
and
|
37
|
-
<xref target='B'>
|
33
|
+
<xref target='B'>klaŭzo 1, Formula (1)</xref>
|
38
34
|
. This is
|
39
|
-
<xref target='A'
|
35
|
+
<xref target='A' droploc='true'>1</xref>
|
40
36
|
and
|
41
|
-
<xref target='B'
|
37
|
+
<xref target='B' droploc='true'>(1)</xref>
|
42
38
|
.
|
43
|
-
<xref target='A'>Klaŭzo 1</xref>
|
44
|
-
is clause
|
45
|
-
<em>initial.</em>
|
46
|
-
<br/>
|
47
|
-
<xref target='A'>Klaŭzo 1</xref>
|
48
|
-
is too.
|
49
|
-
</p>
|
50
|
-
<p>
|
51
|
-
<xref target='A'>Klaŭzo 1</xref>
|
52
|
-
is also.
|
53
39
|
</p>
|
54
40
|
</clause>
|
55
41
|
</sections>
|
56
42
|
</iso-standard>
|
57
43
|
OUTPUT
|
58
|
-
end
|
44
|
+
end
|
59
45
|
|
60
46
|
it "processes inline formatting" do
|
61
47
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
@@ -238,119 +224,132 @@ end
|
|
238
224
|
</iso-standard>
|
239
225
|
INPUT
|
240
226
|
presxml = <<~OUTPUT
|
241
|
-
|
242
|
-
|
243
|
-
<
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
</
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
<
|
267
|
-
<
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
<
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
227
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
228
|
+
<preface>
|
229
|
+
<foreword>
|
230
|
+
<p>
|
231
|
+
<ul>
|
232
|
+
<li>
|
233
|
+
<em>
|
234
|
+
<xref target='clause1'>Clause 2</xref>
|
235
|
+
</em>
|
236
|
+
</li>
|
237
|
+
<li>
|
238
|
+
<em>
|
239
|
+
<xref target='clause1'>w[o]rd</xref>
|
240
|
+
</em>
|
241
|
+
</li>
|
242
|
+
<li>
|
243
|
+
<em>
|
244
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
|
245
|
+
</em>
|
246
|
+
</li>
|
247
|
+
<li>
|
248
|
+
<em>
|
249
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
|
250
|
+
</em>
|
251
|
+
</li>
|
252
|
+
<li>
|
253
|
+
<em>
|
254
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
255
|
+
<locality type='clause'>
|
256
|
+
<referenceFrom>3.1</referenceFrom>
|
257
|
+
</locality>
|
258
|
+
<locality type='figure'>
|
259
|
+
<referenceFrom>a</referenceFrom>
|
260
|
+
</locality>
|
261
|
+
ISO 712, Clause 3.1, Figure a
|
262
|
+
</eref>
|
263
|
+
</em>
|
264
|
+
</li>
|
265
|
+
<li>
|
266
|
+
<em>
|
267
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
268
|
+
<localityStack>
|
269
|
+
<locality type='clause'>
|
270
|
+
<referenceFrom>3.1</referenceFrom>
|
271
|
+
</locality>
|
272
|
+
</localityStack>
|
273
|
+
<localityStack>
|
274
|
+
<locality type='figure'>
|
275
|
+
<referenceFrom>b</referenceFrom>
|
276
|
+
</locality>
|
277
|
+
</localityStack>
|
278
|
+
ISO 712, Clause 3.1; Figure b
|
279
|
+
</eref>
|
280
|
+
</em>
|
281
|
+
</li>
|
282
|
+
<li>
|
283
|
+
<em>
|
284
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
285
|
+
<localityStack>
|
286
|
+
<locality type='clause'>
|
287
|
+
<referenceFrom>3.1</referenceFrom>
|
288
|
+
</locality>
|
289
|
+
</localityStack>
|
290
|
+
<localityStack>
|
291
|
+
<locality type='figure'>
|
292
|
+
<referenceFrom>b</referenceFrom>
|
293
|
+
</locality>
|
294
|
+
</localityStack>
|
295
|
+
<em>word</em>
|
296
|
+
</eref>
|
297
|
+
</em>
|
298
|
+
</li>
|
299
|
+
<li>
|
300
|
+
[term defined in
|
301
|
+
<termref base='IEV' target='135-13-13'/>
|
302
|
+
]
|
303
|
+
</li>
|
304
|
+
<li>
|
305
|
+
<em>
|
306
|
+
<termref base='IEV' target='135-13-13'>
|
307
|
+
<em>word</em>
|
308
|
+
word
|
309
|
+
</termref>
|
310
|
+
</em>
|
311
|
+
</li>
|
312
|
+
</ul>
|
313
|
+
</p>
|
314
|
+
</foreword>
|
315
|
+
</preface>
|
316
|
+
<sections>
|
317
|
+
<clause id='clause1'>
|
318
|
+
<title depth='1'>
|
319
|
+
2.
|
320
|
+
<tab/>
|
321
|
+
Clause 1
|
322
|
+
</title>
|
323
|
+
</clause>
|
324
|
+
</sections>
|
325
|
+
<bibliography>
|
326
|
+
<references id='_normative_references' obligation='informative' normative='true'>
|
327
|
+
<title depth='1'>
|
328
|
+
1.
|
329
|
+
<tab/>
|
330
|
+
Normative References
|
331
|
+
</title>
|
332
|
+
<p>
|
333
|
+
The following documents are referred to in the text in such a way that
|
334
|
+
some or all of their content constitutes requirements of this document.
|
335
|
+
For dated references, only the edition cited applies. For undated
|
336
|
+
references, the latest edition of the referenced document (including any
|
337
|
+
amendments) applies.
|
338
|
+
</p>
|
339
|
+
<bibitem id='ISO712' type='standard'>
|
340
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
341
|
+
<title type='main' format='text/plain'>Cereals and cereal products</title>
|
342
|
+
<docidentifier type='ISO'>ISO 712</docidentifier>
|
343
|
+
<contributor>
|
344
|
+
<role type='publisher'/>
|
345
|
+
<organization>
|
346
|
+
<name>International Organization for Standardization</name>
|
347
|
+
</organization>
|
348
|
+
</contributor>
|
349
|
+
</bibitem>
|
350
|
+
</references>
|
351
|
+
</bibliography>
|
352
|
+
</iso-standard>
|
354
353
|
end
|
355
354
|
|
356
355
|
it "processes embedded inline formatting" do
|
@@ -606,7 +605,7 @@ OUTPUT
|
|
606
605
|
</iso-standard>
|
607
606
|
INPUT
|
608
607
|
presxml = <<~OUTPUT
|
609
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
608
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
610
609
|
<preface><foreword>
|
611
610
|
<p>
|
612
611
|
<eref type="inline" bibitemid="ISO712" citeas="ISO 712">ISO 712</eref>
|
@@ -728,7 +727,7 @@ html = <<~OUTPUT
|
|
728
727
|
</iso-standard>
|
729
728
|
INPUT
|
730
729
|
presxml = <<~OUTPUT
|
731
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
730
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
732
731
|
<preface>
|
733
732
|
<foreword>
|
734
733
|
<p>
|
@@ -903,7 +902,7 @@ OUTPUT
|
|
903
902
|
end
|
904
903
|
|
905
904
|
it "processes variant" do
|
906
|
-
|
905
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
907
906
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
908
907
|
<bibdata>
|
909
908
|
<language>en</language>
|
@@ -911,28 +910,46 @@ OUTPUT
|
|
911
910
|
</bibdata>
|
912
911
|
<preface>
|
913
912
|
<clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
|
913
|
+
<clause id="A1"><title><variant lang="en" script="Grek">ABC</variant><variant lang="fr" script="Grek">DEF</variant></title></clause>
|
914
|
+
<clause id="A2"><title><variant lang="en">ABC</variant><variant lang="fr">DEF</variant></title></clause>
|
914
915
|
<clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
|
915
916
|
<clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
|
917
|
+
<clause id="C1"><title><variant lang="fr" script="Grek">ABC</variant><variant lang="en" script="Grek">DEF</variant></title></clause>
|
918
|
+
<clause id="C2"><title><variant lang="fr">ABC</variant><variant lang="en">DEF</variant></title></clause>
|
919
|
+
<p>A <variant><variant lang="en">B</variant><variant lang="fr">C</variant></variant> D <variant><variant lang="en" script="Latn">E</variant><variant lang="fr" script="Latn">F</variant></variant></p>
|
916
920
|
</preface>
|
917
921
|
</iso-standard>
|
918
922
|
INPUT
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
<
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
<
|
933
|
-
</
|
934
|
-
|
935
|
-
</
|
923
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
924
|
+
<bibdata>
|
925
|
+
<language current='true'>en</language>
|
926
|
+
<script current='true'>Latn</script>
|
927
|
+
</bibdata>
|
928
|
+
<preface>
|
929
|
+
<clause id='A'>
|
930
|
+
<title depth='1'>ABC</title>
|
931
|
+
</clause>
|
932
|
+
<clause id='A1'>
|
933
|
+
<title depth='1'>ABC/DEF</title>
|
934
|
+
</clause>
|
935
|
+
<clause id='A2'>
|
936
|
+
<title depth='1'>ABC</title>
|
937
|
+
</clause>
|
938
|
+
<clause id='B'>
|
939
|
+
<title depth='1'>GHI/JKL</title>
|
940
|
+
</clause>
|
941
|
+
<clause id='C'>
|
942
|
+
<title depth='1'>DEF</title>
|
943
|
+
</clause>
|
944
|
+
<clause id='C1'>
|
945
|
+
<title depth='1'>ABC/DEF</title>
|
946
|
+
</clause>
|
947
|
+
<clause id='C2'>
|
948
|
+
<title depth='1'>DEF</title>
|
949
|
+
</clause>
|
950
|
+
<p>A B D E</p>
|
951
|
+
</preface>
|
952
|
+
</iso-standard>
|
936
953
|
OUTPUT
|
937
954
|
end
|
938
955
|
|
@@ -947,6 +964,7 @@ it "cases xrefs" do
|
|
947
964
|
<clause id="C">
|
948
965
|
<p>This is <xref target="A"/> and <xref target="B"/>.
|
949
966
|
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
967
|
+
This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
|
950
968
|
<xref target="A"/> is clause <em>initial.</em><br/>
|
951
969
|
<xref target="A"/> is too. </p>
|
952
970
|
<p><xref target="A"/> is also.</p>
|
@@ -955,7 +973,7 @@ it "cases xrefs" do
|
|
955
973
|
</iso-standard>
|
956
974
|
INPUT
|
957
975
|
<?xml version='1.0'?>
|
958
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml'>
|
976
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
959
977
|
<sections>
|
960
978
|
<clause id='A'>
|
961
979
|
<title>1.</title>
|
@@ -969,11 +987,15 @@ INPUT
|
|
969
987
|
This is
|
970
988
|
<xref target='A'>klaŭzo 1</xref>
|
971
989
|
and
|
972
|
-
<xref target='B'>
|
990
|
+
<xref target='B'>tabelo 1</xref>
|
973
991
|
. This is
|
974
992
|
<xref target='A' case='capital'>Klaŭzo 1</xref>
|
975
993
|
and
|
976
994
|
<xref target='B' case='lowercase'>tabelo 1</xref>
|
995
|
+
. This is
|
996
|
+
<xref target='A' case='lowercase'>klaŭzo 1</xref>
|
997
|
+
and
|
998
|
+
<xref target='B' case='capital'>Tabelo 1</xref>
|
977
999
|
.
|
978
1000
|
<xref target='A'>Klaŭzo 1</xref>
|
979
1001
|
is clause
|