isodoc 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/iso/html/style-human.scss +1 -1
- data/lib/isodoc/iso/html/style-iso.scss +1 -1
- data/lib/isodoc/metadata.rb +4 -2
- data/lib/isodoc/references.rb +12 -6
- data/lib/isodoc/section.rb +2 -2
- data/lib/isodoc/version.rb +1 -1
- data/spec/isodoc/i18n_spec.rb +1 -1
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/metadata_spec.rb +4 -4
- data/spec/isodoc/ref_spec.rb +4 -4
- data/spec/isodoc/section_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a7fb588c2cd94be127021423d9c305e31913882
|
4
|
+
data.tar.gz: 1f154acf56aefcdc36af96802ad9dcd7cb2d7006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8768dce3f8c6ea4f225365ade7db7181dfc68be9b68b4549984ea05df7e8be4cb8b930a231f0ce3f7fbf677c15dca1f32adb848e62067003c97af34aa369875
|
7
|
+
data.tar.gz: bc3861437b9b9b4e1db77bbd3ec2be1dded5e5f81a7a8abdab630bbef417635855a78e3e627f959dece89e0d5a18ddce166fb8479f7eabfe55bd8eb795da5858
|
@@ -47,7 +47,7 @@ a, abbr, acronym, address, big, cite, code,
|
|
47
47
|
del, dfn, em, img, ins, kbd, q, s, samp,
|
48
48
|
small, strike, strong, tt, var,
|
49
49
|
b, u, i, center,
|
50
|
-
dl,
|
50
|
+
dl, dd, ol, ul, li,
|
51
51
|
fieldset, form, label, legend,
|
52
52
|
table, caption, tbody, tfoot, thead, tr, th, td,
|
53
53
|
article, aside, canvas, details, embed,
|
@@ -47,7 +47,7 @@ a, abbr, acronym, address, big, cite, code,
|
|
47
47
|
del, dfn, em, img, ins, kbd, q, s, samp,
|
48
48
|
small, strike, strong, tt, var,
|
49
49
|
b, u, i, center,
|
50
|
-
dl,
|
50
|
+
dl, dd, ol, ul, li,
|
51
51
|
fieldset, form, label, legend,
|
52
52
|
table, caption, tbody, tfoot, thead, tr, th, td,
|
53
53
|
article, aside, canvas, details, embed,
|
data/lib/isodoc/metadata.rb
CHANGED
@@ -69,8 +69,10 @@ module IsoDoc
|
|
69
69
|
def date_range(date)
|
70
70
|
from = date.at(ns("./from"))
|
71
71
|
to = date.at(ns("./to"))
|
72
|
-
|
73
|
-
|
72
|
+
on = date.at(ns("./on"))
|
73
|
+
return on.text if on
|
74
|
+
ret = "#{from.text}–"
|
75
|
+
ret += to.text if to
|
74
76
|
ret
|
75
77
|
end
|
76
78
|
|
data/lib/isodoc/references.rb
CHANGED
@@ -22,7 +22,13 @@ module IsoDoc
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def iso_bibitem_entry_attrs(b, biblio)
|
25
|
-
{ id: b["id"], class: biblio ? "Biblio" :
|
25
|
+
{ id: b["id"], class: biblio ? "Biblio" : "NormRef" }
|
26
|
+
end
|
27
|
+
|
28
|
+
def iso_title(b)
|
29
|
+
title = b.at(ns("./title[@language = '#{@language}']"))
|
30
|
+
title = b.at(ns("./title")) unless title
|
31
|
+
title.text
|
26
32
|
end
|
27
33
|
|
28
34
|
def iso_bibitem_entry(list, b, ordinal, biblio)
|
@@ -34,7 +40,7 @@ module IsoDoc
|
|
34
40
|
ref << iso_bibitem_ref_code(b)
|
35
41
|
date_note_process(b, ref)
|
36
42
|
ref << ", "
|
37
|
-
ref.i { |i| i << " #{b
|
43
|
+
ref.i { |i| i << " #{iso_title(b)}" }
|
38
44
|
end
|
39
45
|
end
|
40
46
|
|
@@ -50,7 +56,8 @@ module IsoDoc
|
|
50
56
|
end
|
51
57
|
|
52
58
|
def reference_format(b, r)
|
53
|
-
title = b.at(ns("./formattedref")) ||
|
59
|
+
title = b.at(ns("./formattedref")) ||
|
60
|
+
b.at(ns("./title[@language = '#{@language}']")) || b.at(ns("./title"))
|
54
61
|
title&.children&.each { |n| parse(n, r) }
|
55
62
|
end
|
56
63
|
|
@@ -149,8 +156,8 @@ module IsoDoc
|
|
149
156
|
def format_ref(ref, isopub, date)
|
150
157
|
if isopub
|
151
158
|
return ref unless date
|
152
|
-
|
153
|
-
return ref if
|
159
|
+
on = date.at(ns("./on"))
|
160
|
+
return ref if on&.text == "--"
|
154
161
|
return ref + ": #{date_range(date)}"
|
155
162
|
end
|
156
163
|
return "[#{ref}]" if /^\d+$/.match?(ref) && !/^\[.*\]$/.match?(ref)
|
@@ -163,7 +170,6 @@ module IsoDoc
|
|
163
170
|
# return ref_names(ref) unless docid
|
164
171
|
date = ref.at(ns("./date[@type = 'published']"))
|
165
172
|
reference = format_ref(docid_l10n(docid.text), isopub, date)
|
166
|
-
# reference += ": #{date_range(date)}" if date && isopub && from.text != "--"
|
167
173
|
@anchors[ref["id"]] = { xref: reference }
|
168
174
|
end
|
169
175
|
|
data/lib/isodoc/section.rb
CHANGED
@@ -103,7 +103,7 @@ module IsoDoc
|
|
103
103
|
@internal_external_terms_boilerplate.gsub(/%/, sources)
|
104
104
|
end
|
105
105
|
|
106
|
-
def term_defs_boilerplate(div, source, term)
|
106
|
+
def term_defs_boilerplate(div, source, term, preface)
|
107
107
|
if source.empty? && term.nil?
|
108
108
|
div << @no_terms_boilerplate
|
109
109
|
else
|
@@ -138,7 +138,7 @@ module IsoDoc
|
|
138
138
|
num = num + 1
|
139
139
|
clause_name("#{num}.", terms_defs_title(f), div, nil)
|
140
140
|
term_defs_boilerplate(div, isoxml.xpath(ns(".//termdocsource")),
|
141
|
-
f.at(ns(".//term")))
|
141
|
+
f.at(ns(".//term")), f.at(ns("./p")))
|
142
142
|
f.elements.each do |e|
|
143
143
|
parse(e, div) unless %w{title source}.include? e.name
|
144
144
|
end
|
data/lib/isodoc/version.rb
CHANGED
data/spec/isodoc/i18n_spec.rb
CHANGED
@@ -577,7 +577,7 @@ RSpec.describe IsoDoc do
|
|
577
577
|
<div>
|
578
578
|
<h1>2.  规范性引用文件</h1>
|
579
579
|
<p>下列文件对于本文件的应用是必不可少的。 凡是注日期的引用文件,仅注日期的版本适用于本文件。 凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。</p>
|
580
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
|
580
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
581
581
|
</div>
|
582
582
|
<div id="H"><h1>3.  术语和定义</h1><p>下列术语和定义适用于本文件。</p>
|
583
583
|
<p>ISO和IEC用于标准化的术语数据库地址如下:</p>
|
data/spec/isodoc/inline_spec.rb
CHANGED
@@ -182,7 +182,7 @@ RSpec.describe IsoDoc do
|
|
182
182
|
<div>
|
183
183
|
<h1>1.  Normative References</h1>
|
184
184
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
185
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
|
185
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
186
186
|
</div>
|
187
187
|
</div>
|
188
188
|
</body>
|
@@ -245,7 +245,7 @@ RSpec.describe IsoDoc do
|
|
245
245
|
<div>
|
246
246
|
<h1>1.  Normative References</h1>
|
247
247
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
248
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
|
248
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
249
249
|
</div>
|
250
250
|
</div>
|
251
251
|
</body>
|
@@ -20,11 +20,11 @@ RSpec.describe IsoDoc do
|
|
20
20
|
<project-number part="1">17301</project-number>
|
21
21
|
<tc-document-number>17301</tc-document-number>
|
22
22
|
</docidentifier>
|
23
|
-
<date type="published"><
|
24
|
-
<date type="accessed"><
|
23
|
+
<date type="published"><on>2011</on></date>
|
24
|
+
<date type="accessed"><on>2012</on></date>
|
25
25
|
<date type="created"><from>2010</from><to>2011</to></date>
|
26
|
-
<date type="activated"><
|
27
|
-
<date type="obsoleted"><
|
26
|
+
<date type="activated"><on>2013</on></date>
|
27
|
+
<date type="obsoleted"><on>2014</on></date>
|
28
28
|
<contributor>
|
29
29
|
<role type="author"/>
|
30
30
|
<organization>
|
data/spec/isodoc/ref_spec.rb
CHANGED
@@ -25,7 +25,7 @@ RSpec.describe IsoDoc do
|
|
25
25
|
<bibitem id="ISO16634" type="standard">
|
26
26
|
<title format="text/plain">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</title>
|
27
27
|
<docidentifier>ISO 16634:All Parts</docidentifier>
|
28
|
-
<date type="published"><
|
28
|
+
<date type="published"><on>--</on></date>
|
29
29
|
<contributor>
|
30
30
|
<role type="publisher"/>
|
31
31
|
<organization>
|
@@ -90,9 +90,9 @@ RSpec.describe IsoDoc do
|
|
90
90
|
<div>
|
91
91
|
<h1>1.  Normative References</h1>
|
92
92
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
93
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products</i></p>
|
94
|
-
<p id="ISO16634">ISO 16634:All Parts: --<a rel="footnote" href="#fn:1" epub:type="footnote"><sup>1</sup></a>, <i> Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
|
95
|
-
<p id="ISO20483">ISO 20483: 2013–2014, <i> Cereals and pulses</i></p>
|
93
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products</i></p>
|
94
|
+
<p id="ISO16634" class="NormRef">ISO 16634:All Parts: --<a rel="footnote" href="#fn:1" epub:type="footnote"><sup>1</sup></a>, <i> Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i></p>
|
95
|
+
<p id="ISO20483" class="NormRef">ISO 20483: 2013–2014, <i> Cereals and pulses</i></p>
|
96
96
|
<p id="ref1" class="Biblio">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
|
97
97
|
</div>
|
98
98
|
<br/>
|
data/spec/isodoc/section_spec.rb
CHANGED
@@ -416,7 +416,7 @@ OUTPUT
|
|
416
416
|
<div>
|
417
417
|
<h1>1.  Normative References</h1>
|
418
418
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
419
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method</i></p>
|
419
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method</i></p>
|
420
420
|
</div>
|
421
421
|
<div id="H"><h1>2.  Terms and Definitions</h1><p>For the purposes of this document, the terms and definitions
|
422
422
|
given in ISO 712 and the following apply.</p>
|
@@ -481,7 +481,7 @@ OUTPUT
|
|
481
481
|
<div>
|
482
482
|
<h1>1.  Normative References</h1>
|
483
483
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
484
|
-
<p id="ISO712">ISO 712, <i> Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method</i></p>
|
484
|
+
<p id="ISO712" class="NormRef">ISO 712, <i> Cereals and cereal products?~@~I?~@~T?~@~IDetermination of moisture content?~@~I?~@~T?~@~IReference method</i></p>
|
485
485
|
</div>
|
486
486
|
<div id="H"><h1>2.  Terms and Definitions</h1><p>For the purposes of this document,
|
487
487
|
the terms and definitions given in ISO 712, ISO 712 and ISO 712 apply.</p>
|
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: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -429,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
429
429
|
version: '0'
|
430
430
|
requirements: []
|
431
431
|
rubyforge_project:
|
432
|
-
rubygems_version: 2.6.
|
432
|
+
rubygems_version: 2.6.14
|
433
433
|
signing_key:
|
434
434
|
specification_version: 4
|
435
435
|
summary: Convert documents in IsoDoc into Word and HTML in AsciiDoc.
|