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 +5 -5
- data/.travis.yml +3 -1
- data/CHANGELOG.adoc +5 -0
- data/{LICENSE.txt → LICENSE} +1 -1
- data/asciidoctor-htmlbook.gemspec +2 -3
- data/lib/asciidoctor/htmlbook/converter.rb +17 -9
- data/lib/asciidoctor/htmlbook/version.rb +1 -1
- data/templates/audio.html +2 -2
- data/templates/inline_anchor.html +4 -4
- data/templates/video.html +2 -2
- metadata +9 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 68420eba44be59d8ae3fea93a02d13416f5f18233c49c95438c6e381f6d19035
|
4
|
+
data.tar.gz: 75cad414ceefed3898346561a600ad8b8d7095e767a58f835f521276fc8b6394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c13ebcab599dac5a574b5e634d3fd562fb6b7ce933c0b69e6fccc3802a9057e2cbe1c867388d3cf80bf64b8d8943640c189e118933dccba30804a3e8798fdba
|
7
|
+
data.tar.gz: 8aa6a5ff99cdf3471c2c21416e099c0fc0b6e8cf0bf15bec4c69a324cedc763c5a7963e24c1ed22e45bb32a06987945ce85c5b4e7fa2c05937c83f3d5e36e989
|
data/.travis.yml
CHANGED
data/CHANGELOG.adoc
ADDED
data/{LICENSE.txt → LICENSE}
RENAMED
@@ -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", "~>
|
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", "~>
|
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
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
data/templates/audio.html
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<audio src="{{ node.attributes.target }}"
|
2
2
|
controls="controls"
|
3
|
-
{% if node.attributes.
|
4
|
-
{% if node.attributes.
|
3
|
+
{% if node.attributes.autoplay-option %}autoplay="autoplay"{% endif %}
|
4
|
+
{% if node.attributes.loop-option %}loop="loop"{% endif %}>
|
5
5
|
<em>Sorry, the <auido> 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.
|
6
|
-
<a data-type="xref" href="{{ node.target }}">{{ node.document.references.
|
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.
|
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.
|
17
|
+
<a id="{{ node.id }}"></a>[{{ node.xreftext | default: node.id }}]
|
18
18
|
{% endcase %}
|
data/templates/video.html
CHANGED
@@ -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.
|
7
|
-
{% if node.attributes.
|
6
|
+
{% if node.attributes.autoplay-option %}autoplay="autoplay"{% endif %}
|
7
|
+
{% if node.attributes.loop-option %}loop="loop"{% endif %}>
|
8
8
|
<em>Sorry, the <video> 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.
|
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:
|
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: '
|
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: '
|
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: '
|
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: '
|
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
|
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
|
-
|
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
|