isodoc 0.8.9 → 0.8.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3a4d3fa6c4156db3df86b058bd06ab31377db25525b066b42d1d1637480c1478
4
- data.tar.gz: 84b5d564ab0ed4a7424cd5f9f451843c9923d6b373bf0e8492a07fffbd4667b5
3
+ metadata.gz: 490b26d07e91c826370a8a6696812ef57d85a88922cc155cf9f8ca516222c8ba
4
+ data.tar.gz: 84e35c5302f47ed2d6df479c7294dd01b3077d6f279b5d3fd5a38e5dda414d70
5
5
  SHA512:
6
- metadata.gz: a8b910524ad0cbc147395e8f240523a2081841d59417fb88664058053eb6ed9a9adcc6eebe047d3d8d372c045841a292f1872f73a3336a0e8253a0ff0a9f7682
7
- data.tar.gz: b8d9bc5fa2af858c32e17df20f359fe6183dd740814b5b83e262a6c8b38d6fd6824fcee5ec5f40c67820c22cb737919c61b47263f74121d14ed9509d03ed1ade
6
+ metadata.gz: 21b930c00f572fac0367cc06e08c2c901981804e0829231d55e48917c09ee6752cd49f2950760f33d1921c1ea0ee521008fe4986023e984d45c1243c00b34c7f
7
+ data.tar.gz: 667364e6cb59e71c2c71188b5dd8e8cbefe1885dce1bd1f2aece10dfe7a53d830a08d326b9226f117d16afa5e58ee7cd9e81c2a93db071e44ede4b7bc9182504
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- isodoc (0.8.9)
4
+ isodoc (0.8.10)
5
5
  asciimath
6
6
  html2doc (~> 0.8.1)
7
7
  htmlentities (~> 4.3.4)
@@ -11,7 +11,7 @@ module IsoDoc::Function
11
11
  def iso_bibitem_ref_code(b)
12
12
  isocode = b.at(ns("./docidentifier")).text
13
13
  isodate = b.at(ns("./date[@type = 'published']"))
14
- iso_allparts = b.at(ns("./allParts"))
14
+ iso_allparts = b.at(ns("./allparts"))
15
15
  reference = docid_l10n(isocode)
16
16
  reference += ":#{date_range(isodate)}" if isodate
17
17
  reference += " (all parts)" if iso_allparts&.text == "true"
@@ -166,12 +166,13 @@ module IsoDoc::Function
166
166
  end
167
167
  end
168
168
 
169
- def format_ref(ref, isopub, date)
169
+ def format_ref(ref, isopub, date, allparts)
170
170
  if isopub
171
- return ref unless date
172
- on = date.at(ns("./on"))
173
- return ref if on&.text == "--"
174
- return ref + ":#{date_range(date)}"
171
+ if date
172
+ on = date.at(ns("./on"))
173
+ ref += on&.text == "--" ? ":--" : ":#{date_range(date)}"
174
+ ref += " (all parts)" if allparts
175
+ end
175
176
  end
176
177
  return "[#{ref}]" if /^\d+$/.match(ref) && !/^\[.*\]$/.match(ref)
177
178
  ref
@@ -182,7 +183,8 @@ module IsoDoc::Function
182
183
  docid = ref.at(ns("./docidentifier"))
183
184
  # return ref_names(ref) unless docid
184
185
  date = ref.at(ns("./date[@type = 'published']"))
185
- reference = format_ref(docid_l10n(docid.text), isopub, date)
186
+ allparts = ref.at(ns("./allparts"))
187
+ reference = format_ref(docid_l10n(docid.text), isopub, date, allparts)
186
188
  @anchors[ref["id"]] = { xref: reference }
187
189
  end
188
190
 
@@ -27,7 +27,7 @@ module IsoDoc::Function
27
27
  # is inserted before this CSS.
28
28
  def define_head(html, filename, _dir)
29
29
  html.head do |head|
30
- head.title { |t| t << filename }
30
+ #head.title { |t| t << filename }
31
31
  if @standardstylesheet
32
32
  head.style do |style|
33
33
  stylesheet = File.read(@standardstylesheet).
@@ -82,6 +82,7 @@ module IsoDoc::HtmlFunction
82
82
 
83
83
  def html_head()
84
84
  <<~HEAD.freeze
85
+ <title>{{ doctitle }}</title>
85
86
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
86
87
 
