asciidoctor-iso 0.9.5 → 0.9.6

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
  SHA256:
3
- metadata.gz: 13f80a4e5e9ab950e49dd4bc484f0e1d1bbe5f55b593f49de60242b36fdc0a0b
4
- data.tar.gz: 4a90a72c5f48c2f4fdf6a8d2886255b1ea7e02402fbec9fb869719e56f4ace55
3
+ metadata.gz: de3b792b4a60d8da397a08e1dcc4f8afa083a91e6d25ce153b6eb61003c2f162
4
+ data.tar.gz: ef4b5b07410e3a865ee3657c7f5e0d01613c19edf854629a4b69416d6048cb5c
5
5
  SHA512:
6
- metadata.gz: a9b571864d2e7c2e38508699f6ce9138d935a6776b1e5645098cc2541430445132c0bf0424118f71a5412ee78a18a336a7d336541db7185bb2cc4f09cab3e703
7
- data.tar.gz: 7bd69063e480299905d44ff78c3e6480098555091ca897d3522ca499762f2d7803f9e29e3c0789e414af44c7a713779c3b96924d214b947c6fcf2f57450ecbf1
6
+ metadata.gz: 70a807f56e7516d3be9d3b9b93fc8c21965bc1c0aa5edd0ecda0262c1d992d8dbb5495b4b573c7da572bbdd93e5049b3fd14be1148bfc28c53aef5e89660b0aa
7
+ data.tar.gz: a79c9e5d0de76c3d183ef2d7d152f1853930b764f4b6a51dfec74cdabc63f6524a1b603edac7dba757b42799086ed8b7ab0548c5a3f9d83195c5b53b12d68c46
data/.travis.yml CHANGED
@@ -1,7 +1,13 @@
1
+ dist: trusty
1
2
  sudo: false
2
3
  language: ruby
3
4
  rvm:
4
- - 2.5.1
5
+ - 2.5
6
+ - 2.4
7
+ - ruby-head
5
8
  before_install:
6
9
  - gem install bundler -v 1.16.1
7
10
  - unset _JAVA_OPTIONS
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
data/Gemfile.lock CHANGED
@@ -1,22 +1,21 @@
1
1
  GIT
2
2
  remote: git://github.com/riboseinc/relaton.git
3
- revision: 19dac2282a606c97f2f25d3a6117fd3b84c344dd
3
+ revision: ce33a2874530a8f7bf438e26624d05a47526d346
4
4
  specs:
5
- relaton (0.0.1)
6
- asciidoctor (~> 1.5.7)
5
+ relaton (0.0.2)
7
6
  gbbib (~> 0.1.0)
8
7
  iev (~> 0.1.0)
9
- iso-bib-item (~> 0.1.6)
10
- isobib (~> 0.1.8)
8
+ isobib (~> 0.1.9)
11
9
  rfcbib (~> 0.1.0)
12
10
 
13
11
  PATH
14
12
  remote: .
15
13
  specs:
16
- asciidoctor-iso (0.9.4)
14
+ asciidoctor-iso (0.9.5)
17
15
  asciidoctor (~> 1.5.7)
18
16
  iev (~> 0.1.0)
19
17
  isodoc (>= 0.8)
18
+ relaton (~> 0.0.1)
20
19
  ruby-jing
21
20
 
22
21
  GEM
@@ -26,76 +25,20 @@ GEM
26
25
  httpclient (~> 2.8, >= 2.8.3)
27
26
  json (>= 1.5.1)
28
27
  asciidoctor (1.5.7.1)
29
- asciidoctor-csand (0.3.1)
30
- asciidoctor (~> 1.5.7)
31
- asciidoctor-iso (>= 0.9.0)
32
- asciimath
33
- htmlentities (~> 4.3.4)
34
- image_size
35
- isodoc (>= 0.8.0)
36
- mime-types
37
- nokogiri
38
- ruby-jing
39
- ruby-xslt
40
- thread_safe
41
- uuidtools
42
- asciidoctor-csd (0.4.1)
43
- asciidoctor-iso (>= 0.9.0)
44
- isodoc (>= 0.8.0)
45
- asciidoctor-gb (0.3.2)
46
- asciidoctor-iso (>= 0.9.0)
47
- gbbib
48
- isodoc (>= 0.8.0)
49
- twitter_cldr
50
- asciidoctor-m3d (0.3.2)
51
- asciidoctor (~> 1.5.7)
52
- asciidoctor-iso (>= 0.9.0)
53
- asciimath
54
- htmlentities (~> 4.3.4)
55
- image_size
56
- isodoc (>= 0.8.0)
57
- mime-types
58
- nokogiri
59
- ruby-jing
60
- ruby-xslt
61
- thread_safe
62
- uuidtools
63
- asciidoctor-rfc (0.9.0)
64
- asciidoctor (~> 1.5.7)
65
- htmlentities (~> 4.3.4)
66
- nokogiri
67
- ruby-jing
68
- thread_safe
69
- asciidoctor-rsd (0.3.1)
70
- asciidoctor (~> 1.5.7)
71
- asciidoctor-iso (>= 0.8.0)
72
- asciimath
73
- htmlentities (~> 4.3.4)
74
- image_size
75
- isodoc (>= 0.7.0)
76
- mime-types
77
- nokogiri
78
- ruby-jing
79
- ruby-xslt
80
- thread_safe
81
- uuidtools
82
28
  asciimath (1.0.4)
83
29
  ast (2.4.0)
84
30
  byebug (9.1.0)
85
- camertron-eprun (1.1.1)
86
- cldr-plurals-runtime-rb (1.0.1)
87
31
  cnccs (0.1.1)
88
32
  coderay (1.1.2)
89
33
  diff-lcs (1.3)
90
34
  docile (1.3.1)
91
- duplicate (1.1.1)
92
35
  equivalent-xml (0.6.0)
93
36
  nokogiri (>= 1.4.3)
94
37
  ffi (1.9.25)
95
38
  formatador (0.2.5)
96
- gbbib (0.1.4)
97
- cnccs
98
- iso-bib-item
39
+ gbbib (0.1.5)
40
+ cnccs (~> 0.1.1)
41
+ iso-bib-item (~> 0.1.10)
99
42
  guard (2.14.2)
100
43
  formatador (>= 0.2.4)
101
44
  listen (>= 2.7, < 4.0)
@@ -110,7 +53,7 @@ GEM
110
53
  guard (~> 2.1)
111
54
  guard-compat (~> 1.1)
112
55
  rspec (>= 2.99.0, < 4.0)
113
- html2doc (0.8.0)
56
+ html2doc (0.8.2)
114
57
  asciimath
115
58
  htmlentities (~> 4.3.4)
116
59
  image_size
@@ -124,20 +67,18 @@ GEM
124
67
  iev (0.1.0)
125
68
  nokogiri
126
69
  image_size (2.0.0)
127
- iso-bib-item (0.1.10)
128
- duplicate (~> 1.1.1)
70
+ iso-bib-item (0.1.11)
129
71
  isoics (~> 0.1.6)
130
- nokogiri
131
- isobib (0.1.9)
72
+ nokogiri (~> 1.8.4)
73
+ ruby_deep_clone (~> 0.8.0)
74
+ isobib (0.1.10)
132
75
  algoliasearch
133
76
  iso-bib-item (~> 0.1.10)
134
- isodoc (0.8.1)
77
+ isodoc (0.8.4)
135
78
  asciimath
136
- html2doc (>= 0.7.1)
79
+ html2doc (~> 0.8.1)
137
80
  htmlentities (~> 4.3.4)
138
- image_size
139
81
  liquid
140
- mime-types
141
82
  nokogiri
142
83
  roman-numerals
143
84
  ruby-xslt
@@ -153,15 +94,7 @@ GEM
153
94
  rb-inotify (~> 0.9, >= 0.9.7)
154
95
  ruby_dep (~> 1.2)
155
96
  lumberjack (1.0.13)
