isodoc 1.7.7 → 1.8.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +2 -2
- data/lib/isodoc/class_utils.rb +1 -1
- data/lib/isodoc/convert.rb +8 -0
- data/lib/isodoc/function/cleanup.rb +4 -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/block.rb +0 -36
- data/lib/isodoc/presentation_function/inline.rb +2 -3
- data/lib/isodoc/presentation_function/terms.rb +223 -0
- data/lib/isodoc/presentation_xml_convert.rb +11 -4
- 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/word_function/postprocess.rb +184 -176
- data/lib/isodoc/xref/xref_gen.rb +18 -22
- data/lib/isodoc/xref/xref_gen_seq.rb +10 -16
- data/lib/isodoc/xslfo_convert.rb +9 -6
- data/lib/isodoc-yaml/i18n-ar.yaml +25 -0
- data/lib/isodoc-yaml/i18n-de.yaml +23 -0
- data/lib/isodoc-yaml/i18n-en.yaml +23 -0
- data/lib/isodoc-yaml/i18n-es.yaml +23 -0
- data/lib/isodoc-yaml/i18n-fr.yaml +23 -0
- data/lib/isodoc-yaml/i18n-ru.yaml +24 -1
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +24 -0
- data/lib/metanorma/output/xslfo.rb +4 -11
- data/spec/isodoc/blocks_spec.rb +14 -8
- data/spec/isodoc/i18n_spec.rb +20 -15
- data/spec/isodoc/inline_spec.rb +71 -3
- data/spec/isodoc/lists_spec.rb +344 -222
- data/spec/isodoc/section_spec.rb +23 -22
- data/spec/isodoc/table_spec.rb +71 -73
- data/spec/isodoc/terms_spec.rb +498 -124
- data/spec/isodoc/xref_numbering_spec.rb +347 -0
- data/spec/isodoc/xref_spec.rb +274 -353
- data/spec/isodoc/xslfo_convert_spec.rb +20 -7
- metadata +12 -11
- data/lib/isodoc/presentation_function/concept.rb +0 -68
@@ -93,6 +93,29 @@ locality: {
|
|
93
93
|
note: Hinweis,
|
94
94
|
formula: Formel
|
95
95
|
}
|
96
|
+
grammar_abbrevs:
|
97
|
+
masculine: mask
|
98
|
+
feminine: fem
|
99
|
+
neuter: neutr
|
100
|
+
common: gemein
|
101
|
+
singular: Sg
|
102
|
+
dual: Dual
|
103
|
+
plural: Pl
|
104
|
+
isPreposition: Präp
|
105
|
+
isParticiple: Part
|
106
|
+
isAdjective: Adj
|
107
|
+
isAdverb: Adv
|
108
|
+
isNoun: Subs
|
109
|
+
isVerb: V
|
110
|
+
relatedterms:
|
111
|
+
deprecates: veraltet
|
112
|
+
supersedes: ersetzt
|
113
|
+
narrower: enger
|
114
|
+
broader: breiter
|
115
|
+
equivalent: entspricht
|
116
|
+
compare: vergleiche
|
117
|
+
contrast: dagegen
|
118
|
+
see: siehe
|
96
119
|
inflection:
|
97
120
|
Klausel:
|
98
121
|
sg: Klausel
|
@@ -99,6 +99,29 @@ locality: {
|
|
99
99
|
note: Note,
|
100
100
|
formula: Formula
|
101
101
|
}
|
102
|
+
grammar_abbrevs:
|
103
|
+
masculine: m
|
104
|
+
feminine: f
|
105
|
+
neuter: n
|
106
|
+
common: common
|
107
|
+
singular: sg
|
108
|
+
dual: dual
|
109
|
+
pl: pl
|
110
|
+
isPreposition: prep
|
111
|
+
isParticiple: part
|
112
|
+
isAdjective: adj
|
113
|
+
isAdverb: adv
|
114
|
+
isNoun: noun
|
115
|
+
isVerb: verb
|
116
|
+
relatedterms:
|
117
|
+
deprecates: deprecates
|
118
|
+
supersedes: supersedes
|
119
|
+
narrower: narrower
|
120
|
+
broader: broader
|
121
|
+
equivalent: equivalent
|
122
|
+
compare: compare
|
123
|
+
contrast: contrast
|
124
|
+
see: see
|
102
125
|
inflection:
|
103
126
|
Clause:
|
104
127
|
sg: Clause
|
@@ -95,6 +95,29 @@ locality: {
|
|
95
95
|
note: Nota,
|
96
96
|
formula: Fórmula
|
97
97
|
}
|
98
|
+
grammar_abbrevs:
|
99
|
+
masculine: masc
|
100
|
+
feminine: fem
|
101
|
+
neuter: neut
|
102
|
+
common: epicen@
|
103
|
+
singular: sg
|
104
|
+
dual: dual
|
105
|
+
plural: pl
|
106
|
+
isPreposition: prep
|
107
|
+
isParticiple: part
|
108
|
+
isAdjective: adj
|
109
|
+
isAdverb: adv
|
110
|
+
isNoun: sust
|
111
|
+
isVerb: v
|
112
|
+
relatedterms:
|
113
|
+
deprecates: obsoleto
|
114
|
+
supersedes: reemplaza
|
115
|
+
narrower: incluye
|
116
|
+
broader: extiende
|
117
|
+
equivalent: equivalente
|
118
|
+
compare: relacionado
|
119
|
+
contrast: difiere
|
120
|
+
see: véase
|
98
121
|
inflection:
|
99
122
|
Cláusula:
|
100
123
|
sg: Cláusula
|
@@ -92,6 +92,29 @@ locality: {
|
|
92
92
|
note: Note,
|
93
93
|
formula: Formule
|
94
94
|
}
|
95
|
+
grammar_abbrevs:
|
96
|
+
masculine: masc
|
97
|
+
feminine: fem
|
98
|
+
neuter: neut
|
99
|
+
common: épicène
|
100
|
+
singular: sg
|
101
|
+
dual: duel
|
102
|
+
plural: pl
|
103
|
+
isPreposition: prép
|
104
|
+
isParticiple: part
|
105
|
+
isAdjective: adj
|
106
|
+
isAdverb: adv
|
107
|
+
isNoun: subst
|
108
|
+
isVerb: vb
|
109
|
+
relatedterms:
|
110
|
+
deprecates: déprécie
|
111
|
+
supersedes: remplace
|
112
|
+
narrower: plus étroit
|
113
|
+
broader: plus large
|
114
|
+
equivalent: équivalent
|
115
|
+
compare: comparez
|
116
|
+
contrast: contrastez
|
117
|
+
see: voir
|
95
118
|
inflection:
|
96
119
|
Clause:
|
97
120
|
sg: Article
|
@@ -97,7 +97,30 @@ locality: {
|
|
97
97
|
example: Пример,
|
98
98
|
note: Примечание,
|
99
99
|
formula: Формула
|
100
|
-
|
100
|
+
}
|
101
|
+
grammar_abbrevs:
|
102
|
+
masculine: муж
|
103
|
+
feminine: жен
|
104
|
+
neuter: ср
|
105
|
+
common: общего рода
|
106
|
+
singular: ед
|
107
|
+
dual: дв
|
108
|
+
plural: мн
|
109
|
+
isPreposition: предл
|
110
|
+
isParticiple: прич
|
111
|
+
isAdjective: прил
|
112
|
+
isAdverb: нар
|
113
|
+
isNoun: сущ
|
114
|
+
isVerb: глаг
|
115
|
+
relatedterms:
|
116
|
+
deprecates: устаревший
|
117
|
+
supersedes: заменяет
|
118
|
+
narrower: более узкий
|
119
|
+
broader: более широкий
|
120
|
+
equivalent: эквивалент
|
121
|
+
compare: наравне
|
122
|
+
contrast: противоположный
|
123
|
+
see: см.
|
101
124
|
inflection:
|
102
125
|
Пункт:
|
103
126
|
sg: Пункт
|
@@ -93,3 +93,27 @@ locality: {
|
|
93
93
|
example: 示例,
|
94
94
|
note: 注
|
95
95
|
}
|
96
|
+
grammar_abbrevs:
|
97
|
+
masculine: 男性性别
|
98
|
+
feminine: 阴性
|
99
|
+
neuter: 中性的
|
100
|
+
common: 通性
|
101
|
+
singular: 单数
|
102
|
+
dual: 双
|
103
|
+
plural: 复数
|
104
|
+
isPreposition: 介词
|
105
|
+
isParticiple: 分词
|
106
|
+
isAdjective: 形容词
|
107
|
+
isAdverb: 副词
|
108
|
+
isNoun: 名词
|
109
|
+
isVerb: 动词
|
110
|
+
relatedterms:
|
111
|
+
deprecates: 旧词
|
112
|
+
supersedes: 取替
|
113
|
+
narrower: 狭义
|
114
|
+
broader: 广义
|
115
|
+
equivalent: 同义
|
116
|
+
compare: 比较
|
117
|
+
contrast: 对比
|
118
|
+
see: 见
|
119
|
+
|
@@ -1,21 +1,14 @@
|
|
1
|
-
require
|
2
|
-
require_relative "./utils
|
1
|
+
require "mn2pdf"
|
2
|
+
require_relative "./utils"
|
3
3
|
|
4
4
|
module Metanorma
|
5
5
|
module Output
|
6
6
|
class XslfoPdf < Base
|
7
|
-
def convert(url_path, output_path, xsl_stylesheet, options =
|
7
|
+
def convert(url_path, output_path, xsl_stylesheet, options = {})
|
8
8
|
return if url_path.nil? || output_path.nil? || xsl_stylesheet.nil?
|
9
9
|
|
10
|
-
Mn2pdf.convert(
|
11
|
-
end
|
12
|
-
|
13
|
-
def quote(x)
|
14
|
-
return x if /^'.*'$/.match(x)
|
15
|
-
return x if /^".*"$/.match(x)
|
16
|
-
%("#{x}")
|
10
|
+
Mn2pdf.convert(url_path, output_path, xsl_stylesheet, options)
|
17
11
|
end
|
18
12
|
end
|
19
13
|
end
|
20
14
|
end
|
21
|
-
|
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
@@ -24,7 +24,7 @@ RSpec.describe IsoDoc do
|
|
24
24
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
25
25
|
<title>Normal Terms</title>
|
26
26
|
<term id="J">
|
27
|
-
<preferred>Term2</preferred>
|
27
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
28
28
|
</term>
|
29
29
|
</terms>
|
30
30
|
<definitions id="K">
|
@@ -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>
|
@@ -233,7 +233,7 @@ RSpec.describe IsoDoc do
|
|
233
233
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
234
234
|
<title>Normal Terms</title>
|
235
235
|
<term id="J">
|
236
|
-
<preferred>Term2</preferred>
|
236
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
237
237
|
</term>
|
238
238
|
</terms>
|
239
239
|
<definitions id="K">
|
@@ -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
|
@@ -361,7 +366,7 @@ RSpec.describe IsoDoc do
|
|
361
366
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
362
367
|
<title>Normal Terms</title>
|
363
368
|
<term id="J">
|
364
|
-
<preferred>Term2</preferred>
|
369
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
365
370
|
</term>
|
366
371
|
</terms>
|
367
372
|
<definitions id="K">
|
@@ -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>
|
@@ -570,7 +575,7 @@ RSpec.describe IsoDoc do
|
|
570
575
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
571
576
|
<title>Normal Terms</title>
|
572
577
|
<term id="J">
|
573
|
-
<preferred>Term2</preferred>
|
578
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
574
579
|
</term>
|
575
580
|
</terms>
|
576
581
|
<definitions id="K">
|
@@ -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>
|
@@ -812,7 +817,7 @@ RSpec.describe IsoDoc do
|
|
812
817
|
<clause id="H" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="I" obligation="normative">
|
813
818
|
<title>Normal Terms</title>
|
814
819
|
<term id="J">
|
815
|
-
<preferred>Term2</preferred>
|
820
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
816
821
|
</term>
|
817
822
|
</terms>
|
818
823
|
<definitions id="K">
|
@@ -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
@@ -625,6 +625,74 @@ RSpec.describe IsoDoc do
|
|
625
625
|
.convert("test", presxml, true))).to be_equivalent_to xmlpp(output)
|
626
626
|
end
|
627
627
|
|
628
|
+
it "processes related terms" do
|
629
|
+
input = <<~INPUT
|
630
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
631
|
+
<sections>
|
632
|
+
<terms id='A' obligation='normative'>
|
633
|
+
<title>Terms and definitions</title>
|
634
|
+
<term id='second'>
|
635
|
+
<preferred>
|
636
|
+
<expression>
|
637
|
+
<name>Second Term</name>
|
638
|
+
</expression>
|
639
|
+
<field-of-application>Field</field-of-application>
|
640
|
+
<usage-info>Usage Info 1</usage-info>
|
641
|
+
</preferred>
|
642
|
+
<definition><verbal-definition>Definition 1</verbal-definition></definition>
|
643
|
+
</term>
|
644
|
+
<term id="C">
|
645
|
+
<preferred language='fr' script='Latn' type='prefix'>
|
646
|
+
<expression>
|
647
|
+
<name>First Designation</name>
|
648
|
+
</expression></preferred>
|
649
|
+
<related type='contrast'>
|
650
|
+
<preferred>
|
651
|
+
<expression>
|
652
|
+
<name>Fifth Designation</name>
|
653
|
+
<grammar>
|
654
|
+
<gender>neuter</gender>
|
655
|
+
</grammar>
|
656
|
+
</expression>
|
657
|
+
</preferred>
|
658
|
+
<xref target='second'/>
|
659
|
+
</related>
|
660
|
+
<definition><verbal-definition>Definition 2</verbal-definition></definition>
|
661
|
+
</term>
|
662
|
+
</terms>
|
663
|
+
</sections>
|
664
|
+
</iso-standard>
|
665
|
+
INPUT
|
666
|
+
output = <<~OUTPUT
|
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>
|
691
|
+
OUTPUT
|
692
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
693
|
+
.convert("test", input, true))).to be_equivalent_to xmlpp(output)
|
694
|
+
end
|
695
|
+
|
628
696
|
it "processes embedded inline formatting" do
|
629
697
|
input = <<~INPUT
|
630
698
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -724,9 +792,9 @@ RSpec.describe IsoDoc do
|
|
724
792
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
725
793
|
<preface><foreword>
|
726
794
|
<p>
|
727
|
-
<link
|
728
|
-
<link
|
729
|
-
<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>
|
730
798
|
</p>
|
731
799
|
</foreword></preface>
|
732
800
|
<sections>
|