asciidoctor-html5s 0.1.0.beta.3 → 0.1.0.beta.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
2
  SHA1:
3
- metadata.gz: b5250cc92ec9b7b6460b36fc66305d32f6ac1eb7
4
- data.tar.gz: a7721dedf96135964437a8ebaadc2d5d9628b8dd
3
+ metadata.gz: 819e3a71952cef839eef80a5e236792f4c580554
4
+ data.tar.gz: 51f5722fb9a01deae23ac1f4bb2433e565bd72f3
5
5
  SHA512:
6
- metadata.gz: 5cdff5bb63ae883477432d06cf63e6bd5310c2c3b95c5e4811d902ee22e40ae6b91f59f1c24294936fd21ddd15c66fe6302848033d05690a042e3a363677fb05
7
- data.tar.gz: 9efa099ea3cb9d01a8fb03c32dc6abb6950b758ce449b46bc308d3dc7ceb898f25d974cf2897e79f58809672fa352565a47f7d323cc0c671624ccfa0bdb11977
6
+ metadata.gz: 8f88f4dbfccc68c008b6ee5e105cb7fcc1aee7ece21ea28932d1bd9dc82b0f0195ff908814c6125f84f095d0fa5b5a37931cc974a9a2fd16b4060220e8f76647
7
+ data.tar.gz: 98c9005fbf4e458e836b42be497fb4aaf1f8ade40ac72988a760266b66f66d8032833372b279fa38114872262a8c2bc30e9f47ae517dd49187f53b1ae83cf91a
@@ -274,8 +274,8 @@ module Slim::Helpers
274
274
  def urlize(*segments)
275
275
  path = segments * '/'
276
276
  if path.start_with? '//'
277
- @_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
278
- path = "#{@_uri_scheme}:#{path}" unless @_uri_scheme.empty?
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
- @_highlighter ||=
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((@_xrefstyle ||= document.attributes['xrefstyle']))
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? :toc
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=(section_level + 2) id=("#{toc_id}-title" if toc_id)
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
- @_uri_scheme ||= document.attr('asset-uri-scheme', 'https')
285
- path = "#{@_uri_scheme}:#{path}" unless @_uri_scheme.empty?
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
- @_highlighter ||=
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((@_xrefstyle ||= document.attributes['xrefstyle']))
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? :toc
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 = ((section_level + 2)).to_s
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
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Html5s
3
- VERSION = '0.1.0.beta.3'.freeze
3
+ VERSION = '0.1.0.beta.4'.freeze
4
4
  end
5
5
  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.3
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-12 00:00:00.000000000 Z
11
+ date: 2017-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor