isodoc 1.2.5 → 1.3.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/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 +8 -7
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
- data/lib/isodoc/base_style/all.css +5 -1
- data/lib/isodoc/base_style/blocks.scss +2 -2
- data/lib/isodoc/base_style/reset.css +5 -1
- data/lib/isodoc/base_style/reset.scss +6 -1
- data/lib/isodoc/base_style/typography.scss +1 -1
- data/lib/isodoc/convert.rb +12 -97
- data/lib/isodoc/css.rb +95 -0
- data/lib/isodoc/function/inline.rb +0 -33
- data/lib/isodoc/function/inline_simple.rb +4 -1
- data/lib/isodoc/function/lists.rb +2 -1
- data/lib/isodoc/function/references.rb +8 -13
- data/lib/isodoc/function/table.rb +10 -0
- data/lib/isodoc/function/to_word_html.rb +3 -2
- data/lib/isodoc/gem_tasks.rb +4 -0
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/html_function/postprocess.rb +12 -3
- data/lib/isodoc/i18n.rb +23 -51
- data/lib/isodoc/metadata.rb +42 -115
- data/lib/isodoc/metadata_contributor.rb +90 -0
- data/lib/isodoc/metadata_date.rb +11 -0
- data/lib/isodoc/presentation_function/bibdata.rb +79 -7
- data/lib/isodoc/presentation_function/block.rb +14 -9
- data/lib/isodoc/presentation_function/inline.rb +126 -22
- data/lib/isodoc/presentation_function/section.rb +6 -0
- data/lib/isodoc/presentation_xml_convert.rb +4 -0
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_convert.rb +0 -20
- data/lib/isodoc/word_function/body.rb +12 -0
- data/lib/isodoc/word_function/postprocess.rb +38 -80
- data/lib/isodoc/word_function/postprocess_cover.rb +55 -0
- data/lib/isodoc/word_function/table.rb +10 -0
- data/lib/isodoc/xref.rb +1 -0
- data/lib/isodoc/xref/xref_counter.rb +20 -9
- data/lib/isodoc/xref/xref_gen.rb +20 -2
- data/lib/isodoc/xslfo_convert.rb +6 -1
- data/spec/assets/html.scss +14 -0
- data/spec/assets/i18n.yaml +17 -9
- data/spec/isodoc/blocks_spec.rb +88 -240
- data/spec/isodoc/cleanup_spec.rb +0 -1
- data/spec/isodoc/footnotes_spec.rb +4 -5
- data/spec/isodoc/i18n_spec.rb +73 -38
- data/spec/isodoc/inline_spec.rb +177 -199
- data/spec/isodoc/lists_spec.rb +1 -1
- data/spec/isodoc/metadata_spec.rb +68 -20
- data/spec/isodoc/postproc_spec.rb +306 -8
- data/spec/isodoc/presentation_xml_spec.rb +584 -1
- data/spec/isodoc/ref_spec.rb +327 -12
- data/spec/isodoc/table_spec.rb +28 -0
- data/spec/isodoc/xref_spec.rb +162 -17
- 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
data/spec/isodoc/cleanup_spec.rb
CHANGED
@@ -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
@@ -70,11 +70,8 @@ RSpec.describe IsoDoc do
|
|
70
70
|
presxml = <<~"PRESXML"
|
71
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
|
-
<local_bibdata>
|
76
|
-
<language>en</language>
|
77
|
-
</local_bibdata>
|
78
75
|
<preface>
|
79
76
|
<foreword obligation='informative'>
|
80
77
|
<title>Foreword</title>
|
@@ -229,12 +226,12 @@ PRESXML
|
|
229
226
|
</body>
|
230
227
|
</html>
|
231
228
|
OUTPUT
|
232
|
-
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)
|
233
230
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
234
231
|
end
|
235
232
|
|
236
233
|
it "defaults to English" do
|
237
|
-
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")
|
238
235
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
239
236
|
<bibdata>
|
240
237
|
<language>tlh</language>
|
@@ -301,11 +298,8 @@ PRESXML
|
|
301
298
|
<?xml version='1.0'?>
|
302
299
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
303
300
|
<bibdata>
|
304
|
-
<language>tlh</language>
|
301
|
+
<language current="true">tlh</language>
|
305
302
|
</bibdata>
|
306
|
-
<local_bibdata>
|
307
|
-
<language>tlh</language>
|
308
|
-
</local_bibdata>
|
309
303
|
<preface>
|
310
304
|
<foreword obligation='informative'>
|
311
305
|
<title>Foreword</title>
|
@@ -457,11 +451,8 @@ PRESXML
|
|
457
451
|
presxml = <<~"PRESXML"
|
458
452
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
459
453
|
<bibdata>
|
460
|
-
<language>fr</language>
|
454
|
+
<language current="true">fr</language>
|
461
455
|
</bibdata>
|
462
|
-
<local_bibdata>
|
463
|
-
<language>fr</language>
|
464
|
-
</local_bibdata>
|
465
456
|
<preface>
|
466
457
|
<foreword obligation='informative'>
|
467
458
|
<title>Foreword</title>
|
@@ -616,7 +607,7 @@ PRESXML
|
|
616
607
|
</body>
|
617
608
|
</html>
|
618
609
|
OUTPUT
|
619
|
-
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)
|
620
611
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
621
612
|
end
|
622
613
|
|
@@ -700,13 +691,9 @@ PRESXML
|
|
700
691
|
presxml = <<~"PRESXML"
|
701
692
|
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
702
693
|
<bibdata>
|
703
|
-
<language>zh</language>
|
704
|
-
<script>Hans</script>
|
694
|
+
<language current="true">zh</language>
|
695
|
+
<script current="true">Hans</script>
|
705
696
|
</bibdata>
|
706
|
-
<local_bibdata>
|
707
|
-
<language>zh</language>
|
708
|
-
<script>Hans</script>
|
709
|
-
</local_bibdata>
|
710
697
|
<preface>
|
711
698
|
<foreword obligation='informative'>
|
712
699
|
<title>Foreword</title>
|
@@ -875,11 +862,12 @@ PRESXML
|
|
875
862
|
</body>
|
876
863
|
</html>
|
877
864
|
OUTPUT
|
878
|
-
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)
|
879
866
|
expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
880
867
|
end
|
881
868
|
|
882
869
|
it "processes i18n file" do
|
870
|
+
mock_i18n
|
883
871
|
input = <<~"INPUT"
|
884
872
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
885
873
|
<bibdata>
|
@@ -897,6 +885,8 @@ PRESXML
|
|
897
885
|
<foreword obligation="informative">
|
898
886
|
<title>Foreword</title>
|
899
887
|
<p id="A">See <xref target="M"/></p>
|
888
|
+
<p id="A">See <xref target="tab"/></p>
|
889
|
+
<table id="tab"/>
|
900
890
|
</foreword>
|
901
891
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
902
892
|
<title>Introduction Subsection</title>
|
@@ -928,6 +918,7 @@ PRESXML
|
|
928
918
|
</definitions>
|
929
919
|
<clause id="M" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="N" inline-header="false" obligation="normative">
|
930
920
|
<title>Introduction</title>
|
921
|
+
<note id="M-n1"/>
|
931
922
|
</clause>
|
932
923
|
<clause id="O" inline-header="false" obligation="normative">
|
933
924
|
<title>Clause 4.2</title>
|
@@ -966,31 +957,55 @@ PRESXML
|
|
966
957
|
presxml = <<~OUTPUT
|
967
958
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
968
959
|
<bibdata>
|
969
|
-
<language>eo</language>
|
970
|
-
<script>Latn</script>
|
960
|
+
<language current="true">eo</language>
|
961
|
+
<script current="true">Latn</script>
|
971
962
|
<status>
|
972
|
-
|
973
|
-
|
963
|
+
<stage language=''>published</stage>
|
964
|
+
<stage language='eo'>publikigita</stage>
|
965
|
+
<substage language=''>withdrawn</substage>
|
966
|
+
<substage language='eo'>fortirita</substage>
|
974
967
|
</status>
|
975
968
|
<ext>
|
976
|
-
|
969
|
+
<doctype language=''>brochure</doctype>
|
970
|
+
<doctype language='eo'>broŝuro</doctype>
|
977
971
|
</ext>
|
978
972
|
</bibdata>
|
979
|
-
|
980
|
-
<language>
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
</
|
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>
|
990
1001
|
<preface>
|
991
1002
|
<foreword obligation="informative">
|
992
1003
|
<title>Foreword</title>
|
993
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>
|
994
1009
|
</foreword>
|
995
1010
|
<introduction id="B" obligation="informative"><title>Introduction</title><clause id="C" inline-header="false" obligation="informative">
|
996
1011
|
<title depth="2">Introduction Subsection</title>
|
@@ -1022,6 +1037,7 @@ PRESXML
|
|
1022
1037
|
</definitions>
|
1023
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">
|
1024
1039
|
<title depth="2">5.1.<tab/>Introduction</title>
|
1040
|
+
<note id='M-n1'><name>NOTO </name></note>
|
1025
1041
|
</clause>
|
1026
1042
|
<clause id="O" inline-header="false" obligation="normative">
|
1027
1043
|
<title depth="2">5.2.<tab/>Clause 4.2</title>
|
@@ -1077,6 +1093,12 @@ PRESXML
|
|
1077
1093
|
See
|
1078
1094
|
<a href='#M'>klaŭzo 5</a>
|
1079
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;'/>
|
1080
1102
|
</div>
|
1081
1103
|
<br/>
|
1082
1104
|
<div class='Section3' id='B'>
|
@@ -1129,6 +1151,12 @@ PRESXML
|
|
1129
1151
|
<h1>5.  Clause 4</h1>
|
1130
1152
|
<div id='N'>
|
1131
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>
|
1132
1160
|
</div>
|
1133
1161
|
<div id='O'>
|
1134
1162
|
<h2>5.2.  Clause 4.2</h2>
|
@@ -1166,4 +1194,11 @@ PRESXML
|
|
1166
1194
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", input, true))).to be_equivalent_to xmlpp(presxml)
|
1167
1195
|
expect(xmlpp(IsoDoc::HtmlConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
1168
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
|
+
|
1169
1204
|
end
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -1,62 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe IsoDoc do
|
4
|
-
it "cases xrefs" do
|
5
|
-
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
|
-
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
7
|
-
<sections>
|
8
|
-
<clause id="A">
|
9
|
-
<table id="B">
|
10
|
-
</table>
|
11
|
-
</clause>
|
12
|
-
<clause id="C">
|
13
|
-
<p>This is <xref target="A"/> and <xref target="B"/>.
|
14
|
-
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
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>
|
18
|
-
</clause>
|
19
|
-
</sections>
|
20
|
-
</iso-standard>
|
21
|
-
INPUT
|
22
|
-
<?xml version='1.0'?>
|
23
|
-
<iso-standard xmlns='http://riboseinc.com/isoxml' type="presentation">
|
24
|
-
<sections>
|
25
|
-
<clause id='A'>
|
26
|
-
<title>1.</title>
|
27
|
-
<table id='B'>
|
28
|
-
<name>Tabelo 1</name>
|
29
|
-
</table>
|
30
|
-
</clause>
|
31
|
-
<clause id='C'>
|
32
|
-
<title>2.</title>
|
33
|
-
<p>
|
34
|
-
This is
|
35
|
-
<xref target='A'>klaŭzo 1</xref>
|
36
|
-
and
|
37
|
-
<xref target='B'>Tabelo 1</xref>
|
38
|
-
. This is
|
39
|
-
<xref target='A' case='capital'>Klaŭzo 1</xref>
|
40
|
-
and
|
41
|
-
<xref target='B' case='lowercase'>tabelo 1</xref>
|
42
|
-
.
|
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
|
-
</p>
|
54
|
-
</clause>
|
55
|
-
</sections>
|
56
|
-
</iso-standard>
|
57
|
-
OUTPUT
|
58
|
-
end
|
59
|
-
|
60
4
|
it "droplocs xrefs" do
|
61
5
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({i18nyaml: "spec/assets/i18n.yaml"}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
62
6
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -173,7 +117,7 @@ OUTPUT
|
|
173
117
|
end
|
174
118
|
|
175
119
|
it "ignores index entries" do
|
176
|
-
expect(xmlpp(IsoDoc::
|
120
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
177
121
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
178
122
|
<preface><foreword>
|
179
123
|
<p><index primary="A" secondary="B" tertiary="C"/></p>
|
@@ -181,16 +125,14 @@ OUTPUT
|
|
181
125
|
<sections>
|
182
126
|
</iso-standard>
|
183
127
|
INPUT
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
</body>
|
193
|
-
</html>
|
128
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
129
|
+
<preface>
|
130
|
+
<foreword>
|
131
|
+
<p/>
|
132
|
+
</foreword>
|
133
|
+
</preface>
|
134
|
+
<sections> </sections>
|
135
|
+
</iso-standard>
|
194
136
|
OUTPUT
|
195
137
|
end
|
196
138
|
|
@@ -280,119 +222,132 @@ OUTPUT
|
|
280
222
|
</iso-standard>
|
281
223
|
INPUT
|
282
224
|
presxml = <<~OUTPUT
|
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
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
<
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
225
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
226
|
+
<preface>
|
227
|
+
<foreword>
|
228
|
+
<p>
|
229
|
+
<ul>
|
230
|
+
<li>
|
231
|
+
<em>
|
232
|
+
<xref target='clause1'>Clause 2</xref>
|
233
|
+
</em>
|
234
|
+
</li>
|
235
|
+
<li>
|
236
|
+
<em>
|
237
|
+
<xref target='clause1'>w[o]rd</xref>
|
238
|
+
</em>
|
239
|
+
</li>
|
240
|
+
<li>
|
241
|
+
<em>
|
242
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>ISO 712</eref>
|
243
|
+
</em>
|
244
|
+
</li>
|
245
|
+
<li>
|
246
|
+
<em>
|
247
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>word</eref>
|
248
|
+
</em>
|
249
|
+
</li>
|
250
|
+
<li>
|
251
|
+
<em>
|
252
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
253
|
+
<locality type='clause'>
|
254
|
+
<referenceFrom>3.1</referenceFrom>
|
255
|
+
</locality>
|
256
|
+
<locality type='figure'>
|
257
|
+
<referenceFrom>a</referenceFrom>
|
258
|
+
</locality>
|
259
|
+
ISO 712, Clause 3.1, Figure a
|
260
|
+
</eref>
|
261
|
+
</em>
|
262
|
+
</li>
|
263
|
+
<li>
|
264
|
+
<em>
|
265
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
266
|
+
<localityStack>
|
267
|
+
<locality type='clause'>
|
268
|
+
<referenceFrom>3.1</referenceFrom>
|
269
|
+
</locality>
|
270
|
+
</localityStack>
|
271
|
+
<localityStack>
|
272
|
+
<locality type='figure'>
|
273
|
+
<referenceFrom>b</referenceFrom>
|
274
|
+
</locality>
|
275
|
+
</localityStack>
|
276
|
+
ISO 712, Clause 3.1; Figure b
|
277
|
+
</eref>
|
278
|
+
</em>
|
279
|
+
</li>
|
280
|
+
<li>
|
281
|
+
<em>
|
282
|
+
<eref bibitemid='ISO712' type='inline' citeas='ISO 712'>
|
283
|
+
<localityStack>
|
284
|
+
<locality type='clause'>
|
285
|
+
<referenceFrom>3.1</referenceFrom>
|
286
|
+
</locality>
|
287
|
+
</localityStack>
|
288
|
+
<localityStack>
|
289
|
+
<locality type='figure'>
|
290
|
+
<referenceFrom>b</referenceFrom>
|
291
|
+
</locality>
|
292
|
+
</localityStack>
|
293
|
+
<em>word</em>
|
294
|
+
</eref>
|
295
|
+
</em>
|
296
|
+
</li>
|
297
|
+
<li>
|
298
|
+
[term defined in
|
299
|
+
<termref base='IEV' target='135-13-13'/>
|
300
|
+
]
|
301
|
+
</li>
|
302
|
+
<li>
|
303
|
+
<em>
|
304
|
+
<termref base='IEV' target='135-13-13'>
|
305
|
+
<em>word</em>
|
306
|
+
word
|
307
|
+
</termref>
|
308
|
+
</em>
|
309
|
+
</li>
|
310
|
+
</ul>
|
311
|
+
</p>
|
312
|
+
</foreword>
|
313
|
+
</preface>
|
314
|
+
<sections>
|
315
|
+
<clause id='clause1'>
|
316
|
+
<title depth='1'>
|
317
|
+
2.
|
318
|
+
<tab/>
|
319
|
+
Clause 1
|
320
|
+
</title>
|
321
|
+
</clause>
|
322
|
+
</sections>
|
323
|
+
<bibliography>
|
324
|
+
<references id='_normative_references' obligation='informative' normative='true'>
|
325
|
+
<title depth='1'>
|
326
|
+
1.
|
327
|
+
<tab/>
|
328
|
+
Normative References
|
329
|
+
</title>
|
330
|
+
<p>
|
331
|
+
The following documents are referred to in the text in such a way that
|
332
|
+
some or all of their content constitutes requirements of this document.
|
333
|
+
For dated references, only the edition cited applies. For undated
|
334
|
+
references, the latest edition of the referenced document (including any
|
335
|
+
amendments) applies.
|
336
|
+
</p>
|
337
|
+
<bibitem id='ISO712' type='standard'>
|
338
|
+
<title format='text/plain'>Cereals or cereal products</title>
|
339
|
+
<title type='main' format='text/plain'>Cereals and cereal products</title>
|
340
|
+
<docidentifier type='ISO'>ISO 712</docidentifier>
|
341
|
+
<contributor>
|
342
|
+
<role type='publisher'/>
|
343
|
+
<organization>
|
344
|
+
<name>International Organization for Standardization</name>
|
345
|
+
</organization>
|
346
|
+
</contributor>
|
347
|
+
</bibitem>
|
348
|
+
</references>
|
349
|
+
</bibliography>
|
350
|
+
</iso-standard>
|
396
351
|
end
|
397
352
|
|
398
353
|
it "processes embedded inline formatting" do
|
@@ -945,7 +900,7 @@ OUTPUT
|
|
945
900
|
end
|
946
901
|
|
947
902
|
it "processes variant" do
|
948
|
-
|
903
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true).sub(%r{<localized-strings>.*</localized-strings>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
949
904
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
950
905
|
<bibdata>
|
951
906
|
<language>en</language>
|
@@ -953,28 +908,46 @@ OUTPUT
|
|
953
908
|
</bibdata>
|
954
909
|
<preface>
|
955
910
|
<clause id="A"><title><variant lang="en" script="Latn">ABC</variant><variant lang="fr" script="Latn">DEF</variant></title></clause>
|
911
|
+
<clause id="A1"><title><variant lang="en" script="Grek">ABC</variant><variant lang="fr" script="Grek">DEF</variant></title></clause>
|
912
|
+
<clause id="A2"><title><variant lang="en">ABC</variant><variant lang="fr">DEF</variant></title></clause>
|
956
913
|
<clause id="B"><title><variant lang="de" script="Latn">GHI</variant><variant lang="es" script="Latn">JKL</variant></title></clause>
|
957
914
|
<clause id="C"><title><variant lang="fr" script="Latn">ABC</variant><variant lang="en" script="Latn">DEF</variant></title></clause>
|
915
|
+
<clause id="C1"><title><variant lang="fr" script="Grek">ABC</variant><variant lang="en" script="Grek">DEF</variant></title></clause>
|
916
|
+
<clause id="C2"><title><variant lang="fr">ABC</variant><variant lang="en">DEF</variant></title></clause>
|
917
|
+
<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>
|
958
918
|
</preface>
|
959
919
|
</iso-standard>
|
960
920
|
INPUT
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
<
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
<
|
975
|
-
</
|
976
|
-
|
977
|
-
</
|
921
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
922
|
+
<bibdata>
|
923
|
+
<language current='true'>en</language>
|
924
|
+
<script current='true'>Latn</script>
|
925
|
+
</bibdata>
|
926
|
+
<preface>
|
927
|
+
<clause id='A'>
|
928
|
+
<title depth='1'>ABC</title>
|
929
|
+
</clause>
|
930
|
+
<clause id='A1'>
|
931
|
+
<title depth='1'>ABC/DEF</title>
|
932
|
+
</clause>
|
933
|
+
<clause id='A2'>
|
934
|
+
<title depth='1'>ABC</title>
|
935
|
+
</clause>
|
936
|
+
<clause id='B'>
|
937
|
+
<title depth='1'>GHI/JKL</title>
|
938
|
+
</clause>
|
939
|
+
<clause id='C'>
|
940
|
+
<title depth='1'>DEF</title>
|
941
|
+
</clause>
|
942
|
+
<clause id='C1'>
|
943
|
+
<title depth='1'>ABC/DEF</title>
|
944
|
+
</clause>
|
945
|
+
<clause id='C2'>
|
946
|
+
<title depth='1'>DEF</title>
|
947
|
+
</clause>
|
948
|
+
<p>A B D E</p>
|
949
|
+
</preface>
|
950
|
+
</iso-standard>
|
978
951
|
OUTPUT
|
979
952
|
end
|
980
953
|
|
@@ -989,6 +962,7 @@ it "cases xrefs" do
|
|
989
962
|
<clause id="C">
|
990
963
|
<p>This is <xref target="A"/> and <xref target="B"/>.
|
991
964
|
This is <xref target="A" case="capital"/> and <xref target="B" case="lowercase"/>.
|
965
|
+
This is <xref target="A" case="lowercase"/> and <xref target="B" case="capital"/>.
|
992
966
|
<xref target="A"/> is clause <em>initial.</em><br/>
|
993
967
|
<xref target="A"/> is too. </p>
|
994
968
|
<p><xref target="A"/> is also.</p>
|
@@ -1011,11 +985,15 @@ INPUT
|
|
1011
985
|
This is
|
1012
986
|
<xref target='A'>klaŭzo 1</xref>
|
1013
987
|
and
|
1014
|
-
<xref target='B'>
|
988
|
+
<xref target='B'>tabelo 1</xref>
|
1015
989
|
. This is
|
1016
990
|
<xref target='A' case='capital'>Klaŭzo 1</xref>
|
1017
991
|
and
|
1018
992
|
<xref target='B' case='lowercase'>tabelo 1</xref>
|
993
|
+
. This is
|
994
|
+
<xref target='A' case='lowercase'>klaŭzo 1</xref>
|
995
|
+
and
|
996
|
+
<xref target='B' case='capital'>Tabelo 1</xref>
|
1019
997
|
.
|
1020
998
|
<xref target='A'>Klaŭzo 1</xref>
|
1021
999
|
is clause
|