asciidoctor-html5s 0.1.0.beta.3 → 0.1.0.beta.4
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/data/templates/helpers.rb +4 -4
- data/data/templates/toc.html.slim +4 -2
- data/lib/asciidoctor/html5s/converter.rb +8 -6
- data/lib/asciidoctor/html5s/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 819e3a71952cef839eef80a5e236792f4c580554
|
4
|
+
data.tar.gz: 51f5722fb9a01deae23ac1f4bb2433e565bd72f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f88f4dbfccc68c008b6ee5e105cb7fcc1aee7ece21ea28932d1bd9dc82b0f0195ff908814c6125f84f095d0fa5b5a37931cc974a9a2fd16b4060220e8f76647
|
7
|
+
data.tar.gz: 98c9005fbf4e458e836b42be497fb4aaf1f8ade40ac72988a760266b66f66d8032833372b279fa38114872262a8c2bc30e9f47ae517dd49187f53b1ae83cf91a
|
data/data/templates/helpers.rb
CHANGED
@@ -274,8 +274,8 @@ module Slim::Helpers
|
|
274
274
|
def urlize(*segments)
|
275
275
|
path = segments * '/'
|
276
276
|
if path.start_with? '//'
|
277
|
-
@
|
278
|
-
path = "#{@
|
277
|
+
@_html5s_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
|
278
|
+
path = "#{@_html5s_uri_scheme}:#{path}" unless @_html5s_uri_scheme.empty?
|
279
279
|
end
|
280
280
|
normalize_web_path path
|
281
281
|
end
|
@@ -395,7 +395,7 @@ module Slim::Helpers
|
|
395
395
|
# @return [String] a canonical name of the source-highlighter to be used as
|
396
396
|
# a style class.
|
397
397
|
def highlighter
|
398
|
-
@
|
398
|
+
@_html5s_highlighter ||=
|
399
399
|
case (highlighter = document.attr('source-highlighter'))
|
400
400
|
when 'coderay'; 'CodeRay'
|
401
401
|
when 'highlight.js'; 'highlightjs'
|
@@ -617,7 +617,7 @@ is book and it's a child of a book part. Excluding block content."
|
|
617
617
|
elsif document.respond_to? :catalog # Asciidoctor >=1.5.6
|
618
618
|
ref = document.catalog[:refs][attr :refid]
|
619
619
|
if ref.kind_of? Asciidoctor::AbstractNode
|
620
|
-
ref.xreftext((@
|
620
|
+
ref.xreftext((@_html5s_xrefstyle ||= document.attributes['xrefstyle']))
|
621
621
|
end
|
622
622
|
else # Asciidoctor < 1.5.6
|
623
623
|
document.references[:ids][attr :refid || target]
|
@@ -1,9 +1,11 @@
|
|
1
1
|
/ This template is used only for toc::[] macro; for document and preamble TOC
|
2
2
|
/ see document.html, preamble.html and _toc.html.
|
3
|
-
- if document.attr?
|
3
|
+
- if document.attr?(:toc) && document.sections?
|
4
4
|
- toc_id = id || ('toc' if document.embedded? || !document.attr?('toc-placement'))
|
5
5
|
nav id=toc_id class=(attr :role, (document.attr 'toc-class', 'toc')) role='doc-toc'
|
6
|
-
h level=(
|
6
|
+
h level=(level + 2) id=("#{toc_id}-title" if toc_id)
|
7
7
|
=(title || (document.attr 'toc-title'))
|
8
8
|
/ Renders outline.html.
|
9
9
|
= converter.convert document, 'outline', :toclevels=>((attr :levels).to_i if attr? :levels)
|
10
|
+
- else
|
11
|
+
/! toc disabled
|
@@ -281,8 +281,8 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
281
281
|
def urlize(*segments)
|
282
282
|
path = segments * '/'
|
283
283
|
if path.start_with? '//'
|
284
|
-
@
|
285
|
-
path = "#{@
|
284
|
+
@_html5s_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
|
285
|
+
path = "#{@_html5s_uri_scheme}:#{path}" unless @_html5s_uri_scheme.empty?
|
286
286
|
end
|
287
287
|
normalize_web_path path
|
288
288
|
end
|
@@ -402,7 +402,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
402
402
|
# @return [String] a canonical name of the source-highlighter to be used as
|
403
403
|
# a style class.
|
404
404
|
def highlighter
|
405
|
-
@
|
405
|
+
@_html5s_highlighter ||=
|
406
406
|
case (highlighter = document.attr('source-highlighter'))
|
407
407
|
when 'coderay'; 'CodeRay'
|
408
408
|
when 'highlight.js'; 'highlightjs'
|
@@ -624,7 +624,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
624
624
|
elsif document.respond_to? :catalog # Asciidoctor >=1.5.6
|
625
625
|
ref = document.catalog[:refs][attr :refid]
|
626
626
|
if ref.kind_of? Asciidoctor::AbstractNode
|
627
|
-
ref.xreftext((@
|
627
|
+
ref.xreftext((@_html5s_xrefstyle ||= document.attributes['xrefstyle']))
|
628
628
|
end
|
629
629
|
else # Asciidoctor < 1.5.6
|
630
630
|
document.references[:ids][attr :refid || target]
|
@@ -2755,7 +2755,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
2755
2755
|
node.instance_eval do
|
2756
2756
|
converter.set_local_variables(binding, opts) unless opts.empty?
|
2757
2757
|
_buf = ''
|
2758
|
-
if document.attr?
|
2758
|
+
if document.attr?(:toc) && document.sections?
|
2759
2759
|
toc_id = id || ('toc' if document.embedded? || !document.attr?('toc-placement'))
|
2760
2760
|
_buf << ("<nav".freeze)
|
2761
2761
|
_slim_codeattributes1 = toc_id
|
@@ -2785,7 +2785,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
2785
2785
|
_buf << ("\"".freeze)
|
2786
2786
|
end
|
2787
2787
|
_buf << (" role=\"doc-toc\">".freeze)
|
2788
|
-
_slim_htag_filter1 = ((
|
2788
|
+
_slim_htag_filter1 = ((level + 2)).to_s
|
2789
2789
|
_buf << ("<h".freeze)
|
2790
2790
|
_buf << ((_slim_htag_filter1).to_s)
|
2791
2791
|
_slim_codeattributes3 = ("#{toc_id}-title" if toc_id)
|
@@ -2805,6 +2805,8 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
2805
2805
|
_buf << (">".freeze)
|
2806
2806
|
_buf << ((converter.convert document, 'outline', :toclevels=>((attr :levels).to_i if attr? :levels)).to_s)
|
2807
2807
|
_buf << ("</nav>".freeze)
|
2808
|
+
else
|
2809
|
+
_buf << ("<!--toc disabled-->".freeze)
|
2808
2810
|
end
|
2809
2811
|
_buf
|
2810
2812
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-html5s
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.beta.
|
4
|
+
version: 0.1.0.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Jirutka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|