156
- metanorma (0.2.5)
157
- asciidoctor-csand (>= 0.3.0)
158
- asciidoctor-csd (>= 0.4.0)
159
- asciidoctor-gb (>= 0.3.0)
160
- asciidoctor-iso (>= 0.9.1)
161
- asciidoctor-m3d (>= 0.3.1)
162
- asciidoctor-rfc (>= 0.9.0)
163
- asciidoctor-rsd (>= 0.3.0)
164
- isodoc (>= 0.8.0)
97
+ metanorma (0.2.6)
165
98
  method_source (0.9.0)
166
99
  mime-types (3.1)
167
100
  mime-types-data (~> 3.2015)
@@ -175,7 +108,7 @@ GEM
175
108
  shellany (~> 0.0)
176
109
  optout (0.0.2)
177
110
  parallel (1.12.1)
178
- parser (2.5.1.0)
111
+ parser (2.5.1.2)
179
112
  ast (~> 2.4.0)
180
113
  powerpack (0.1.2)
181
114
  pry (0.11.3)
@@ -202,10 +135,10 @@ GEM
202
135
  diff-lcs (>= 1.2.0, < 2.0)
203
136
  rspec-support (~> 3.7.0)
204
137
  rspec-support (3.7.1)
205
- rubocop (0.57.2)
138
+ rubocop (0.58.1)
206
139
  jaro_winkler (~> 1.5.1)
207
140
  parallel (~> 1.10)
208
- parser (>= 2.5)
141
+ parser (>= 2.5, != 2.5.1.1)
209
142
  powerpack (~> 0.1)
210
143
  rainbow (>= 2.2.2, < 4.0)
211
144
  ruby-progressbar (~> 1.7)
@@ -214,6 +147,7 @@ GEM
214
147
  optout (>= 0.0.2)
215
148
  ruby-progressbar (1.9.0)
216
149
  ruby-xslt (0.9.10)
150
+ ruby_deep_clone (0.8.0)
217
151
  ruby_dep (1.5.0)
218
152
  sass (3.5.6)
219
153
  sass-listen (~> 4.0.0)
@@ -229,12 +163,6 @@ GEM
229
163
  thor (0.20.0)
230
164
  thread_safe (0.3.6)
231
165
  timecop (0.9.1)
232
- twitter_cldr (4.4.3)
233
- camertron-eprun
234
- cldr-plurals-runtime-rb (~> 1.0)
235
- tzinfo
236
- tzinfo (1.2.5)
237
- thread_safe (~> 0.1)
238
166
  unicode-display_width (1.4.0)
239
167
  uuidtools (2.1.5)
240
168
 
@@ -248,7 +176,7 @@ DEPENDENCIES
248
176
  equivalent-xml (~> 0.6)
249
177
  guard (~> 2.14)
250
178
  guard-rspec (~> 4.7)
251
- metanorma (~> 0.2.5)
179
+ metanorma (~> 0.2.6)
252
180
  rake (~> 12.0)
253
181
  relaton!
254
182
  rspec (~> 3.6)
data/README.adoc CHANGED
@@ -440,6 +440,18 @@ applicable to other products derived from rice, nor to waxy rice (glutinous rice
440
440
  _____
441
441
  --
442
442
 
443
+ === Image size
444
+
445
+ The value `auto` is accepted for image width and height attributes. It is only passed on
446
+ to HTML output; if the output is to Word, both the width and height attributes are stripped
447
+ from the image.
448
+
449
+ [source,asciidoctor]
450
+ --
451
+ [height=90,width=auto]
452
+ image::logo.jpg
453
+ --
454
+
443
455
  === Features not visible in HTML preview
444
456
 
445
457
  The gem uses built-in Asciidoc formatting as much as possible, so that users
@@ -43,5 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency "rubocop", "~> 0.50"
44
44
  spec.add_development_dependency "simplecov", "~> 0.15"
45
45
  spec.add_development_dependency "timecop", "~> 0.9"
46
- spec.add_development_dependency "metanorma", "~> 0.2.5"
46
+ spec.add_development_dependency "metanorma", "~> 0.2.6"
47
47
  end
@@ -124,8 +124,8 @@ module Asciidoctor
124
124
  { src: uri,
125
125
  id: Utils::anchor_or_uuid,
126
126
  imagetype: types.first.sub_type.upcase,
127
- height: node.attr("height"),
128
- width: node.attr("width") }
127
+ height: node.attr("height") || "auto",
128
+ width: node.attr("width") || "auto" }
129
129
  end
130
130
 
131
131
  def figure_title(node, f)
@@ -33,16 +33,20 @@ module Asciidoctor
33
33
  c = matched.nil? ? node.text : matched[:text]
34
34
  t = node.target.gsub(/^#/, "").gsub(%r{(.)(\.xml)?#.*$}, "\\1")
35
35
  noko do |xml|
36
- xml.xref c, **attr_code(target: t, type: f)
36
+ xml.xref **attr_code(target: t, type: f) do |x|
37
+ x << c
38
+ end
37
39
  end.join
38
40
  end
39
41
 
40
42
  def inline_anchor_link(node)
41
43
  contents = node.text
42
- contents = nil if node.target.gsub(%r{^mailto:}, "") == node.text
44
+ contents = "" if node.target.gsub(%r{^mailto:}, "") == node.text
43
45
  attributes = { "target": node.target }
44
46
  noko do |xml|
45
- xml.link contents, **attr_code(attributes)
47
+ xml.link **attr_code(attributes) do |l|
48
+ l << contents
49
+ end
46
50
  end.join
47
51
  end
48
52
 
@@ -51,7 +55,9 @@ module Asciidoctor
51
55
  eref_attributes = { id: node.target }
52
56
  @refids << node.target
53
57
  noko do |xml|
54
- xml.ref eref_contents, **attr_code(eref_attributes)
58
+ xml.ref **attr_code(eref_attributes) do |r|
59
+ r << eref_contents
60
+ end
55
61
  end.join
56
62
  end
57
63
 
@@ -888,12 +888,18 @@
888
888
  </attribute>
889
889
  <optional>
890
890
  <attribute name="width">
891
- <data type="int"/>
891
+ <choice>
892
+ <data type="int"/>
893
+ <value>auto</value>
894
+ </choice>
892
895
  </attribute>
893
896
  </optional>
894
897
  <optional>
895
898
  <attribute name="height">
896
- <data type="int"/>
899
+ <choice>
900
+ <data type="int"/>
901
+ <value>auto</value>
902
+ </choice>
897
903
  </attribute>
898
904
  </optional>
899
905
  </element>
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module ISO
3
- VERSION = "0.9.5".freeze
3
+ VERSION = "0.9.6".freeze
4
4
  end
5
5
  end
@@ -310,6 +310,23 @@ RSpec.describe Asciidoctor::ISO do
310
310
  OUTPUT
311
311
  end
312
312
 
313
+ it "accepts auto for width and height attributes on images" do
314
+ expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
315
+ #{ASCIIDOC_BLANK_HDR}
316
+ [height=4,width=auto]
317
+ image::spec/examples/rice_images/rice_image1.png[]
318
+
319
+ INPUT
320
+ #{BLANK_HDR}
321
+ <sections>
322
+ <figure id="_">
323
+ <image src="spec/examples/rice_images/rice_image1.png" id="_" imagetype="PNG" height="4" width="auto"/>
324
+ </figure>
325
+ </sections>
326
+ </iso-standard>
327
+ OUTPUT
328
+ end
329
+
313
330
  it "accepts alignment attribute on paragraphs" do
314
331
  expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
315
332
  #{ASCIIDOC_BLANK_HDR}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
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-07-07 00:00:00.000000000 Z
11
+ date: 2018-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 0.2.5
229
+ version: 0.2.6
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 0.2.5
236
+ version: 0.2.6
237
237
  description: |
238
238
  asciidoctor-iso lets you write ISO standards in AsciiDoc syntax.
239
239