isodoc 1.8.0 → 1.8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/isodoc.gemspec +1 -1
- data/lib/isodoc/class_utils.rb +1 -1
- data/lib/isodoc/convert.rb +8 -0
- data/lib/isodoc/function/inline.rb +3 -5
- data/lib/isodoc/html_function/html.rb +1 -0
- data/lib/isodoc/html_function/postprocess.rb +4 -6
- data/lib/isodoc/metadata_date.rb +13 -11
- data/lib/isodoc/presentation_function/bibdata.rb +2 -2
- data/lib/isodoc/presentation_function/terms.rb +74 -30
- data/lib/isodoc/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/word_function/body.rb +24 -14
- data/lib/isodoc/word_function/comments.rb +0 -4
- data/lib/isodoc/xref/xref_gen.rb +18 -22
- data/lib/isodoc/xref/xref_gen_seq.rb +10 -16
- data/lib/isodoc-yaml/i18n-ar.yaml +3 -0
- data/lib/isodoc-yaml/i18n-de.yaml +3 -0
- data/lib/isodoc-yaml/i18n-en.yaml +8 -5
- data/lib/isodoc-yaml/i18n-es.yaml +3 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +3 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +3 -0
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +3 -0
- data/spec/isodoc/blocks_spec.rb +14 -8
- data/spec/isodoc/i18n_spec.rb +15 -10
- data/spec/isodoc/inline_spec.rb +33 -43
- data/spec/isodoc/lists_spec.rb +344 -222
- data/spec/isodoc/section_spec.rb +12 -12
- data/spec/isodoc/table_spec.rb +71 -73
- data/spec/isodoc/terms_spec.rb +266 -212
- data/spec/isodoc/xref_numbering_spec.rb +347 -0
- data/spec/isodoc/xref_spec.rb +271 -350
- data/spec/spec_helper.rb +1 -1
- metadata +8 -7
@@ -100,16 +100,19 @@ locality: {
|
|
100
100
|
formula: Formula
|
101
101
|
}
|
102
102
|
grammar_abbrevs:
|
103
|
-
masculine:
|
104
|
-
feminine:
|
105
|
-
neuter:
|
103
|
+
masculine: m
|
104
|
+
feminine: f
|
105
|
+
neuter: n
|
106
106
|
common: common
|
107
|
+
singular: sg
|
108
|
+
dual: dual
|
109
|
+
pl: pl
|
107
110
|
isPreposition: prep
|
108
111
|
isParticiple: part
|
109
112
|
isAdjective: adj
|
110
113
|
isAdverb: adv
|
111
|
-
isNoun:
|
112
|
-
isVerb:
|
114
|
+
isNoun: noun
|
115
|
+
isVerb: verb
|
113
116
|
relatedterms:
|
114
117
|
deprecates: deprecates
|
115
118
|
supersedes: supersedes
|
data/spec/isodoc/blocks_spec.rb
CHANGED
@@ -809,8 +809,11 @@ RSpec.describe IsoDoc do
|
|
809
809
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
810
810
|
.convert("test", input, true)
|
811
811
|
.gsub(/</, "<")
|
812
|
-
.gsub(%r{data:application/x-msmetafile[^"']+},
|
813
|
-
|
812
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
813
|
+
"data:application/x-msmetafile")))
|
814
|
+
.to be_equivalent_to xmlpp(presxml
|
815
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
816
|
+
"data:application/x-msmetafile"))
|
814
817
|
expect(xmlpp(strip_guid(IsoDoc::HtmlConvert.new({})
|
815
818
|
.convert("test", presxml, true)))).to be_equivalent_to xmlpp(html)
|
816
819
|
expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({})
|
@@ -900,9 +903,11 @@ RSpec.describe IsoDoc do
|
|
900
903
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
901
904
|
.convert("test", input, true)
|
902
905
|
.gsub(/</, "<")
|
903
|
-
.gsub(%r{data:application/x-msmetafile[^"']+},
|
906
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
907
|
+
"data:application/x-msmetafile")))
|
904
908
|
.to be_equivalent_to xmlpp(presxml
|
905
|
-
.gsub(
|
909
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
910
|
+
"data:application/x-msmetafile"))
|
906
911
|
expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({})
|
907
912
|
.convert("test", presxml, true)
|
908
913
|
.gsub(/['"][^'".]+(?<!odf1)(?<!odf)\.emf['"]/, "'_.emf'")
|
@@ -991,9 +996,11 @@ RSpec.describe IsoDoc do
|
|
991
996
|
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
992
997
|
.convert("test", input, true)
|
993
998
|
.gsub(/</, "<")
|
994
|
-
.gsub(%r{data:application/x-msmetafile[^"']+},
|
999
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
1000
|
+
"data:application/x-msmetafile")))
|
995
1001
|
.to be_equivalent_to xmlpp(presxml
|
996
|
-
.gsub(
|
1002
|
+
.gsub(%r{data:application/x-msmetafile[^"']+},
|
1003
|
+
"data:application/x-msmetafile"))
|
997
1004
|
expect(xmlpp(strip_guid(IsoDoc::WordConvert.new({})
|
998
1005
|
.convert("test", presxml, true)
|
999
1006
|
.gsub(/['"][^'".]+(?<!odf1)(?<!odf)\.svg['"]/, "'_.svg'")
|
@@ -2521,8 +2528,7 @@ RSpec.describe IsoDoc do
|
|
2521
2528
|
.convert("test", input, true))
|
2522
2529
|
.sub(%r{<localized-strings>.*</localized-strings>}m, "")
|
2523
2530
|
.gsub(%r{"\.\\}, '"./')
|
2524
|
-
.gsub(%r{'\.\\}, "'./")
|
2525
|
-
)
|
2531
|
+
.gsub(%r{'\.\\}, "'./"))
|
2526
2532
|
.to be_equivalent_to xmlpp(output)
|
2527
2533
|
end
|
2528
2534
|
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -88,7 +88,7 @@ RSpec.describe IsoDoc do
|
|
88
88
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
89
89
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
90
90
|
<term id="J"><name>3.1.1.</name>
|
91
|
-
<preferred>Term2</preferred>
|
91
|
+
<preferred><strong>Term2</strong></preferred>
|
92
92
|
</term>
|
93
93
|
</terms>
|
94
94
|
<definitions id="K"><title>3.2.</title>
|
@@ -159,7 +159,7 @@ RSpec.describe IsoDoc do
|
|
159
159
|
<div id="I">
|
160
160
|
<h2>3.1.  Normal Terms</h2>
|
161
161
|
<p class="TermNum" id="J">3.1.1.</p>
|
162
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
162
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
163
163
|
</div><div id="K"><h2>3.2.</h2>
|
164
164
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
165
165
|
</div></div>
|
@@ -211,7 +211,7 @@ RSpec.describe IsoDoc do
|
|
211
211
|
end
|
212
212
|
|
213
213
|
it "defaults to English" do
|
214
|
-
|
214
|
+
input = <<~INPUT
|
215
215
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
216
216
|
<bibdata>
|
217
217
|
<language>tlh</language>
|
@@ -275,6 +275,7 @@ RSpec.describe IsoDoc do
|
|
275
275
|
</bibliography>
|
276
276
|
</iso-standard>
|
277
277
|
INPUT
|
278
|
+
output = <<~OUTPUT
|
278
279
|
<iso-standard xmlns="http://riboseinc.com/isoxml" type="presentation">
|
279
280
|
<bibdata>
|
280
281
|
<language current="true">tlh</language>
|
@@ -295,7 +296,7 @@ RSpec.describe IsoDoc do
|
|
295
296
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
296
297
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
297
298
|
<term id="J"><name>3.1.1.</name>
|
298
|
-
<preferred>Term2</preferred>
|
299
|
+
<preferred><strong>Term2</strong></preferred>
|
299
300
|
</term>
|
300
301
|
</terms>
|
301
302
|
<definitions id="K"><title>3.2.</title>
|
@@ -336,6 +337,10 @@ RSpec.describe IsoDoc do
|
|
336
337
|
</bibliography>
|
337
338
|
</iso-standard>
|
338
339
|
OUTPUT
|
340
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
341
|
+
.convert("test", input, true)
|
342
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, "")))
|
343
|
+
.to be_equivalent_to xmlpp(output)
|
339
344
|
end
|
340
345
|
|
341
346
|
it "processes French" do
|
@@ -425,7 +430,7 @@ RSpec.describe IsoDoc do
|
|
425
430
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
426
431
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
427
432
|
<term id="J"><name>3.1.1.</name>
|
428
|
-
<preferred>Term2</preferred>
|
433
|
+
<preferred><strong>Term2</strong></preferred>
|
429
434
|
</term>
|
430
435
|
</terms>
|
431
436
|
<definitions id="K"><title>3.2.</title>
|
@@ -496,7 +501,7 @@ RSpec.describe IsoDoc do
|
|
496
501
|
<div id="I">
|
497
502
|
<h2>3.1.  Normal Terms</h2>
|
498
503
|
<p class="TermNum" id="J">3.1.1.</p>
|
499
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
504
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
500
505
|
</div><div id="K"><h2>3.2.</h2>
|
501
506
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
502
507
|
</div></div>
|
@@ -644,7 +649,7 @@ RSpec.describe IsoDoc do
|
|
644
649
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
645
650
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
646
651
|
<term id="J"><name>3.1.1.</name>
|
647
|
-
<preferred>Term2</preferred>
|
652
|
+
<preferred><strong>Term2</strong></preferred>
|
648
653
|
</term>
|
649
654
|
</terms>
|
650
655
|
<definitions id="K"><title>3.2.</title>
|
@@ -728,7 +733,7 @@ RSpec.describe IsoDoc do
|
|
728
733
|
<div id="I">
|
729
734
|
<h2>3.1. Normal Terms</h2>
|
730
735
|
<p class="TermNum" id="J">3.1.1.</p>
|
731
|
-
<p class="Terms" style="text-align:left;">Term2</p>
|
736
|
+
<p class="Terms" style="text-align:left;"><b>Term2</b></p>
|
732
737
|
</div><div id="K"><h2>3.2.</h2>
|
733
738
|
<dl><dt><p>Symbol</p></dt><dd>Definition</dd></dl>
|
734
739
|
</div></div>
|
@@ -896,7 +901,7 @@ RSpec.describe IsoDoc do
|
|
896
901
|
<clause id="H" obligation="normative" displayorder="5"><title depth="1">3.<tab/>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
897
902
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
898
903
|
<term id="J"><name>3.1.1.</name>
|
899
|
-
<preferred>Term2</preferred>
|
904
|
+
<preferred><strong>Term2</strong></preferred>
|
900
905
|
</term>
|
901
906
|
</terms>
|
902
907
|
<definitions id="K"><title>3.2.</title>
|
@@ -1002,7 +1007,7 @@ RSpec.describe IsoDoc do
|
|
1002
1007
|
<div id='I'>
|
1003
1008
|
<h2>3.1.  Normal Terms</h2>
|
1004
1009
|
<p class='TermNum' id='J'>3.1.1.</p>
|
1005
|
-
<p class='Terms' style='text-align:left;'>Term2</p>
|
1010
|
+
<p class='Terms' style='text-align:left;'><b>Term2</b></p>
|
1006
1011
|
</div>
|
1007
1012
|
<div id='K'>
|
1008
1013
|
<h2>3.2.</h2>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -636,11 +636,10 @@ RSpec.describe IsoDoc do
|
|
636
636
|
<expression>
|
637
637
|
<name>Second Term</name>
|
638
638
|
</expression>
|
639
|
+
<field-of-application>Field</field-of-application>
|
640
|
+
<usage-info>Usage Info 1</usage-info>
|
639
641
|
</preferred>
|
640
|
-
<
|
641
|
-
<p id='B'>Usage Info 1.</p>
|
642
|
-
</usageinfo>
|
643
|
-
<definition><verbaldefinition>Definition 1</verbaldefinition></definition>
|
642
|
+
<definition><verbal-definition>Definition 1</verbal-definition></definition>
|
644
643
|
</term>
|
645
644
|
<term id="C">
|
646
645
|
<preferred language='fr' script='Latn' type='prefix'>
|
@@ -658,49 +657,40 @@ RSpec.describe IsoDoc do
|
|
658
657
|
</preferred>
|
659
658
|
<xref target='second'/>
|
660
659
|
</related>
|
661
|
-
<definition><
|
660
|
+
<definition><verbal-definition>Definition 2</verbal-definition></definition>
|
662
661
|
</term>
|
663
662
|
</terms>
|
664
663
|
</sections>
|
665
664
|
</iso-standard>
|
666
665
|
INPUT
|
667
666
|
output = <<~OUTPUT
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
(
|
693
|
-
<xref target='second'>Clause 1.1</xref>
|
694
|
-
)
|
695
|
-
</p>
|
696
|
-
<definition>Definition 2</definition>
|
697
|
-
</term>
|
698
|
-
</terms>
|
699
|
-
</sections>
|
700
|
-
</iso-standard>
|
667
|
+
<?xml version='1.0'?>
|
668
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
669
|
+
<sections>
|
670
|
+
<terms id='A' obligation='normative' displayorder='1'>
|
671
|
+
<title depth='1'>1.<tab/>Terms and definitions</title>
|
672
|
+
<term id='second'>
|
673
|
+
<name>1.1.</name>
|
674
|
+
<preferred><strong>Second Term, <Field, Usage Info 1></strong></preferred>
|
675
|
+
<definition>Definition 1</definition>
|
676
|
+
</term>
|
677
|
+
<term id='C'>
|
678
|
+
<name>1.2.</name>
|
679
|
+
<preferred language='fr' script='Latn' type='prefix'><strong>First Designation</strong></preferred>
|
680
|
+
<p>
|
681
|
+
<strong>CONTRAST:</strong>
|
682
|
+
<em>
|
683
|
+
<preferred><strong>Fifth Designation</strong>, n</preferred>
|
684
|
+
</em> (<xref target='second'>Clause 1.1</xref>)
|
685
|
+
</p>
|
686
|
+
<definition>Definition 2</definition>
|
687
|
+
</term>
|
688
|
+
</terms>
|
689
|
+
</sections>
|
690
|
+
</iso-standard>
|
701
691
|
OUTPUT
|
702
|
-
|
703
|
-
|
692
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
693
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
704
694
|
end
|
705
695
|
|
706
696
|
it "processes embedded inline formatting" do
|
@@ -802,9 +792,9 @@ RSpec.describe IsoDoc do
|
|
802
792
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
803
793
|
<preface><foreword>
|
804
794
|
<p>
|
805
|
-
<link
|
806
|
-
<link
|
807
|
-
<link
|
795
|
+
<link update-type="true" target="http://example.com"/>
|
796
|
+
<link update-type="true" target="list.adoc">example</link>
|
797
|
+
<link update-type="true" target="list" alt="tip">example</link>
|
808
798
|
</p>
|
809
799
|
</foreword></preface>
|
810
800
|
<sections>
|