asciidoctor-htmlbook 0.0.5 → 0.0.6
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 +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.adoc +6 -0
- data/lib/asciidoctor/htmlbook/converter.rb +6 -6
- data/lib/asciidoctor/htmlbook/version.rb +1 -1
- data/templates/admonition.html +1 -1
- data/templates/audio.html +2 -1
- data/templates/colist.html +1 -1
- data/templates/dlist.html +1 -1
- data/templates/document.html +14 -2
- data/templates/embedded.html +13 -1
- data/templates/example.html +1 -1
- data/templates/image.html +1 -1
- data/templates/listing.html +1 -1
- data/templates/literal.html +1 -1
- data/templates/olist.html +1 -1
- data/templates/paragraph.html +1 -1
- data/templates/preamble.html +1 -1
- data/templates/quote.html +1 -1
- data/templates/stem.html +1 -1
- data/templates/table.html +1 -1
- data/templates/ulist.html +1 -1
- data/templates/verse.html +1 -1
- data/templates/video.html +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1b2813a5e3da56201a661fc6c80aecc9fa45ae21a244a54f38355f76c1cadc6
|
4
|
+
data.tar.gz: ede7d28533940663055d38fd49af004e6d7f0337a4d3ef02668b1436bea8ec67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7438d871f950ae8b87f48e325e36464fc4da40f00eccae703d7a7b6412d8da89489a0d1ec279d0d9949227c902c5866810761ff76476b4a65ad392a30fa01b4
|
7
|
+
data.tar.gz: 07ce39b8e15869c78add96ad11c2fdfe579823f4e8e2f3cebb34f6aee116689978a4f3287e0c92791a50e8a887f5461ed87f63d7b7961292b82bb60eabb3bb22
|
data/.travis.yml
CHANGED
data/CHANGELOG.adoc
CHANGED
@@ -8,7 +8,7 @@ module Asciidoctor
|
|
8
8
|
def initialize(backend, options = {})
|
9
9
|
super
|
10
10
|
init_backend_traits outfilesuffix: '.html'
|
11
|
-
@template_dirs = (options[:template_dirs] || []).
|
11
|
+
@template_dirs = (options[:template_dirs] || []).unshift(DEFAULT_TEMPLATE_PATH)
|
12
12
|
@templates = {}
|
13
13
|
end
|
14
14
|
|
@@ -77,12 +77,12 @@ module Asciidoctor
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def document_to_hash(node)
|
80
|
+
title = node.attributes['doctitle'] && node.doctitle(partition: true)
|
80
81
|
abstract_block_to_hash(node).merge!({
|
81
|
-
'
|
82
|
-
|
83
|
-
|
84
|
-
'
|
85
|
-
'toc' => outline(node)
|
82
|
+
'title' => title&.main,
|
83
|
+
'subtitle' => title&.subtitle,
|
84
|
+
'outline' => outline(node),
|
85
|
+
'authors' => node.authors.map { |author| author.to_h.map { |key, value| [key.to_s, value] }.to_h }
|
86
86
|
})
|
87
87
|
end
|
88
88
|
|
data/templates/admonition.html
CHANGED
data/templates/audio.html
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
<audio
|
1
|
+
<audio {% if node.id %}id="{{ node.id }}"{% endif %}
|
2
|
+
src="{{ node.attributes.target }}"
|
2
3
|
controls="controls"
|
3
4
|
{% if node.attributes.autoplay-option %}autoplay="autoplay"{% endif %}
|
4
5
|
{% if node.attributes.loop-option %}loop="loop"{% endif %}>
|
data/templates/colist.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<ul data-type="colist">
|
1
|
+
<ul {% if node.id %}id="{{ node.id }}"{% endif %} data-type="colist">
|
2
2
|
{% for item in node.items %}
|
3
3
|
<li>
|
4
4
|
<a data-type="callout" id="colist-{{ item.attributes.coids }}" href="#callout-{{ item.attributes.coids }}">{{ item.attributes.coids | split: '-' | last }}</a>
|
data/templates/dlist.html
CHANGED
data/templates/document.html
CHANGED
@@ -5,13 +5,25 @@
|
|
5
5
|
{% if node.title %}<title>{{ node.title }}</title>{% endif %}
|
6
6
|
</head>
|
7
7
|
<body data-type="book">
|
8
|
-
{% if node.title %}
|
8
|
+
{% if node.title %}
|
9
|
+
{% if node.subtitle or node.anthors.size > 0 %}<header>{% endif %}
|
10
|
+
<h1>{{ node.title }}</h1>
|
11
|
+
{% if node.subtitle %}<p data-type="subtitle">{{ node.subtitle }}</p>{% endif %}
|
12
|
+
{% if node.authors.size > 0 %}
|
13
|
+
{% for author in node.authors %}
|
14
|
+
<p data-type="author">{{ author.name }}</p>
|
15
|
+
{% endfor %}
|
16
|
+
{% endif %}
|
17
|
+
{% if node.subtitle or node.authors.size > 0 %}</header>{% endif %}
|
18
|
+
{% endif %}
|
19
|
+
|
9
20
|
{% if node.attributes.toc %}
|
10
21
|
<nav data-type="toc">
|
11
22
|
<h1>{{ node.attributes.toc-title }}</h1>
|
12
|
-
{{ node.
|
23
|
+
{{ node.outline }}
|
13
24
|
</nav>
|
14
25
|
{% endif %}
|
26
|
+
|
15
27
|
{{ node.content }}
|
16
28
|
</body>
|
17
29
|
</html>
|
data/templates/embedded.html
CHANGED
@@ -1,8 +1,20 @@
|
|
1
|
-
{% if node.title %}
|
1
|
+
{% if node.title %}
|
2
|
+
{% if node.subtitle or node.anthors.size > 0 %}<header>{% endif %}
|
3
|
+
<h1>{{ node.title }}</h1>
|
4
|
+
{% if node.subtitle %}<p data-type="subtitle">{{ node.subtitle }}</p>{% endif %}
|
5
|
+
{% if node.authors.size > 0 %}
|
6
|
+
{% for author in node.authors %}
|
7
|
+
<p data-type="author">{{ author.name }}</p>
|
8
|
+
{% endfor %}
|
9
|
+
{% endif %}
|
10
|
+
{% if node.subtitle or node.authors.size > 0 %}</header>{% endif %}
|
11
|
+
{% endif %}
|
12
|
+
|
2
13
|
{% if node.attributes.toc %}
|
3
14
|
<nav data-type="toc">
|
4
15
|
<h1>{{ node.attributes.toc-title }}</h1>
|
5
16
|
{{ node.toc }}
|
6
17
|
</nav>
|
7
18
|
{% endif %}
|
19
|
+
|
8
20
|
{{ node.content }}
|
data/templates/example.html
CHANGED
data/templates/image.html
CHANGED
data/templates/listing.html
CHANGED
data/templates/literal.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<pre>{{ node.content }}</pre>
|
1
|
+
<pre {% if node.id %}id="{{ node.id }}"{% endif %}>{{ node.content }}</pre>
|
data/templates/olist.html
CHANGED
data/templates/paragraph.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<p>{{ node.content }}</p>
|
1
|
+
<p {% if node.id %}id="{{ node.id }}"{% endif %}>{{ node.content }}</p>
|
data/templates/preamble.html
CHANGED
data/templates/quote.html
CHANGED
data/templates/stem.html
CHANGED
data/templates/table.html
CHANGED
data/templates/ulist.html
CHANGED
data/templates/verse.html
CHANGED
data/templates/video.html
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
<video
|
1
|
+
<video {% if node.id %}id="{{ node.id }}"{% endif %}
|
2
|
+
src="{{ node.attributes.target }}"
|
2
3
|
controls="controls"
|
3
4
|
{% if node.attributes.width %}width="{{ node.attributes.width }}"{% endif %}
|
4
5
|
{% if node.attributes.height %}height="{{ node.attributes.height }}"{% endif %}
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|