isodoc 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/isodoc.gemspec +1 -1
- data/lib/isodoc/presentation_function/image.rb +1 -2
- data/lib/isodoc/version.rb +1 -1
- data/lib/isodoc/xref/xref_gen_seq.rb +2 -2
- data/lib/isodoc-yaml/i18n-zh-Hans.yaml +2 -2
- data/spec/isodoc/i18n_spec.rb +2 -2
- data/spec/isodoc/presentation_xml_spec.rb +67 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7850182b408d69f4ae9de09a385c8813c366a2ffd15122596ac3cd95e1b62f6
|
4
|
+
data.tar.gz: 2920db0b8a2d7887a326ad5f58f23550c0eb949e33fdbcf7dd7601d805b08e8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e80f26545cd13b3e3bab7624d140cf2844afdf3471a45a8b77102fdaf2ca633e4a80df7a315718f3b35a8e3b95b9706a1e03785a19afef1bb5cf47dcf22a9d0d
|
7
|
+
data.tar.gz: 4ccdbce4a6e6e854137a938ec3e26361952f355b0cffd3776e646109cff971e0514dd5e222add212be371771e85bd75df5c6a3852800d7b12a07c5a2112a45aa
|
data/isodoc.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "isodoc-i18n", "~> 1.0.0"
|
35
35
|
spec.add_dependency "liquid", "~> 4"
|
36
36
|
# spec.add_dependency "metanorma", ">= 1.2.0"
|
37
|
-
spec.add_dependency "emf2svg", "
|
37
|
+
spec.add_dependency "emf2svg", "<= 1.3"
|
38
38
|
spec.add_dependency "mathml2asciimath"
|
39
39
|
spec.add_dependency "metanorma-utils"
|
40
40
|
spec.add_dependency "nokogiri", "~> 1.12.0"
|
@@ -29,8 +29,7 @@ module IsoDoc
|
|
29
29
|
def figure1(elem)
|
30
30
|
return sourcecode1(elem) if elem["class"] == "pseudocode" ||
|
31
31
|
elem["type"] == "pseudocode"
|
32
|
-
return if (
|
33
|
-
(elem.at(ns("./figure")) && !elem.at(ns("./name")))
|
32
|
+
return if elem.at(ns("./figure")) && !elem.at(ns("./name"))
|
34
33
|
|
35
34
|
lbl = @xrefs.anchor(elem["id"], :label, false) or return
|
36
35
|
prefix_name(elem, " — ",
|
data/lib/isodoc/version.rb
CHANGED
@@ -25,7 +25,7 @@ module IsoDoc
|
|
25
25
|
j = 0
|
26
26
|
clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]"))
|
27
27
|
.each do |t|
|
28
|
-
next if labelled_ancestor(t) && t.ancestors("figure").empty?
|
28
|
+
# next if labelled_ancestor(t) && t.ancestors("figure").empty?
|
29
29
|
|
30
30
|
j = subfigure_increment(j, c, t)
|
31
31
|
label = c.print + (j.zero? ? "" : "-#{j}")
|
@@ -111,7 +111,7 @@ module IsoDoc
|
|
111
111
|
j = 0
|
112
112
|
clause.xpath(ns(".//figure | .//sourcecode[not(ancestor::example)]"))
|
113
113
|
.each do |t|
|
114
|
-
next if labelled_ancestor(t) && t.ancestors("figure").empty?
|
114
|
+
# next if labelled_ancestor(t) && t.ancestors("figure").empty?
|
115
115
|
|
116
116
|
j = subfigure_increment(j, c, t)
|
117
117
|
label = "#{num}#{hiersep}#{c.print}" +
|
@@ -34,9 +34,9 @@ internal_external_terms_boilerplate: |
|
|
34
34
|
<p>% 界定的以及下列术语和定义适用于本文件。</p>
|
35
35
|
term_defined_in: "〖术语于%中定义〗"
|
36
36
|
binary_and: "%1和%2"
|
37
|
-
multiple_and: "%1
|
37
|
+
multiple_and: "%1、和%2"
|
38
38
|
binary_or: "%1或%2"
|
39
|
-
multiple_or: "%1
|
39
|
+
multiple_or: "%1、或%2"
|
40
40
|
chain_and: "%1和%2"
|
41
41
|
chain_or: "%1或%2"
|
42
42
|
chain_from: "%1从%2"
|
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -644,7 +644,7 @@ RSpec.describe IsoDoc do
|
|
644
644
|
</introduction></preface><sections>
|
645
645
|
<clause id="D" obligation="normative" type="scope" displayorder="3">
|
646
646
|
<title depth="1">1.<tab/>Scope</title>
|
647
|
-
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712&#
|
647
|
+
<p id="E"><eref type="inline" bibitemid="ISO712"><locality type="table"><referenceFrom>1</referenceFrom><referenceTo>1</referenceTo></locality>ISO 712, 第1–1 表</eref></p>
|
648
648
|
</clause>
|
649
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">
|
650
650
|
<title depth="2">3.1.<tab/>Normal Terms</title>
|
@@ -722,7 +722,7 @@ RSpec.describe IsoDoc do
|
|
722
722
|
<div id="D">
|
723
723
|
<h1>1. Scope</h1>
|
724
724
|
<p id="E">
|
725
|
-
<a href='#ISO712'>ISO 712&#
|
725
|
+
<a href='#ISO712'>ISO 712, 第1–1 表</a>
|
726
726
|
</p>
|
727
727
|
</div>
|
728
728
|
<div>
|
@@ -1158,7 +1158,6 @@ RSpec.describe IsoDoc do
|
|
1158
1158
|
.to be_equivalent_to xmlpp(presxml)
|
1159
1159
|
end
|
1160
1160
|
|
1161
|
-
|
1162
1161
|
it "inserts toc metadata" do
|
1163
1162
|
input = <<~INPUT
|
1164
1163
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
@@ -1194,7 +1193,7 @@ RSpec.describe IsoDoc do
|
|
1194
1193
|
end
|
1195
1194
|
|
1196
1195
|
it "processes multiple-target xrefs" do
|
1197
|
-
|
1196
|
+
input = <<~INPUT
|
1198
1197
|
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1199
1198
|
<bibdata/>
|
1200
1199
|
<sections>
|
@@ -1295,6 +1294,72 @@ RSpec.describe IsoDoc do
|
|
1295
1294
|
.to be_equivalent_to xmlpp(presxml)
|
1296
1295
|
end
|
1297
1296
|
|
1297
|
+
it "captions embedded figures" do
|
1298
|
+
input = <<~INPUT
|
1299
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
1300
|
+
<bibdata/>
|
1301
|
+
<sections>
|
1302
|
+
<clause id="A" inline-header="false" obligation="normative">
|
1303
|
+
<title>Section</title>
|
1304
|
+
<figure id="B1">
|
1305
|
+
<name>First</name>
|
1306
|
+
</figure>
|
1307
|
+
<example id="C1">
|
1308
|
+
<figure id="B2">
|
1309
|
+
<name>Second</name>
|
1310
|
+
</figure>
|
1311
|
+
</example>
|
1312
|
+
<example id="C2">
|
1313
|
+
<figure id="B4" unnumbered="true">
|
1314
|
+
<name>Unnamed</name>
|
1315
|
+
</figure>
|
1316
|
+
</example>
|
1317
|
+
<figure id="B3">
|
1318
|
+
<name>Third</name>
|
1319
|
+
</figure>
|
1320
|
+
</clause>
|
1321
|
+
</sections>
|
1322
|
+
</iso-standard>
|
1323
|
+
INPUT
|
1324
|
+
presxml = <<~OUTPUT
|
1325
|
+
<iso-standard xmlns='http://riboseinc.com/isoxml' type='presentation'>
|
1326
|
+
<bibdata/>
|
1327
|
+
|
1328
|
+
<sections>
|
1329
|
+
<clause id='A' inline-header='false' obligation='normative' displayorder='1'>
|
1330
|
+
<title depth='1'>
|
1331
|
+
1.
|
1332
|
+
<tab/>
|
1333
|
+
Section
|
1334
|
+
</title>
|
1335
|
+
<figure id='B1'>
|
1336
|
+
<name>Figure 1 — First</name>
|
1337
|
+
</figure>
|
1338
|
+
<example id='C1'>
|
1339
|
+
<name>EXAMPLE 1</name>
|
1340
|
+
<figure id='B2'>
|
1341
|
+
<name>Figure 2 — Second</name>
|
1342
|
+
</figure>
|
1343
|
+
</example>
|
1344
|
+
<example id='C2'>
|
1345
|
+
<name>EXAMPLE 2</name>
|
1346
|
+
<figure id='B4' unnumbered='true'>
|
1347
|
+
<name>Unnamed</name>
|
1348
|
+
</figure>
|
1349
|
+
</example>
|
1350
|
+
<figure id='B3'>
|
1351
|
+
<name>Figure 3 — Third</name>
|
1352
|
+
</figure>
|
1353
|
+
</clause>
|
1354
|
+
</sections>
|
1355
|
+
</iso-standard>
|
1356
|
+
OUTPUT
|
1357
|
+
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
|
1358
|
+
.convert("test", input, true))
|
1359
|
+
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))
|
1360
|
+
.to be_equivalent_to xmlpp(presxml)
|
1361
|
+
end
|
1362
|
+
|
1298
1363
|
private
|
1299
1364
|
|
1300
1365
|
def mock_symbols
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: emf2svg
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "<="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '1'
|
89
|
+
version: '1.3'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "<="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '1'
|
96
|
+
version: '1.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: mathml2asciimath
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|