87
88
  <!--TOC script import-->
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "0.8.9".freeze
2
+ VERSION = "0.8.10".freeze
3
3
  end
@@ -37,9 +37,7 @@ RSpec.describe IsoDoc do
37
37
  </iso-standard>
38
38
  INPUT
39
39
  <html xmlns:epub="http://www.idpf.org/2007/ops">
40
- <head>
41
- <title>test</title>
42
- </head>
40
+ <head/>
43
41
  <body lang="EN-US" link="blue" vlink="#954F72">
44
42
  <div class="WordSection1">
45
43
  <p>&#160;</p>
@@ -197,9 +195,7 @@ INPUT
197
195
  </iso-standard>
198
196
  INPUT
199
197
  <html xmlns:epub="http://www.idpf.org/2007/ops">
200
- <head>
201
- <title>test</title>
202
- </head>
198
+ <head/>
203
199
  <body lang="EN-US" link="blue" vlink="#954F72">
204
200
  <div class="WordSection1">
205
201
  <p>&#160;</p>
@@ -286,9 +282,7 @@ INPUT
286
282
  </iso-standard>
287
283
  INPUT
288
284
  <html xmlns:epub="http://www.idpf.org/2007/ops">
289
- <head>
290
- <title>test</title>
291
- </head>
285
+ <head/>
292
286
  <body lang="EN-US" link="blue" vlink="#954F72">
293
287
  <div class="WordSection1">
294
288
  <p>&#160;</p>
@@ -575,9 +569,7 @@ World</p>
575
569
  </iso-standard>
576
570
  INPUT
577
571
  <html xmlns:epub="http://www.idpf.org/2007/ops">
578
- <head>
579
- <title>test</title>
580
- </head>
572
+ <head/>
581
573
  <body lang="EN-US" link="blue" vlink="#954F72">
582
574
  <div class="WordSection1">
583
575
  <p>&#160;</p>
@@ -59,9 +59,7 @@ RSpec.describe IsoDoc do
59
59
  </iso-standard>
60
60
  INPUT
61
61
  <html xmlns:epub="http://www.idpf.org/2007/ops">
62
- <head>
63
- <title>test</title>
64
- </head>
62
+ <head/>
65
63
  <body lang="EN-US" link="blue" vlink="#954F72">
66
64
  <div class="WordSection1">
67
65
  <p>&#160;</p>
@@ -194,9 +194,7 @@ RSpec.describe IsoDoc do
194
194
  </iso-standard>
195
195
  INPUT
196
196
  <html xmlns:epub="http://www.idpf.org/2007/ops">
197
- <head>
198
- <title>test</title>
199
- </head>
197
+ <head/>
200
198
  <body lang="EN-US" link="blue" vlink="#954F72">
201
199
  <div class="WordSection1">
202
200
  <p>&#160;</p>
@@ -6,6 +6,7 @@ RSpec.describe IsoDoc do
6
6
  system "rm -f test.html"
7
7
  IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css", filename: "test"}).convert("test", <<~"INPUT", false)
8
8
  <iso-standard xmlns="http://riboseinc.com/isoxml">
9
+ <title language="en">test</title>
9
10
  <preface><foreword>
10
11
  <note>
11
12
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">These results are based on a study carried out on three different types of kernel.</p>
@@ -15,7 +16,7 @@ RSpec.describe IsoDoc do
15
16
  INPUT
16
17
  expect(File.exist?("test.html")).to be true
17
18
  html = File.read("test.html")
18
- expect(html).to match(%r{<title>test</title><style>})
19
+ expect(html).to match(%r{<title>test</title>})
19
20
  expect(html).to match(/another empty stylesheet/)
20
21
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/2\.7\.1/MathJax\.js})
21
22
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
@@ -35,7 +36,7 @@ RSpec.describe IsoDoc do
35
36
  INPUT
36
37
  expect(File.exist?("test.html")).to be true
37
38
  html = File.read("test.html")
38
- expect(html).not_to match(%r{<title>test</title><style>})
39
+ expect(html).not_to match(%r{<title>test</title>})
39
40
  expect(html).not_to match(/another empty stylesheet/)
40
41
  expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/2\.7\.1/MathJax\.js})
41
42
  expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
