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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20de1f2b7084af74fa5e07dd9d21052070c0cb0c
4
- data.tar.gz: f0a33338a94281fcd77c4c0c2c09ba075a168db9
3
+ metadata.gz: 7a7fb588c2cd94be127021423d9c305e31913882
4
+ data.tar.gz: 1f154acf56aefcdc36af96802ad9dcd7cb2d7006
5
5
  SHA512:
6
- metadata.gz: b3ba4475aad7370d08dbb82125824181ce72aff52fcfabbdf04573b33de614424f3774e26e1baca1fdc8751312ed0905ca0eaff09ec53e3697c0178ef8b8614a
7
- data.tar.gz: bb14792e1617a7ef072d797042c538ebbfb3a678af20966edd8b531b747b24e03d42ae65bf15498b584db9c23948b52d1b0bcde16943597da8ba90aed469aef1
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, dt, dd, ol, ul, li,
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, dt, dd, ol, ul, li,
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,
@@ -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
- ret = from.text
73
- ret += "–#{to.text}" if to
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
 
@@ -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" : nil }
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.at(ns('./title')).text}" }
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")) || b.at(ns("./title"))
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
- from = date.at(ns("./from"))
153
- return ref if from&.text == "--"
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
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.6.1".freeze
2
+ VERSION = "0.6.2".freeze
3
3
  end
@@ -577,7 +577,7 @@ RSpec.describe IsoDoc do
577
577
  <div>
578
578
  <h1>2.&#160; &#35268;&#33539;&#24615;&#24341;&#29992;&#25991;&#20214;</h1>
579
579
  <p>&#19979;&#21015;&#25991;&#20214;&#23545;&#20110;&#26412;&#25991;&#20214;&#30340;&#24212;&#29992;&#26159;&#24517;&#19981;&#21487;&#23569;&#30340;&#12290; &#20961;&#26159;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20165;&#27880;&#26085;&#26399;&#30340;&#29256;&#26412;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290; &#20961;&#26159;&#19981;&#27880;&#26085;&#26399;&#30340;&#24341;&#29992;&#25991;&#20214;&#65292;&#20854;&#26368;&#26032;&#29256;&#26412;&#65288;&#21253;&#25324;&#25152;&#26377;&#30340;&#20462;&#25913;&#21333;&#65289;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</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.&#160; &#26415;&#35821;&#21644;&#23450;&#20041;</h1><p>&#19979;&#21015;&#26415;&#35821;&#21644;&#23450;&#20041;&#36866;&#29992;&#20110;&#26412;&#25991;&#20214;&#12290;</p>
583
583
  <p>ISO&#21644;IEC&#29992;&#20110;&#26631;&#20934;&#21270;&#30340;&#26415;&#35821;&#25968;&#25454;&#24211;&#22320;&#22336;&#22914;&#19979;&#65306;</p>
@@ -182,7 +182,7 @@ RSpec.describe IsoDoc do
182
182
  <div>
183
183
  <h1>1.&#160; 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.&#160; 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"><from>2011</from></date>
24
- <date type="accessed"><from>2012</from></date>
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"><from>2013</from></date>
27
- <date type="obsoleted"><from>2014</from></date>
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>
@@ -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"><from>--</from></date>
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.&#160; 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&#8211;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&#8211;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/>
@@ -416,7 +416,7 @@ OUTPUT
416
416
  <div>
417
417
  <h1>1.&#160; 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.&#160; 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.&#160; 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.&#160; 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.1
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-05-22 00:00:00.000000000 Z
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.12
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.