asciidoctor-htmlbook 0.0.3 → 0.0.4

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
- SHA1:
3
- metadata.gz: 6253feaef2c1aaacf514ecbaa67d5f7f189d1220
4
- data.tar.gz: 95ffa7913b589d55699219f51e7161f13706102b
2
+ SHA256:
3
+ metadata.gz: 68420eba44be59d8ae3fea93a02d13416f5f18233c49c95438c6e381f6d19035
4
+ data.tar.gz: 75cad414ceefed3898346561a600ad8b8d7095e767a58f835f521276fc8b6394
5
5
  SHA512:
6
- metadata.gz: 4125934edc5ac7efcb26b54e674a01cb676180b41915056f0ddf2bc985357ec464af6322be24c1cbad755fbaba9545e3e5adca903a7d360bcf36a8c32cb24b93
7
- data.tar.gz: 3b156de47c90a083d28dc0677db2f0adae658df2888c357cee12feed2f95790511dc0045fe403a4fae902006a610fd5e41e29df9648f84b85a5c4d13a7dc5986
6
+ metadata.gz: 2c13ebcab599dac5a574b5e634d3fd562fb6b7ce933c0b69e6fccc3802a9057e2cbe1c867388d3cf80bf64b8d8943640c189e118933dccba30804a3e8798fdba
7
+ data.tar.gz: 8aa6a5ff99cdf3471c2c21416e099c0fc0b6e8cf0bf15bec4c69a324cedc763c5a7963e24c1ed22e45bb32a06987945ce85c5b4e7fa2c05937c83f3d5e36e989
@@ -1,5 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.3.3
4
+ - 2.4
5
+ - 2.5
6
+ - 2.6
5
7
  before_install: gem install bundler -v 1.13.7
@@ -0,0 +1,5 @@
1
+ == master
2
+
3
+ == v0.0.4
4
+
5
+ - Update to asciidoctor 2.0
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Rei
3
+ Copyright (c) 2019 Rei
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -21,11 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_runtime_dependency "asciidoctor", "~> 1.5"
25
- spec.add_runtime_dependency "thread_safe", "~> 0.3.5"
24
+ spec.add_runtime_dependency "asciidoctor", "~> 2.0"
26
25
  spec.add_runtime_dependency "liquid", "~> 4.0"
27
26
 
28
- spec.add_development_dependency "bundler", "~> 1.13"
27
+ spec.add_development_dependency "bundler", "~> 2.0"
29
28
  spec.add_development_dependency "rake", "~> 10.0"
30
29
  spec.add_development_dependency "minitest", "~> 5.0"
31
30
  end
@@ -68,12 +68,18 @@ module Asciidoctor
68
68
  'node_name' => node.node_name,
69
69
  'id' => node.id,
70
70
  'attributes' => node.attributes,
71
- 'document' => {
72
- 'references' => {
73
- 'ids' => node.document.references[:ids]
74
- },
75
- 'attributes' => node.document.attributes
76
- }
71
+ 'document' => document_info(node.document)
72
+ }
73
+ end
74
+
75
+ def document_info(document)
76
+ @document_info ||= {
77
+ 'references' => {
78
+ 'refs' => document.references[:refs].map { |refid, node|
79
+ [refid, { 'xreftext' => node.xreftext }]
80
+ }.to_h
81
+ },
82
+ 'attributes' => document.attributes
77
83
  }
78
84
  end
79
85
 
@@ -84,7 +90,8 @@ module Asciidoctor
84
90
  'caption' => node.caption,
85
91
  'captioned_title' => node.captioned_title,
86
92
  'style' => node.style,
87
- 'content' => node.content
93
+ 'content' => node.content,
94
+ 'xreftext' => node.xreftext
88
95
  })
89
96
  end
90
97
 
@@ -100,7 +107,7 @@ module Asciidoctor
100
107
  attributes = abstract_block_to_liquid(node).merge({
101
108
  'index' => node.index,
102
109
  'number' => node.number,
103
- 'sectname' => node.sectname,
110
+ 'sectname' => (node.sectname == 'section' ? "sect#{node.level}" : node.sectname),
104
111
  'special' => node.special,
105
112
  'numbered' => node.numbered,
106
113
  'sectnum' => node.sectnum
@@ -188,7 +195,8 @@ module Asciidoctor
188
195
  abstract_node_to_liquid(node).merge({
189
196
  'text' => node.text,
190
197
  'type' => node.type.to_s,
191
- 'target' => node.target
198
+ 'target' => node.target,
199
+ 'xreftext' => node.xreftext
192
200
  })
193
201
  end
194
202
  end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Htmlbook
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  <audio src="{{ node.attributes.target }}"
2
2
  controls="controls"
3
- {% if node.attributes.options contains 'autoplay' %}autoplay="autoplay"{% endif %}
4
- {% if node.attributes.options contains 'loop' %}loop="loop"{% endif %}>
3
+ {% if node.attributes.autoplay-option %}autoplay="autoplay"{% endif %}
4
+ {% if node.attributes.loop-option %}loop="loop"{% endif %}>
5
5
  <em>Sorry, the &lt;auido&gt; element not supported in your reading system.</em>
6
6
  </audio>
@@ -2,17 +2,17 @@
2
2
  {% when 'xref' %}
3
3
  {% if node.text %}
4
4
  <a data-type="xref" href="{{ node.target }}">{{ node.text }}</a>
5
- {% elsif node.document.references.ids[node.attributes.refid] %}
6
- <a data-type="xref" href="{{ node.target }}">{{ node.document.references.ids[node.attributes.refid] }}</a>
5
+ {% elsif node.document.references.refs[node.attributes.refid] %}
6
+ <a data-type="xref" href="{{ node.target }}">{{ node.document.references.refs[node.attributes.refid].xreftext }}</a>
7
7
  {% else %}
8
8
  <a data-type="xref" href="{{ node.target }}">[{{ node.attributes.refid }}]</a>
9
9
  {% endif %}
10
10
  {% when 'ref' %}
11
- <a id="{{ node.target }}"></a>
11
+ <a id="{{ node.id }}"></a>
12
12
  {% when 'link' %}
13
13
  <a href="{{ node.target }}"
14
14
  {% if node.attributes.title %}title="{{ node.attributes.title }}"{% endif %}
15
15
  {% if node.attributes.window %}target="{{ node.attributes.window }}"{% endif %} >{{ node.text }}</a>
16
16
  {% when 'bibref' %}
17
- <a id="{{ node.target }}"></a>[{{ node.target }}]
17
+ <a id="{{ node.id }}"></a>[{{ node.xreftext | default: node.id }}]
18
18
  {% endcase %}
@@ -3,7 +3,7 @@
3
3
  {% if node.attributes.width %}width="{{ node.attributes.width }}"{% endif %}
4
4
  {% if node.attributes.height %}height="{{ node.attributes.height }}"{% endif %}
5
5
  {% if node.attributes.poster %}poster="{{ node.attributes.poster }}"{% endif %}
6
- {% if node.attributes.options contains 'autoplay' %}autoplay="autoplay"{% endif %}
7
- {% if node.attributes.options contains 'loop' %}loop="loop"{% endif %}>
6
+ {% if node.attributes.autoplay-option %}autoplay="autoplay"{% endif %}
7
+ {% if node.attributes.loop-option %}loop="loop"{% endif %}>
8
8
  <em>Sorry, the &lt;video&gt; element not supported in your reading system.</em>
9
9
  </video>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-htmlbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-18 00:00:00.000000000 Z
11
+ date: 2019-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -16,28 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
27
- - !ruby/object:Gem::Dependency
28
- name: thread_safe
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.3.5
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.3.5
26
+ version: '2.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: liquid
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +44,14 @@ dependencies:
58
44
  requirements:
59
45
  - - "~>"
60
46
  - !ruby/object:Gem::Version
61
- version: '1.13'
47
+ version: '2.0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
- version: '1.13'
54
+ version: '2.0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: rake
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -105,9 +91,10 @@ extra_rdoc_files: []
105
91
  files:
106
92
  - ".gitignore"
107
93
  - ".travis.yml"
94
+ - CHANGELOG.adoc
108
95
  - CODE_OF_CONDUCT.md
109
96
  - Gemfile
110
- - LICENSE.txt
97
+ - LICENSE
111
98
  - README.adoc
112
99
  - Rakefile
113
100
  - asciidoctor-htmlbook.gemspec
@@ -169,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
156
  - !ruby/object:Gem::Version
170
157
  version: '0'
171
158
  requirements: []
172
- rubyforge_project:
173
- rubygems_version: 2.6.8
159
+ rubygems_version: 3.0.3
174
160
  signing_key:
175
161
  specification_version: 4
176
162
  summary: Asciidoctor HTMLBook is an Asciidoctor backend for converting AsciiDoc documents