@@ -158,7 +159,7 @@ RSpec.describe IsoDoc do
158
159
  expect(word).to match(/another empty stylesheet/)
159
160
  expect(word).to match(/font-family: Zapf/)
160
161
  expect(word).to match(/a third empty stylesheet/)
161
- expect(word).to match(/<title>test<\/title>/)
162
+ #expect(word).to match(/<title>test<\/title>/)
162
163
  expect(word).to match(/test_files\/header.html/)
163
164
  expect(word).to match(/an empty word cover page/)
164
165
  expect(word).to match(/an empty word intro page/)
@@ -181,7 +182,7 @@ RSpec.describe IsoDoc do
181
182
  expect(word).to match(/another empty stylesheet/)
182
183
  expect(word).to match(/font-family: Arial/)
183
184
  expect(word).to match(/a third empty stylesheet/)
184
- expect(word).to match(/<title>test<\/title>/)
185
+ #expect(word).to match(/<title>test<\/title>/)
185
186
  expect(word).to match(/test_files\/header.html/)
186
187
  expect(word).to match(/an empty word cover page/)
187
188
  expect(word).to match(/an empty word intro page/)
@@ -7,6 +7,7 @@ RSpec.describe IsoDoc do
7
7
  <preface><foreword>
8
8
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
9
9
  <eref bibitemid="ISO712"/>
10
+ <eref bibitemid="ISO16634"/>
10
11
  <eref bibitemid="ref1"/>
11
12
  <eref bibitemid="ref10"/>
12
13
  </p>
@@ -33,7 +34,7 @@ RSpec.describe IsoDoc do
33
34
  </organization>
34
35
  </contributor>
35
36
  <note format="text/plain" reference="1">ISO DATE: Under preparation. (Stage at the time of publication ISO/DIS 16634)</note>
36
- <allParts>true</allParts>
37
+ <allparts>true</allparts>
37
38
  </bibitem>
38
39
  <bibitem id="ISO20483" type="standard">
39
40
  <title format="text/plain">Cereals and pulses</title>
@@ -83,6 +84,7 @@ RSpec.describe IsoDoc do
83
84
  <h1 class="ForewordTitle">Foreword</h1>
84
85
  <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
85
86
  <a href="#ISO712">ISO 712</a>
87
+ <a href="#ISO16634">ISO 16634:-- (all parts)</a>
86
88
  <a href="#ref1">ICC 167</a>
87
89
  <a href="#ref10">[10]</a>
88
90
  </p>
@@ -218,9 +218,7 @@ OUTPUT
218
218
  </iso-standard>
219
219
  INPUT
220
220
  <html xmlns:epub="http://www.idpf.org/2007/ops">
221
- <head>
222
- <title>test</title>
223
- </head>
221
+ <head/>
224
222
  <body lang="EN-US" link="blue" vlink="#954F72">
225
223
  <div class="WordSection1">
226
224
  <p>&#160;</p>
@@ -181,9 +181,7 @@ RSpec.describe IsoDoc do
181
181
  </iso-standard>
182
182
  INPUT
183
183
  <html xmlns:epub="http://www.idpf.org/2007/ops">
184
- <head>
185
- <title>test</title>
186
- </head>
184
+ <head/>
187
185
  <body lang="EN-US" link="blue" vlink="#954F72">
188
186
  <div class="WordSection1">
189
187
  <p>&#160;</p>
data/spec/spec_helper.rb CHANGED
@@ -30,9 +30,7 @@ end
30
30
 
31
31
  HTML_HDR = <<~END
32
32
  <html xmlns:epub="http://www.idpf.org/2007/ops">
33
- <head>
34
- <title>test</title>
35
- </head>
33
+ <head/>
36
34
  <body lang="EN-US" link="blue" vlink="#954F72">
37
35
  <div class="title-section">
38
36
  <p>&#160;</p>
@@ -47,9 +45,7 @@ END
47
45
 
48
46
  WORD_HDR = <<~END
49
47
  <html xmlns:epub="http://www.idpf.org/2007/ops">
50
- <head>
51
- <title>test</title>
52
- </head>
48
+ <head/>
53
49
  <body lang="EN-US" link="blue" vlink="#954F72">
54
50
  <div class="WordSection1">
55
51
  <p>&#160;</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.8.9
4
+ version: 0.8.10
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-08-16 00:00:00.000000000 Z
11
+ date: 2018-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath