asciidoctor-html5s 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +1 -1
- data/asciidoctor-html5s.gemspec +3 -4
- data/data/templates/_header.html.slim +1 -1
- data/data/templates/document.html.slim +12 -4
- data/data/templates/embedded.html.slim +1 -1
- data/data/templates/example.html.slim +11 -3
- data/data/templates/helpers.rb +85 -57
- data/data/templates/inline_anchor.html.slim +3 -5
- data/data/templates/inline_quoted.html.slim +11 -13
- data/data/templates/listing.html.slim +8 -4
- data/data/templates/olist.html.slim +1 -1
- data/data/templates/outline.html.slim +1 -1
- data/data/templates/table.html.slim +6 -8
- data/data/templates/ulist.html.slim +2 -2
- data/data/templates/video.html.slim +1 -0
- data/lib/asciidoctor/html5s.rb +4 -0
- data/lib/asciidoctor/html5s/attached_colist_treeprocessor.rb +2 -0
- data/lib/asciidoctor/html5s/converter.rb +148 -105
- data/lib/asciidoctor/html5s/html_pipeline_highlighter.rb +31 -0
- data/lib/asciidoctor/html5s/version.rb +1 -1
- metadata +9 -23
- data/lib/asciidoctor/html5s/logger.rb +0 -21
@@ -5,6 +5,6 @@
|
|
5
5
|
ol.toc-list class="level-#{slevel}"
|
6
6
|
- sections.each do |sec|
|
7
7
|
li
|
8
|
-
a href="##{sec.id}" =section_title sec
|
8
|
+
a href="##{sec.id}" =(section_title sec, drop_anchors: true)
|
9
9
|
- if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline')
|
10
10
|
= child_toc
|
@@ -1,7 +1,7 @@
|
|
1
1
|
= block_with_caption :top, :class=>'table-block'
|
2
2
|
table [
|
3
|
-
class=["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}",
|
4
|
-
style=style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !
|
3
|
+
class=["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", stretch?, ("stripes-#{attr :stripes}" if attr? :stripes)]
|
4
|
+
style=style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !stretch? || (local_attr :width)),
|
5
5
|
float: (attr :float)) ]
|
6
6
|
- unless (attr :rowcount).zero?
|
7
7
|
colgroup
|
@@ -10,7 +10,7 @@
|
|
10
10
|
col
|
11
11
|
- else
|
12
12
|
- columns.each do |col|
|
13
|
-
col style=
|
13
|
+
col style=style_value(width: ("#{col.attr :colpcwidth}%" if !autowidth? col))
|
14
14
|
- [:head, :foot, :body].reject { |tblsec| rows[tblsec].empty? }.each do |tblsec|
|
15
15
|
<t#{tblsec}>
|
16
16
|
- rows[tblsec].each do |row|
|
@@ -27,13 +27,11 @@
|
|
27
27
|
- case cell.style
|
28
28
|
- when :asciidoc
|
29
29
|
=cell.content
|
30
|
-
- when :verse
|
31
|
-
.verse: pre =cell.text
|
32
30
|
- when :literal
|
33
31
|
.literal: pre =cell.text
|
34
32
|
- else
|
35
|
-
- if cell.content.one?
|
36
|
-
=
|
33
|
+
- if (content = cell.content).one?
|
34
|
+
=content.first
|
37
35
|
- else
|
38
|
-
-
|
36
|
+
- content.each do |text|
|
39
37
|
p =text
|
@@ -3,9 +3,9 @@
|
|
3
3
|
ul class=(checklist || style)
|
4
4
|
- items.each do |item|
|
5
5
|
- if checklist && (item.attr? :checkbox)
|
6
|
-
li.task-list-item
|
6
|
+
li.task-list-item id=item.id class=item.role
|
7
7
|
input.task-list-item-checkbox type='checkbox' disabled=true checked=(item.attr? :checked)
|
8
8
|
=<item.text
|
9
9
|
- else
|
10
|
-
li
|
10
|
+
li id=item.id class=item.role
|
11
11
|
=(print_item_content item)
|
data/lib/asciidoctor/html5s.rb
CHANGED
@@ -3,6 +3,10 @@ require 'asciidoctor/html5s/converter'
|
|
3
3
|
require 'asciidoctor/html5s/replacements'
|
4
4
|
require 'asciidoctor/html5s/attached_colist_treeprocessor'
|
5
5
|
|
6
|
+
if defined? Asciidoctor::SyntaxHighlighter
|
7
|
+
require 'asciidoctor/html5s/html_pipeline_highlighter'
|
8
|
+
end
|
9
|
+
|
6
10
|
unless RUBY_PLATFORM == 'opal'
|
7
11
|
require 'asciidoctor/extensions'
|
8
12
|
|
@@ -9,6 +9,8 @@ module Asciidoctor::Html5s
|
|
9
9
|
class AttachedColistTreeprocessor < ::Asciidoctor::Extensions::Treeprocessor
|
10
10
|
|
11
11
|
def process(document)
|
12
|
+
return if document.backend != 'html5s'
|
13
|
+
|
12
14
|
document.find_by(context: :colist) do |colist|
|
13
15
|
blocks = colist.parent.blocks
|
14
16
|
colist_idx = blocks.find_index(colist)
|
@@ -6,7 +6,6 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
6
6
|
#------------------------------ Begin of Helpers ------------------------------#
|
7
7
|
|
8
8
|
require 'asciidoctor/html5s'
|
9
|
-
require 'asciidoctor/html5s/logger'
|
10
9
|
require 'date' unless RUBY_PLATFORM == 'opal'
|
11
10
|
|
12
11
|
# Add custom functions to this module that you want to use in your Slim
|
@@ -15,10 +14,11 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
15
14
|
module Helpers
|
16
15
|
|
17
16
|
# URIs of external assets.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
CDN_BASE_URI = 'https://cdnjs.cloudflare.com/ajax/libs' # for highlighters in Asciidoctor >=2.0.0
|
18
|
+
FONT_AWESOME_URI = 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css'
|
19
|
+
HIGHLIGHTJS_BASE_URI = 'https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.1/build/'
|
20
|
+
KATEX_CSS_URI = 'https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css'
|
21
|
+
KATEX_JS_URI = 'https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js'
|
22
22
|
|
23
23
|
# Defaults
|
24
24
|
DEFAULT_HIGHLIGHTJS_THEME = 'github'
|
@@ -60,7 +60,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
60
60
|
|
61
61
|
# @return [Logger]
|
62
62
|
def log
|
63
|
-
|
63
|
+
::Asciidoctor::LoggerManager.logger
|
64
64
|
end
|
65
65
|
|
66
66
|
##
|
@@ -383,15 +383,29 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
383
383
|
# Returns the captioned section's title, optionally numbered.
|
384
384
|
#
|
385
385
|
# @param sec [Asciidoctor::Section] the section node (default: self).
|
386
|
+
# @param drop_anchors [Boolean] Remove +<a>+ tags from the title?
|
386
387
|
# @return [String]
|
387
388
|
#
|
388
|
-
def section_title(sec = self)
|
389
|
-
|
389
|
+
def section_title(sec = self, drop_anchors: false)
|
390
|
+
title =
|
391
|
+
if sec.caption
|
392
|
+
sec.captioned_title
|
393
|
+
elsif sec.numbered && sec.level <= document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i
|
394
|
+
if sec.level < 2 && document.doctype == 'book' && %w[chapter part].include?(sec.sectname)
|
395
|
+
signifier = document.attr("#{sec.sectname}-signifier")
|
396
|
+
sectnum = sec.sectname == 'part' ? sec.sectnum(nil, ':') : sec.sectnum
|
397
|
+
"#{signifier&.+ ' '}#{sectnum} #{sec.title}"
|
398
|
+
else
|
399
|
+
"#{sec.sectnum} #{sec.title}"
|
400
|
+
end
|
401
|
+
else
|
402
|
+
sec.title
|
403
|
+
end
|
390
404
|
|
391
|
-
if
|
392
|
-
[
|
405
|
+
if drop_anchors && title.include?('<a')
|
406
|
+
title.gsub(/<(?:a[^>+]+|\/a)>/, '')
|
393
407
|
else
|
394
|
-
|
408
|
+
title
|
395
409
|
end
|
396
410
|
end
|
397
411
|
|
@@ -403,7 +417,12 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
403
417
|
end
|
404
418
|
|
405
419
|
def link_rel
|
406
|
-
|
420
|
+
rel = [
|
421
|
+
('nofollow' if option?('nofollow')),
|
422
|
+
('noopener' if option?('noopener') || local_attr(:window) == '_blank')
|
423
|
+
].compact
|
424
|
+
|
425
|
+
rel.empty? ? nil : rel.join(' ')
|
407
426
|
end
|
408
427
|
|
409
428
|
#--------------------------------------------------------
|
@@ -462,15 +481,19 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
462
481
|
#
|
463
482
|
|
464
483
|
##
|
465
|
-
#
|
466
|
-
#
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
484
|
+
# See {Asciidoctor::SyntaxHighlighter#format}.
|
485
|
+
#
|
486
|
+
# @return [String, nil] a rendered HTML.
|
487
|
+
def formatted_source
|
488
|
+
hl = document.syntax_highlighter or return nil
|
489
|
+
|
490
|
+
opts = { nowrap: nowrap? }
|
491
|
+
if hl.highlight?
|
492
|
+
opts[:css_mode] = document.attr("#{hl.name}-css", :class).to_sym
|
493
|
+
opts[:style] = document.attr("#{hl.name}-style")
|
494
|
+
end
|
495
|
+
|
496
|
+
hl.format(self, source_lang, opts)
|
474
497
|
end
|
475
498
|
|
476
499
|
##
|
@@ -488,6 +511,15 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
488
511
|
local_attr :language, false
|
489
512
|
end
|
490
513
|
|
514
|
+
# This is needed only for Asciidoctor <2.0.0.
|
515
|
+
def source_code_class
|
516
|
+
if document.attr? 'source-highlighter', 'highlightjs'
|
517
|
+
"language-#{source_lang || 'none'} hljs"
|
518
|
+
elsif source_lang
|
519
|
+
"language-#{source_lang}"
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
491
523
|
#--------------------------------------------------------
|
492
524
|
# block_open
|
493
525
|
#
|
@@ -509,7 +541,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
509
541
|
def partintro_allowed?
|
510
542
|
if result = (level != 0 || parent.context != :section || document.doctype != 'book')
|
511
543
|
log.warn "asciidoctor: ERROR: partintro block can only be used when doctype
|
512
|
-
is book and
|
544
|
+
is book and must be a child of a book part. Excluding block content."
|
513
545
|
end
|
514
546
|
!result
|
515
547
|
end
|
@@ -518,13 +550,13 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
518
550
|
# block_table
|
519
551
|
#
|
520
552
|
|
521
|
-
def autowidth?
|
522
|
-
option? :autowidth
|
553
|
+
def autowidth?(node = self)
|
554
|
+
node.option? :autowidth
|
523
555
|
end
|
524
556
|
|
525
|
-
def
|
557
|
+
def stretch?
|
526
558
|
if !autowidth? || local_attr?('width')
|
527
|
-
'
|
559
|
+
'stretch' if attr? :tablepcwidth, 100
|
528
560
|
end
|
529
561
|
end
|
530
562
|
|
@@ -542,7 +574,8 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
542
574
|
when :vimeo
|
543
575
|
params = {
|
544
576
|
autoplay: (1 if option? 'autoplay'),
|
545
|
-
loop: (1 if option? 'loop')
|
577
|
+
loop: (1 if option? 'loop'),
|
578
|
+
muted: (1 if option? 'muted')
|
546
579
|
}
|
547
580
|
start_anchor = "#at=#{attr :start}" if attr? :start
|
548
581
|
"//player.vimeo.com/video/#{attr :target}#{start_anchor}#{url_query params}"
|
@@ -556,6 +589,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
556
589
|
list: (attr :list, list_id),
|
557
590
|
autoplay: (1 if option? 'autoplay'),
|
558
591
|
loop: (1 if option? 'loop'),
|
592
|
+
muted: (1 if option? 'muted'),
|
559
593
|
controls: (0 if option? 'nocontrols')
|
560
594
|
}
|
561
595
|
"//www.youtube.com/embed/#{video_id}#{url_query params}"
|
@@ -610,10 +644,9 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
610
644
|
stylesheet = attr :stylesheet
|
611
645
|
stylesdir = attr :stylesdir, ''
|
612
646
|
default_style = ::Asciidoctor::DEFAULT_STYLESHEET_KEYS.include? stylesheet
|
613
|
-
linkcss = attr?(:linkcss) || safe >= ::Asciidoctor::SafeMode::SECURE
|
614
647
|
ss = ::Asciidoctor::Stylesheets.instance
|
615
648
|
|
616
|
-
if linkcss
|
649
|
+
if attr?(:linkcss)
|
617
650
|
path = default_style ? ::Asciidoctor::DEFAULT_STYLESHEET_NAME : stylesheet
|
618
651
|
styles << { href: [stylesdir, path] }
|
619
652
|
elsif default_style
|
@@ -636,23 +669,15 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
636
669
|
scripts << { text: KATEX_RENDER_CODE }
|
637
670
|
end
|
638
671
|
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
styles << { href: [stylesdir, ss.coderay_stylesheet_name] }
|
644
|
-
else
|
645
|
-
styles << { text: ss.coderay_stylesheet_data }
|
646
|
-
end
|
647
|
-
end
|
648
|
-
|
649
|
-
when 'highlightjs'
|
650
|
-
hjs_base = attr :highlightjsdir, HIGHLIGHTJS_BASE_URI
|
651
|
-
hjs_theme = attr 'highlightjs-theme', DEFAULT_HIGHLIGHTJS_THEME
|
672
|
+
if !defined?(::Asciidoctor::SyntaxHighlighter) # Asciidoctor <2.0.0
|
673
|
+
if attr? 'source-highlighter', 'highlightjs'
|
674
|
+
hjs_base = attr :highlightjsdir, HIGHLIGHTJS_BASE_URI
|
675
|
+
hjs_theme = attr 'highlightjs-theme', DEFAULT_HIGHLIGHTJS_THEME
|
652
676
|
|
653
|
-
|
654
|
-
|
655
|
-
|
677
|
+
scripts << { src: [hjs_base, 'highlight.min.js'] }
|
678
|
+
scripts << { text: 'hljs.initHighlightingOnLoad()' }
|
679
|
+
styles << { href: [hjs_base, "styles/#{hjs_theme}.min.css"] }
|
680
|
+
end
|
656
681
|
end
|
657
682
|
|
658
683
|
styles.each do |item|
|
@@ -671,6 +696,15 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
671
696
|
end
|
672
697
|
end
|
673
698
|
|
699
|
+
if defined?(::Asciidoctor::SyntaxHighlighter) && (hl = syntax_highlighter) # Asciidoctor >=2.0.0
|
700
|
+
# XXX: We don't care about the declared location and put all to head.
|
701
|
+
[:head, :footer].each do |location|
|
702
|
+
if hl.docinfo?(location)
|
703
|
+
tags << hl.docinfo(location, self, cdn_base_url: CDN_BASE_URI, linkcss: attr?(:linkcss))
|
704
|
+
end
|
705
|
+
end
|
706
|
+
end
|
707
|
+
|
674
708
|
tags.join("\n")
|
675
709
|
end
|
676
710
|
|
@@ -685,27 +719,21 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
685
719
|
text
|
686
720
|
elsif (path = local_attr :path)
|
687
721
|
path
|
688
|
-
|
722
|
+
else
|
689
723
|
ref = document.catalog[:refs][attr :refid]
|
690
724
|
if ref.kind_of? Asciidoctor::AbstractNode
|
691
|
-
ref.xreftext((
|
725
|
+
ref.xreftext(attr(:xrefstyle, nil, true))
|
692
726
|
end
|
693
|
-
else # Asciidoctor < 1.5.6
|
694
|
-
document.references[:ids][attr :refid || target]
|
695
727
|
end
|
696
728
|
(str || "[#{attr :refid}]").tr_s("\n", ' ')
|
697
729
|
end
|
698
730
|
|
699
731
|
# @return [String, nil] text of the bibref anchor, or +nil+ if not found.
|
700
732
|
def bibref_text
|
701
|
-
if
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
"[#{reftext || id}]"
|
706
|
-
end
|
707
|
-
else
|
708
|
-
"[#{target}]"
|
733
|
+
if ::Asciidoctor::VERSION[0] == '1'
|
734
|
+
text
|
735
|
+
else # Asciidoctor >= 2.0.0
|
736
|
+
"[#{reftext || id}]"
|
709
737
|
end
|
710
738
|
end
|
711
739
|
|
@@ -850,13 +878,17 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
850
878
|
node.instance_eval do
|
851
879
|
_buf = []; _slim_controls1 = block_with_caption :top, :class=>'listing-block' do; _slim_controls2 = [];
|
852
880
|
; if style == 'source';
|
853
|
-
;
|
881
|
+
; highlighter = document.attr('source-highlighter');
|
882
|
+
;
|
883
|
+
; if defined?(::Asciidoctor::SyntaxHighlighter) && document.syntax_highlighter;
|
884
|
+
; _slim_controls2 << (formatted_source);
|
885
|
+
;
|
886
|
+
; elsif highlighter == 'html-pipeline';
|
854
887
|
; _slim_controls2 << ("<pre><code"); _slim_codeattributes1 = source_lang; if _slim_codeattributes1; if _slim_codeattributes1 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes1); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << (content);
|
855
888
|
; _slim_controls2 << ("</code></pre>"); else;
|
856
|
-
;
|
857
|
-
;
|
858
|
-
;
|
859
|
-
; _temple_html_attributeremover2 = []; _slim_codeattributes3 = code_class; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes3.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes3); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_codeattributes4 = source_lang; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << (content);
|
889
|
+
;
|
890
|
+
; _slim_controls2 << ("<pre"); _temple_html_attributeremover1 = []; _slim_codeattributes2 = [highlighter, 'highlight', ('linenums' if attr? :linenums), nowrap?]; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover1); _slim_controls2 << ("\""); end; _slim_controls2 << ("><code");
|
891
|
+
; _temple_html_attributeremover2 = []; _slim_codeattributes3 = source_code_class; if Array === _slim_codeattributes3; _slim_codeattributes3 = _slim_codeattributes3.flatten; _slim_codeattributes3.map!(&:to_s); _slim_codeattributes3.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes3.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes3); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_codeattributes4 = source_lang; if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" data-lang"); else; _slim_controls2 << (" data-lang=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">"); _slim_controls2 << (content);
|
860
892
|
; _slim_controls2 << ("</code></pre>"); end; else;
|
861
893
|
; _slim_controls2 << ("<pre"); _temple_html_attributeremover3 = []; _slim_codeattributes5 = nowrap?; if Array === _slim_codeattributes5; _slim_codeattributes5 = _slim_codeattributes5.flatten; _slim_codeattributes5.map!(&:to_s); _slim_codeattributes5.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes5.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes5); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover3); _slim_controls2 << ("\""); end; _slim_controls2 << (">"); _slim_controls2 << (content);
|
862
894
|
; _slim_controls2 << ("</pre>");
|
@@ -920,7 +952,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
920
952
|
_buf = []; _slim_controls1 = block_with_title :class=>['olist', style] do; _slim_controls2 = [];
|
921
953
|
; _slim_controls2 << ("<ol"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = style; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes1.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes1); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover1); _slim_controls2 << ("\""); end; _slim_codeattributes2 = (attr :start); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" start"); else; _slim_controls2 << (" start=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_codeattributes3 = list_marker_keyword; if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" type"); else; _slim_controls2 << (" type=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_codeattributes4 = (option? 'reversed'); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" reversed"); else; _slim_controls2 << (" reversed=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">");
|
922
954
|
; items.each do |item|;
|
923
|
-
; _slim_controls2 << ("<li>"); _slim_controls2 << ((print_item_content item));
|
955
|
+
; _slim_controls2 << ("<li"); _slim_codeattributes5 = item.id; if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" id"); else; _slim_controls2 << (" id=\""); _slim_controls2 << (_slim_codeattributes5); _slim_controls2 << ("\""); end; end; _temple_html_attributeremover2 = []; _slim_codeattributes6 = item.role; if Array === _slim_codeattributes6; _slim_codeattributes6 = _slim_codeattributes6.flatten; _slim_codeattributes6.map!(&:to_s); _slim_codeattributes6.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes6.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes6); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_controls2 << (">"); _slim_controls2 << ((print_item_content item));
|
924
956
|
; _slim_controls2 << ("</li>"); end; _slim_controls2 << ("</ol>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
925
957
|
end
|
926
958
|
end
|
@@ -983,7 +1015,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
983
1015
|
_buf = []; _slim_controls1 = block_with_caption :top, :class=>'table-block' do; _slim_controls2 = [];
|
984
1016
|
;
|
985
1017
|
;
|
986
|
-
; _slim_controls2 << ("<table"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = ["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}",
|
1018
|
+
; _slim_controls2 << ("<table"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = ["frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", stretch?, ("stripes-#{attr :stripes}" if attr? :stripes)]; if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes1.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes1); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover1); _slim_controls2 << ("\""); end; _slim_codeattributes2 = style_value(width: ("#{attr :tablepcwidth}%" if !autowidth? && !stretch? || (local_attr :width)),
|
987
1019
|
float: (attr :float)); if _slim_codeattributes2; if _slim_codeattributes2 == true; _slim_controls2 << (" style"); else; _slim_controls2 << (" style=\""); _slim_controls2 << (_slim_codeattributes2); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">");
|
988
1020
|
; unless (attr :rowcount).zero?;
|
989
1021
|
; _slim_controls2 << ("<colgroup>");
|
@@ -992,7 +1024,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
992
1024
|
; _slim_controls2 << ("<col>");
|
993
1025
|
; end; else;
|
994
1026
|
; columns.each do |col|;
|
995
|
-
; _slim_controls2 << ("<col
|
1027
|
+
; _slim_controls2 << ("<col"); _slim_codeattributes3 = style_value(width: ("#{col.attr :colpcwidth}%" if !autowidth? col)); if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" style"); else; _slim_controls2 << (" style=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">");
|
996
1028
|
; end; end; _slim_controls2 << ("</colgroup>"); [:head, :foot, :body].reject { |tblsec| rows[tblsec].empty? }.each do |tblsec|;
|
997
1029
|
; _slim_controls2 << ("<t"); _slim_controls2 << (tblsec); _slim_controls2 << (">");
|
998
1030
|
; rows[tblsec].each do |row|;
|
@@ -1009,15 +1041,13 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1009
1041
|
; case cell.style;
|
1010
1042
|
; when :asciidoc;
|
1011
1043
|
; _slim_controls4 << (cell.content);
|
1012
|
-
; when :
|
1013
|
-
; _slim_controls4 << ("<div class=\"verse\"><pre>"); _slim_controls4 << (cell.text);
|
1014
|
-
; _slim_controls4 << ("</pre></div>"); when :literal;
|
1044
|
+
; when :literal;
|
1015
1045
|
; _slim_controls4 << ("<div class=\"literal\"><pre>"); _slim_controls4 << (cell.text);
|
1016
1046
|
; _slim_controls4 << ("</pre></div>"); else;
|
1017
|
-
; if cell.content.one?;
|
1018
|
-
; _slim_controls4 << (
|
1047
|
+
; if (content = cell.content).one?;
|
1048
|
+
; _slim_controls4 << (content.first);
|
1019
1049
|
; else;
|
1020
|
-
;
|
1050
|
+
; content.each do |text|;
|
1021
1051
|
; _slim_controls4 << ("<p>"); _slim_controls4 << (text);
|
1022
1052
|
; _slim_controls4 << ("</p>"); end; end; end; end; _slim_controls4 = _slim_controls4.join(""); end; _slim_controls2 << (_slim_controls3); end; _slim_controls2 << ("</tr>"); end; end; end; _slim_controls2 << ("</table>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
1023
1053
|
end
|
@@ -1057,16 +1087,14 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1057
1087
|
node.instance_eval do
|
1058
1088
|
_buf = []; case type;
|
1059
1089
|
; when :xref;
|
1060
|
-
; _buf << ("<a"); _slim_codeattributes1 = target; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href"); else; _buf << (" href=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (">"); _buf << (xref_text);
|
1090
|
+
; _buf << ("<a"); _slim_codeattributes1 = target; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" href"); else; _buf << (" href=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); _buf << (xref_text);
|
1061
1091
|
; _buf << ("</a>"); when :ref;
|
1062
|
-
;
|
1063
|
-
; _buf << ("<a"); _slim_codeattributes2 = (id || target); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>");
|
1092
|
+
; _buf << ("<a"); _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>");
|
1064
1093
|
; when :bibref;
|
1065
|
-
;
|
1066
|
-
; _buf << ("<a"); _slim_codeattributes3 = (id || target); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>");
|
1094
|
+
; _buf << ("<a"); _slim_codeattributes4 = id; if _slim_codeattributes4; if _slim_codeattributes4 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes4); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>");
|
1067
1095
|
; _buf << (bibref_text);
|
1068
1096
|
; else;
|
1069
|
-
; _buf << ("<a");
|
1097
|
+
; _buf << ("<a"); _slim_codeattributes5 = id; if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes5); _buf << ("\""); end; end; _temple_html_attributeremover2 = []; _slim_codeattributes6 = role; if Array === _slim_codeattributes6; _slim_codeattributes6 = _slim_codeattributes6.flatten; _slim_codeattributes6.map!(&:to_s); _slim_codeattributes6.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes6.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes6); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _slim_codeattributes7 = target; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" href"); else; _buf << (" href=\""); _buf << (_slim_codeattributes7); _buf << ("\""); end; end; _slim_codeattributes8 = (attr :window); if _slim_codeattributes8; if _slim_codeattributes8 == true; _buf << (" target"); else; _buf << (" target=\""); _buf << (_slim_codeattributes8); _buf << ("\""); end; end; _slim_codeattributes9 = link_rel; if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" rel"); else; _buf << (" rel=\""); _buf << (_slim_codeattributes9); _buf << ("\""); end; end; _slim_codeattributes10 = (attr :title); if _slim_codeattributes10; if _slim_codeattributes10 == true; _buf << (" title"); else; _buf << (" title=\""); _buf << (_slim_codeattributes10); _buf << ("\""); end; end; _buf << (">"); _buf << (text);
|
1070
1098
|
; _buf << ("</a>"); end; _buf = _buf.join("")
|
1071
1099
|
end
|
1072
1100
|
end
|
@@ -1106,34 +1134,32 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1106
1134
|
def inline_quoted(node, opts = {})
|
1107
1135
|
node.extend(Helpers)
|
1108
1136
|
node.instance_eval do
|
1109
|
-
_buf = [];
|
1110
|
-
; _buf << ("<a"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (" aria-hidden=\"true\"></a>");
|
1111
|
-
; end; case type;
|
1137
|
+
_buf = []; case type;
|
1112
1138
|
; when :emphasis;
|
1113
|
-
; _buf << ("<em"); _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1139
|
+
; _buf << ("<em"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1114
1140
|
; _buf << ("</em>"); when :strong;
|
1115
|
-
; _buf << ("<strong"); _temple_html_attributeremover2 = [];
|
1141
|
+
; _buf << ("<strong"); _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _temple_html_attributeremover2 = []; _slim_codeattributes4 = role; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover2 << (_slim_codeattributes4.join(" ")); else; _temple_html_attributeremover2 << (_slim_codeattributes4); end; _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover2); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1116
1142
|
; _buf << ("</strong>"); when :monospaced;
|
1117
|
-
; _buf << ("<code"); _temple_html_attributeremover3 = [];
|
1143
|
+
; _buf << ("<code"); _slim_codeattributes5 = id; if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes5); _buf << ("\""); end; end; _temple_html_attributeremover3 = []; _slim_codeattributes6 = role; if Array === _slim_codeattributes6; _slim_codeattributes6 = _slim_codeattributes6.flatten; _slim_codeattributes6.map!(&:to_s); _slim_codeattributes6.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes6.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes6); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover3); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1118
1144
|
; _buf << ("</code>"); when :superscript;
|
1119
|
-
; _buf << ("<sup"); _temple_html_attributeremover4 = [];
|
1145
|
+
; _buf << ("<sup"); _slim_codeattributes7 = id; if _slim_codeattributes7; if _slim_codeattributes7 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes7); _buf << ("\""); end; end; _temple_html_attributeremover4 = []; _slim_codeattributes8 = role; if Array === _slim_codeattributes8; _slim_codeattributes8 = _slim_codeattributes8.flatten; _slim_codeattributes8.map!(&:to_s); _slim_codeattributes8.reject!(&:empty?); _temple_html_attributeremover4 << (_slim_codeattributes8.join(" ")); else; _temple_html_attributeremover4 << (_slim_codeattributes8); end; _temple_html_attributeremover4 = _temple_html_attributeremover4.join(""); if !_temple_html_attributeremover4.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover4); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1120
1146
|
; _buf << ("</sup>"); when :subscript;
|
1121
|
-
; _buf << ("<sub"); _temple_html_attributeremover5 = [];
|
1147
|
+
; _buf << ("<sub"); _slim_codeattributes9 = id; if _slim_codeattributes9; if _slim_codeattributes9 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes9); _buf << ("\""); end; end; _temple_html_attributeremover5 = []; _slim_codeattributes10 = role; if Array === _slim_codeattributes10; _slim_codeattributes10 = _slim_codeattributes10.flatten; _slim_codeattributes10.map!(&:to_s); _slim_codeattributes10.reject!(&:empty?); _temple_html_attributeremover5 << (_slim_codeattributes10.join(" ")); else; _temple_html_attributeremover5 << (_slim_codeattributes10); end; _temple_html_attributeremover5 = _temple_html_attributeremover5.join(""); if !_temple_html_attributeremover5.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover5); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1122
1148
|
; _buf << ("</sub>"); when :mark;
|
1123
|
-
; _buf << ("<mark"); _temple_html_attributeremover6 = [];
|
1149
|
+
; _buf << ("<mark"); _slim_codeattributes11 = id; if _slim_codeattributes11; if _slim_codeattributes11 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes11); _buf << ("\""); end; end; _temple_html_attributeremover6 = []; _slim_codeattributes12 = role; if Array === _slim_codeattributes12; _slim_codeattributes12 = _slim_codeattributes12.flatten; _slim_codeattributes12.map!(&:to_s); _slim_codeattributes12.reject!(&:empty?); _temple_html_attributeremover6 << (_slim_codeattributes12.join(" ")); else; _temple_html_attributeremover6 << (_slim_codeattributes12); end; _temple_html_attributeremover6 = _temple_html_attributeremover6.join(""); if !_temple_html_attributeremover6.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover6); _buf << ("\""); end; _buf << (">"); _buf << (text);
|
1124
1150
|
; _buf << ("</mark>"); when :double;
|
1125
|
-
; _slim_controls1 = html_tag_if role
|
1151
|
+
; _slim_controls1 = html_tag_if role? || id, :span, :id=>id, :class=>role do; _slim_controls2 = [];
|
1126
1152
|
; _slim_controls2 << ((double_quoted text));
|
1127
1153
|
; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); when :single;
|
1128
|
-
; _slim_controls3 = html_tag_if role
|
1154
|
+
; _slim_controls3 = html_tag_if role? || id, :span, :id=>id, :class=>role do; _slim_controls4 = [];
|
1129
1155
|
; _slim_controls4 << ((single_quoted text));
|
1130
1156
|
; _slim_controls4 = _slim_controls4.join(""); end; _buf << (_slim_controls3); when :asciimath, :latexmath;
|
1131
|
-
; _buf << ("<span class=\"math\"");
|
1157
|
+
; _buf << ("<span class=\"math\""); _slim_codeattributes13 = id; if _slim_codeattributes13; if _slim_codeattributes13 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes13); _buf << ("\""); end; end; _slim_codeattributes14 = stem_lang; if _slim_codeattributes14; if _slim_codeattributes14 == true; _buf << (" data-lang"); else; _buf << (" data-lang=\""); _buf << (_slim_codeattributes14); _buf << ("\""); end; end; _buf << (">"); _buf << ((delimit_stem text, type));
|
1132
1158
|
; _buf << ("</span>"); else;
|
1133
1159
|
; if role == 'line-through' || role == 'del';
|
1134
|
-
; _buf << ("<del>"); _buf << (text);
|
1160
|
+
; _buf << ("<del"); _slim_codeattributes15 = id; if _slim_codeattributes15; if _slim_codeattributes15 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes15); _buf << ("\""); end; end; _buf << (">"); _buf << (text);
|
1135
1161
|
; _buf << ("</del>"); else;
|
1136
|
-
; _slim_controls5 = html_tag_if role
|
1162
|
+
; _slim_controls5 = html_tag_if role? || id, :span, :id=>id, :class=>role do; _slim_controls6 = [];
|
1137
1163
|
; _slim_controls6 << (text);
|
1138
1164
|
; _slim_controls6 = _slim_controls6.join(""); end; _buf << (_slim_controls5); end; end; _buf = _buf.join("")
|
1139
1165
|
end
|
@@ -1199,7 +1225,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1199
1225
|
def embedded(node, opts = {})
|
1200
1226
|
node.extend(Helpers)
|
1201
1227
|
node.instance_eval do
|
1202
|
-
_buf = []; if !notitle &&
|
1228
|
+
_buf = []; if !notitle && header?;
|
1203
1229
|
; _buf << ("<h1"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (">"); _buf << (header.title);
|
1204
1230
|
; _buf << ("</h1>"); end; if node.sections? && (attr? :toc) && (attr 'toc-placement', 'auto') == 'auto';
|
1205
1231
|
; _buf << ("<nav id=\"toc\""); _temple_html_attributeremover1 = []; _slim_codeattributes2 = (document.attr 'toc-class', 'toc'); if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _buf << (" role=\"doc-toc\"><h2 id=\"toc-title\">");
|
@@ -1229,10 +1255,14 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1229
1255
|
node.extend(Helpers)
|
1230
1256
|
node.instance_eval do
|
1231
1257
|
_buf = []; _buf << ("<!DOCTYPE html><html");
|
1232
|
-
; _slim_codeattributes1 = (attr :lang, 'en' unless attr? :nolang); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" lang"); else; _buf << (" lang=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << ("
|
1258
|
+
; _slim_codeattributes1 = (attr :lang, 'en' unless attr? :nolang); if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" lang"); else; _buf << (" lang=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _buf << (">");
|
1259
|
+
;
|
1260
|
+
;
|
1233
1261
|
;
|
1234
|
-
; _slim_codeattributes2 = (attr :encoding, 'UTF-8'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" charset"); else; _buf << (" charset=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << ("><!--[if IE]><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><![endif]--><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta name=\"generator\" content=\"Asciidoctor ");
|
1235
1262
|
;
|
1263
|
+
; document_content = content;
|
1264
|
+
; _buf << ("<head><meta");
|
1265
|
+
; _slim_codeattributes2 = (attr :encoding, 'UTF-8'); if _slim_codeattributes2; if _slim_codeattributes2 == true; _buf << (" charset"); else; _buf << (" charset=\""); _buf << (_slim_codeattributes2); _buf << ("\""); end; end; _buf << ("><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta name=\"generator\" content=\"Asciidoctor ");
|
1236
1266
|
;
|
1237
1267
|
;
|
1238
1268
|
; _buf << (attr 'asciidoctor-version'); _buf << ("\">");
|
@@ -1248,10 +1278,14 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1248
1278
|
; end; _buf << ("</head><body");
|
1249
1279
|
;
|
1250
1280
|
;
|
1251
|
-
; _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes4 = [(attr :doctype),
|
1252
|
-
|
1281
|
+
; _slim_codeattributes3 = id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes4 = [(attr :doctype),
|
1282
|
+
("#{attr 'toc-class'} toc-#{attr 'toc-position', 'left'}" if (attr? 'toc-class') && (attr? :toc) && (attr? 'toc-placement', 'auto')),
|
1283
|
+
(attr :docrole) || (attr :role)]; if Array === _slim_codeattributes4; _slim_codeattributes4 = _slim_codeattributes4.flatten; _slim_codeattributes4.map!(&:to_s); _slim_codeattributes4.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes4.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes4); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes5 = style_value(max_width: (attr 'max-width')); if _slim_codeattributes5; if _slim_codeattributes5 == true; _buf << (" style"); else; _buf << (" style=\""); _buf << (_slim_codeattributes5); _buf << ("\""); end; end; _buf << (">");
|
1284
|
+
; unless (docinfo_content = (docinfo :header)).empty?;
|
1285
|
+
; _buf << (docinfo_content);
|
1286
|
+
; end; unless noheader;
|
1253
1287
|
; _buf << ("<header>");
|
1254
|
-
; if
|
1288
|
+
; if header?;
|
1255
1289
|
; unless notitle;
|
1256
1290
|
; _buf << ("<h1>"); _buf << (header.title);
|
1257
1291
|
; _buf << ("</h1>"); end; if [:author, :revnumber, :revdate, :revremark].any? {|a| attr? a };
|
@@ -1283,7 +1317,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1283
1317
|
; _buf << (converter.convert document, 'outline');
|
1284
1318
|
; _buf << ("</nav>");
|
1285
1319
|
; end;
|
1286
|
-
; _buf << ("</header>"); end; _buf << ("<div id=\"content\">"); _buf << (
|
1320
|
+
; _buf << ("</header>"); end; _buf << ("<div id=\"content\">"); _buf << (document_content);
|
1287
1321
|
; _buf << ("</div>"); unless !footnotes? || (attr? :nofootnotes);
|
1288
1322
|
; _buf << ("<section class=\"footnotes\" aria-label=\"Footnotes\" role=\"doc-endnotes\"><hr><ol class=\"footnotes\">");
|
1289
1323
|
;
|
@@ -1331,7 +1365,8 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1331
1365
|
;
|
1332
1366
|
;
|
1333
1367
|
;
|
1334
|
-
;
|
1368
|
+
;
|
1369
|
+
; _slim_controls2 << ("<video"); _slim_codeattributes6 = video_uri; if _slim_codeattributes6; if _slim_codeattributes6 == true; _slim_controls2 << (" src"); else; _slim_controls2 << (" src=\""); _slim_controls2 << (_slim_codeattributes6); _slim_controls2 << ("\""); end; end; _slim_codeattributes7 = (attr :width); if _slim_codeattributes7; if _slim_codeattributes7 == true; _slim_controls2 << (" width"); else; _slim_controls2 << (" width=\""); _slim_controls2 << (_slim_codeattributes7); _slim_controls2 << ("\""); end; end; _slim_codeattributes8 = (attr :height); if _slim_codeattributes8; if _slim_codeattributes8 == true; _slim_controls2 << (" height"); else; _slim_controls2 << (" height=\""); _slim_controls2 << (_slim_codeattributes8); _slim_controls2 << ("\""); end; end; _slim_codeattributes9 = (media_uri(attr :poster) if attr? :poster); if _slim_codeattributes9; if _slim_codeattributes9 == true; _slim_controls2 << (" poster"); else; _slim_controls2 << (" poster=\""); _slim_controls2 << (_slim_codeattributes9); _slim_controls2 << ("\""); end; end; _slim_codeattributes10 = (option? 'autoplay'); if _slim_codeattributes10; if _slim_codeattributes10 == true; _slim_controls2 << (" autoplay"); else; _slim_controls2 << (" autoplay=\""); _slim_controls2 << (_slim_codeattributes10); _slim_controls2 << ("\""); end; end; _slim_codeattributes11 = (option? 'muted'); if _slim_codeattributes11; if _slim_codeattributes11 == true; _slim_controls2 << (" muted"); else; _slim_controls2 << (" muted=\""); _slim_controls2 << (_slim_codeattributes11); _slim_controls2 << ("\""); end; end; _slim_codeattributes12 = !(option? 'nocontrols'); if _slim_codeattributes12; if _slim_codeattributes12 == true; _slim_controls2 << (" controls"); else; _slim_controls2 << (" controls=\""); _slim_controls2 << (_slim_codeattributes12); _slim_controls2 << ("\""); end; end; _slim_codeattributes13 = (option? 'loop'); if _slim_codeattributes13; if _slim_codeattributes13 == true; _slim_controls2 << (" loop"); else; _slim_controls2 << (" loop=\""); _slim_controls2 << (_slim_codeattributes13); _slim_controls2 << ("\""); end; end; _slim_controls2 << (">Your browser does not support the video tag.</video>");
|
1335
1370
|
;
|
1336
1371
|
; end; _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
1337
1372
|
end
|
@@ -1345,11 +1380,11 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1345
1380
|
; _slim_controls2 << ("<ul"); _temple_html_attributeremover1 = []; _slim_codeattributes1 = (checklist || style); if Array === _slim_codeattributes1; _slim_codeattributes1 = _slim_codeattributes1.flatten; _slim_codeattributes1.map!(&:to_s); _slim_codeattributes1.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes1.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes1); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover1); _slim_controls2 << ("\""); end; _slim_controls2 << (">");
|
1346
1381
|
; items.each do |item|;
|
1347
1382
|
; if checklist && (item.attr? :checkbox);
|
1348
|
-
; _slim_controls2 << ("<li
|
1349
|
-
;
|
1383
|
+
; _slim_controls2 << ("<li"); _temple_html_attributeremover2 = []; _temple_html_attributemerger1 = []; _temple_html_attributemerger1[0] = "task-list-item"; _temple_html_attributemerger1[1] = []; _slim_codeattributes2 = item.role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributemerger1[1] << (_slim_codeattributes2.join(" ")); else; _temple_html_attributemerger1[1] << (_slim_codeattributes2); end; _temple_html_attributemerger1[1] = _temple_html_attributemerger1[1].join(""); _temple_html_attributeremover2 << (_temple_html_attributemerger1.reject(&:empty?).join(" ")); _temple_html_attributeremover2 = _temple_html_attributeremover2.join(""); if !_temple_html_attributeremover2.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover2); _slim_controls2 << ("\""); end; _slim_codeattributes3 = item.id; if _slim_codeattributes3; if _slim_codeattributes3 == true; _slim_controls2 << (" id"); else; _slim_controls2 << (" id=\""); _slim_controls2 << (_slim_codeattributes3); _slim_controls2 << ("\""); end; end; _slim_controls2 << ("><input class=\"task-list-item-checkbox\" type=\"checkbox\" disabled");
|
1384
|
+
; _slim_codeattributes4 = (item.attr? :checked); if _slim_codeattributes4; if _slim_codeattributes4 == true; _slim_controls2 << (" checked"); else; _slim_controls2 << (" checked=\""); _slim_controls2 << (_slim_codeattributes4); _slim_controls2 << ("\""); end; end; _slim_controls2 << ("> ");
|
1350
1385
|
; _slim_controls2 << (item.text);
|
1351
1386
|
; _slim_controls2 << ("</li>"); else;
|
1352
|
-
; _slim_controls2 << ("<li>");
|
1387
|
+
; _slim_controls2 << ("<li"); _slim_codeattributes5 = item.id; if _slim_codeattributes5; if _slim_codeattributes5 == true; _slim_controls2 << (" id"); else; _slim_controls2 << (" id=\""); _slim_controls2 << (_slim_codeattributes5); _slim_controls2 << ("\""); end; end; _temple_html_attributeremover3 = []; _slim_codeattributes6 = item.role; if Array === _slim_codeattributes6; _slim_codeattributes6 = _slim_codeattributes6.flatten; _slim_codeattributes6.map!(&:to_s); _slim_codeattributes6.reject!(&:empty?); _temple_html_attributeremover3 << (_slim_codeattributes6.join(" ")); else; _temple_html_attributeremover3 << (_slim_codeattributes6); end; _temple_html_attributeremover3 = _temple_html_attributeremover3.join(""); if !_temple_html_attributeremover3.empty?; _slim_controls2 << (" class=\""); _slim_controls2 << (_temple_html_attributeremover3); _slim_controls2 << ("\""); end; _slim_controls2 << (">");
|
1353
1388
|
; _slim_controls2 << ((print_item_content item));
|
1354
1389
|
; _slim_controls2 << ("</li>"); end; end; _slim_controls2 << ("</ul>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
1355
1390
|
end
|
@@ -1442,7 +1477,7 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1442
1477
|
; _buf << ("<ol class=\"toc-list level-"); _buf << (slevel); _buf << ("\">");
|
1443
1478
|
; sections.each do |sec|;
|
1444
1479
|
; _buf << ("<li><a href=\"#");
|
1445
|
-
; _buf << (sec.id); _buf << ("\">"); _buf << (section_title sec);
|
1480
|
+
; _buf << (sec.id); _buf << ("\">"); _buf << ((section_title sec, drop_anchors: true));
|
1446
1481
|
; _buf << ("</a>"); if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline');
|
1447
1482
|
; _buf << (child_toc);
|
1448
1483
|
; end; _buf << ("</li>"); end; _buf << ("</ol>"); end; _buf = _buf.join("")
|
@@ -1452,10 +1487,18 @@ class Asciidoctor::Html5s::Converter < ::Asciidoctor::Converter::Base
|
|
1452
1487
|
def example(node, opts = {})
|
1453
1488
|
node.extend(Helpers)
|
1454
1489
|
node.instance_eval do
|
1455
|
-
_buf = [];
|
1490
|
+
_buf = []; if option? :collapsible;
|
1491
|
+
; _buf << ("<details"); _slim_codeattributes1 = id; if _slim_codeattributes1; if _slim_codeattributes1 == true; _buf << (" id"); else; _buf << (" id=\""); _buf << (_slim_codeattributes1); _buf << ("\""); end; end; _temple_html_attributeremover1 = []; _slim_codeattributes2 = role; if Array === _slim_codeattributes2; _slim_codeattributes2 = _slim_codeattributes2.flatten; _slim_codeattributes2.map!(&:to_s); _slim_codeattributes2.reject!(&:empty?); _temple_html_attributeremover1 << (_slim_codeattributes2.join(" ")); else; _temple_html_attributeremover1 << (_slim_codeattributes2); end; _temple_html_attributeremover1 = _temple_html_attributeremover1.join(""); if !_temple_html_attributeremover1.empty?; _buf << (" class=\""); _buf << (_temple_html_attributeremover1); _buf << ("\""); end; _slim_codeattributes3 = (option? :open); if _slim_codeattributes3; if _slim_codeattributes3 == true; _buf << (" open"); else; _buf << (" open=\""); _buf << (_slim_codeattributes3); _buf << ("\""); end; end; _buf << (">");
|
1492
|
+
; if title;
|
1493
|
+
; _buf << ("<summary>");
|
1494
|
+
; _buf << (title);
|
1495
|
+
; _buf << ("</summary>"); end; _buf << ("<div class=\"content\">");
|
1496
|
+
; _buf << (content);
|
1497
|
+
; _buf << ("</div></details>"); else;
|
1498
|
+
; _slim_controls1 = block_with_caption :top, :class=>'example-block' do; _slim_controls2 = [];
|
1456
1499
|
; _slim_controls2 << ("<div class=\"example\">");
|
1457
1500
|
; _slim_controls2 << (content);
|
1458
|
-
; _slim_controls2 << ("</div>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); _buf = _buf.join("")
|
1501
|
+
; _slim_controls2 << ("</div>"); _slim_controls2 = _slim_controls2.join(""); end; _buf << (_slim_controls1); end; _buf = _buf.join("")
|
1459
1502
|
end
|
1460
1503
|
end
|
1461
1504
|
|