asciidoctor-htmlbook 0.0.5 → 0.0.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: 84191fe5cc45f3e8edc81303b20799f6a44ed3774cfd6dfd2f7245bd2a242099
4
- data.tar.gz: cf845626c0e4fbedccbcc6038a9096364939a54209d5cd7ff866596c6b3d6ef0
3
+ metadata.gz: d1b2813a5e3da56201a661fc6c80aecc9fa45ae21a244a54f38355f76c1cadc6
4
+ data.tar.gz: ede7d28533940663055d38fd49af004e6d7f0337a4d3ef02668b1436bea8ec67
5
5
  SHA512:
6
- metadata.gz: 38badaa8c38b42a6c99954f2b1c478fa8658d5d40c196cea664e0ad5128a387fa29b0b198abd7bc60986b18e2b2600cb41d39653de894b724b4522ade57ef300
7
- data.tar.gz: dfdd788a982e8c1e4bdc32eeaac3b0464867ca6c41e241f1da8eb3858e80d8ae12eb77f13dee33ca37668b85e2c634030085aadd41bd8c07e9ca3843de8d31da
6
+ metadata.gz: c7438d871f950ae8b87f48e325e36464fc4da40f00eccae703d7a7b6412d8da89489a0d1ec279d0d9949227c902c5866810761ff76476b4a65ad392a30fa01b4
7
+ data.tar.gz: 07ce39b8e15869c78add96ad11c2fdfe579823f4e8e2f3cebb34f6aee116689978a4f3287e0c92791a50e8a887f5461ed87f63d7b7961292b82bb60eabb3bb22
@@ -4,4 +4,5 @@ rvm:
4
4
  - 2.4
5
5
  - 2.5
6
6
  - 2.6
7
- before_install: gem install bundler -v 2.0.2
7
+ - 2.7
8
+ before_install: gem install bundler -v 2.1.4
@@ -1,5 +1,11 @@
1
1
  == master
2
2
 
3
+ == v0.0.6
4
+
5
+ - Add id attribute for all block node
6
+ - Add subtitle and author
7
+ - fix ruby 2.4 compatibility
8
+
3
9
  == v0.0.5
4
10
 
5
11
  - Fix body h1
@@ -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] || []).prepend(DEFAULT_TEMPLATE_PATH)
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
- 'header' => {
82
- 'title' => (node.header && node.header.title)
83
- },
84
- 'title' => node.attributes['doctitle'],
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
 
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Htmlbook
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- <div data-type="{{ node.attributes.name }}">
1
+ <div {% if node.id %}id="{{ node.id }}"{% endif %} data-type="{{ node.attributes.name }}">
2
2
  {% if node.title %}<h5>{{ node.title }}</h5>{% endif %}
3
3
  {{ node.content }}
4
4
  </div>
@@ -1,4 +1,5 @@
1
- <audio src="{{ node.attributes.target }}"
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 %}>
@@ -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>
@@ -1,4 +1,4 @@
1
- <dl>
1
+ <dl {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% for item in node.items %}
3
3
  {% for term in item.terms %}
4
4
  <dt>{{ term.text }}</dt>
@@ -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 %}<h1>{{ node.title }}</h1>{% endif %}
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.toc }}
23
+ {{ node.outline }}
13
24
  </nav>
14
25
  {% endif %}
26
+
15
27
  {{ node.content }}
16
28
  </body>
17
29
  </html>
@@ -1,8 +1,20 @@
1
- {% if node.title %}<h1>{{ node.title }}</h1>{% endif %}
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 }}
@@ -1,4 +1,4 @@
1
- <div data-type="example">
1
+ <div {% if node.id %}id="{{ node.id }}"{% endif %} data-type="example">
2
2
  {% if node.title %}<h5>{{ node.captioned_title }}</h5>{% endif %}
3
3
  {{ node.content }}
4
4
  </div>
@@ -1,4 +1,4 @@
1
- <figure>
1
+ <figure {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% if node.attributes.link %}<a href="{{ node.attributes.link }}">{% endif %}
3
3
  <img src="{{ node.attributes.target }}"
4
4
  {% if node.attributes.alt %}alt="{{ node.attributes.alt }}"{% endif %}
@@ -1,4 +1,4 @@
1
- <figure>
1
+ <figure {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% if node.title %}<figcaption>{{ node.title }}</figcaption>{% endif %}
3
3
  <pre data-type="programlisting"
4
4
  {% if node.attributes.language %}data-code-language="{{ node.attributes.language }}"{% endif %}
@@ -1 +1 @@
1
- <pre>{{ node.content }}</pre>
1
+ <pre {% if node.id %}id="{{ node.id }}"{% endif %}>{{ node.content }}</pre>
@@ -1,4 +1,4 @@
1
- <ol>
1
+ <ol {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% for item in node.items %}
3
3
  <li>
4
4
  <p>{{ item.text }}</p>
@@ -1 +1 @@
1
- <p>{{ node.content }}</p>
1
+ <p {% if node.id %}id="{{ node.id }}"{% endif %}>{{ node.content }}</p>
@@ -1,3 +1,3 @@
1
- <section data-type="preamble">
1
+ <section {% if node.id %}id="{{ node.id }}"{% endif %} data-type="preamble">
2
2
  {{ node.content }}
3
3
  </section>
@@ -1,4 +1,4 @@
1
- <blockquote>
1
+ <blockquote {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {{ node.content }}
3
3
  {% if node.attributes.attribution %}
4
4
  <p data-type="attribution">{{ node.attributes.attribution }}</p>
@@ -1,4 +1,4 @@
1
- <div data-type="equation">
1
+ <div {% if node.id %}id="{{ node.id }}"{% endif %} data-type="equation">
2
2
  {% if node.title %}<h5>{{ node.title }}</h5>{% endif %}
3
3
  {% case node.style %}
4
4
  {% when 'latexmath' %}
@@ -1,4 +1,4 @@
1
- <table>
1
+ <table {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% if node.title %}
3
3
  <caption>{{ node.captioned_title }}</caption>
4
4
  {% endif %}
@@ -1,4 +1,4 @@
1
- <ul>
1
+ <ul {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  {% for item in node.items %}
3
3
  <li>
4
4
  <p>{{ item.text }}</p>
@@ -1,4 +1,4 @@
1
- <blockquote>
1
+ <blockquote {% if node.id %}id="{{ node.id }}"{% endif %}>
2
2
  <pre>{{ node.content }}</pre>
3
3
  {% if node.attributes.attribution %}
4
4
  <p data-type="attribution">{{ node.attributes.attribution }}</p>
@@ -1,4 +1,5 @@
1
- <video src="{{ node.attributes.target }}"
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.5
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-08 00:00:00.000000000 Z
11
+ date: 2020-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor