asciidoctor-revealjs 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.adoc +46 -0
- data/HACKING.adoc +250 -0
- data/LICENSE.adoc +22 -0
- data/README.adoc +671 -0
- data/asciidoctor-revealjs.gemspec +32 -0
- data/bin/asciidoctor-revealjs +20 -0
- data/lib/asciidoctor-revealjs.rb +2 -0
- data/lib/asciidoctor-revealjs/converter.rb +36 -0
- data/lib/asciidoctor-revealjs/version.rb +5 -0
- data/templates/jade/admonition.jade +17 -0
- data/templates/jade/audio.jade +6 -0
- data/templates/jade/colist.jade +22 -0
- data/templates/jade/dlist.jade +60 -0
- data/templates/jade/document.jade +103 -0
- data/templates/jade/embedded.jade +11 -0
- data/templates/jade/example.jade +4 -0
- data/templates/jade/floating_title.jade +2 -0
- data/templates/jade/image.jade +12 -0
- data/templates/jade/inline_anchor.jade +9 -0
- data/templates/jade/inline_break.jade +2 -0
- data/templates/jade/inline_button.jade +1 -0
- data/templates/jade/inline_callout.jade +9 -0
- data/templates/jade/inline_image.jade +24 -0
- data/templates/jade/inline_indexterm.jade +2 -0
- data/templates/jade/inline_kbd.jade +9 -0
- data/templates/jade/inline_quoted.jade +26 -0
- data/templates/jade/listing.jade +29 -0
- data/templates/jade/literal.jade +5 -0
- data/templates/jade/olist.jade +9 -0
- data/templates/jade/page_break.jade +1 -0
- data/templates/jade/paragraph.jade +7 -0
- data/templates/jade/pass.jade +1 -0
- data/templates/jade/quote.jade +11 -0
- data/templates/jade/ruler.jade +1 -0
- data/templates/jade/section.jade +15 -0
- data/templates/jade/sidebar.jade +5 -0
- data/templates/jade/table.jade +45 -0
- data/templates/jade/thematic_break.jade +1 -0
- data/templates/jade/ulist.jade +25 -0
- data/templates/jade/verse.jade +14 -0
- data/templates/jade/video.jade +30 -0
- data/templates/slim/block_admonition.html.slim +18 -0
- data/templates/slim/block_audio.html.slim +6 -0
- data/templates/slim/block_colist.html.slim +20 -0
- data/templates/slim/block_dlist.html.slim +53 -0
- data/templates/slim/block_example.html.slim +4 -0
- data/templates/slim/block_floating_title.html.slim +1 -0
- data/templates/slim/block_image.html.slim +21 -0
- data/templates/slim/block_listing.html.slim +33 -0
- data/templates/slim/block_literal.html.slim +4 -0
- data/templates/slim/block_olist.html.slim +9 -0
- data/templates/slim/block_open.html.slim +15 -0
- data/templates/slim/block_page_break.html.slim +1 -0
- data/templates/slim/block_paragraph.html.slim +7 -0
- data/templates/slim/block_pass.html.slim +1 -0
- data/templates/slim/block_preamble.html.slim +2 -0
- data/templates/slim/block_quote.html.slim +14 -0
- data/templates/slim/block_ruler.html.slim +1 -0
- data/templates/slim/block_sidebar.html.slim +5 -0
- data/templates/slim/block_stem.html.slim +10 -0
- data/templates/slim/block_table.html.slim +45 -0
- data/templates/slim/block_thematic_break.html.slim +1 -0
- data/templates/slim/block_toc.html.slim +12 -0
- data/templates/slim/block_ulist.html.slim +25 -0
- data/templates/slim/block_verse.html.slim +14 -0
- data/templates/slim/block_video.html.slim +40 -0
- data/templates/slim/document.html.slim +184 -0
- data/templates/slim/embedded.html.slim +9 -0
- data/templates/slim/helpers.rb +34 -0
- data/templates/slim/inline_anchor.html.slim +11 -0
- data/templates/slim/inline_break.html.slim +2 -0
- data/templates/slim/inline_button.html.slim +1 -0
- data/templates/slim/inline_callout.html.slim +7 -0
- data/templates/slim/inline_footnote.html.slim +6 -0
- data/templates/slim/inline_image.html.slim +24 -0
- data/templates/slim/inline_indexterm.html.slim +2 -0
- data/templates/slim/inline_kbd.html.slim +8 -0
- data/templates/slim/inline_menu.html.slim +15 -0
- data/templates/slim/inline_quoted.html.slim +22 -0
- data/templates/slim/section.html.slim +89 -0
- data/templates/slim/section.html.slim.orig +97 -0
- metadata +186 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
.quoteblock id=@id class=role
|
2
|
+
- if title?
|
3
|
+
.title=title
|
4
|
+
blockquote=content
|
5
|
+
- attribution = (attr? :attribution) ? (attr :attribution) : nil
|
6
|
+
- citetitle = (attr? :citetitle) ? (attr :citetitle) : nil
|
7
|
+
- if attribution || citetitle
|
8
|
+
.attribution
|
9
|
+
- if citetitle
|
10
|
+
cite=citetitle
|
11
|
+
- if attribution
|
12
|
+
- if citetitle
|
13
|
+
br
|
14
|
+
| — #{attribution}
|
@@ -0,0 +1 @@
|
|
1
|
+
hr
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- open, close = Asciidoctor::BLOCK_MATH_DELIMITERS[@style.to_sym]
|
2
|
+
- equation = content.strip
|
3
|
+
- if (@subs.nil? || @subs.empty?) && !(attr? 'subs')
|
4
|
+
- equation = sub_specialcharacters equation
|
5
|
+
- unless (equation.start_with? open) && (equation.end_with? close)
|
6
|
+
- equation = %(#{open}#{equation}#{close})
|
7
|
+
.stemblock id=@id class=role
|
8
|
+
- if title?
|
9
|
+
.title=title
|
10
|
+
.content=equation
|
@@ -0,0 +1,45 @@
|
|
1
|
+
table(id=@id class=['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :grid, 'all'}",role]
|
2
|
+
style=[("width:#{attr :tablepcwidth}%" unless option? 'autowidth'),("float:#{attr :float}" if attr? :float)].compact.join('; '))
|
3
|
+
- if title?
|
4
|
+
caption.title=captioned_title
|
5
|
+
- unless (attr :rowcount).zero?
|
6
|
+
colgroup
|
7
|
+
- if option? 'autowidth'
|
8
|
+
- @columns.each do
|
9
|
+
col
|
10
|
+
- else
|
11
|
+
- @columns.each do |col|
|
12
|
+
col style="width:#{col.attr :colpcwidth}%"
|
13
|
+
- [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|
|
14
|
+
*{:tag=>"t#{tblsec}"}
|
15
|
+
- @rows[tblsec].each do |row|
|
16
|
+
tr
|
17
|
+
- row.each do |cell|
|
18
|
+
/ store reference of content in advance to resolve attribute assignments in cells
|
19
|
+
- if tblsec == :head
|
20
|
+
- cell_content = cell.text
|
21
|
+
- else
|
22
|
+
- case cell.style
|
23
|
+
- when :verse, :literal
|
24
|
+
- cell_content = cell.text
|
25
|
+
- else
|
26
|
+
- cell_content = cell.content
|
27
|
+
*{:tag=>(tblsec == :head ? 'th' : 'td'), :class=>['tableblock',"halign-#{cell.attr :halign}","valign-#{cell.attr :valign}"],
|
28
|
+
:colspan=>cell.colspan, :rowspan=>cell.rowspan,
|
29
|
+
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)}
|
30
|
+
- if tblsec == :head
|
31
|
+
=cell_content
|
32
|
+
- else
|
33
|
+
- case cell.style
|
34
|
+
- when :asciidoc
|
35
|
+
div=cell_content
|
36
|
+
- when :verse
|
37
|
+
.verse=cell_content
|
38
|
+
- when :literal
|
39
|
+
.literal: pre=cell_content
|
40
|
+
- when :header
|
41
|
+
- cell_content.each do |text|
|
42
|
+
p.tableblock.header=text
|
43
|
+
- else
|
44
|
+
- cell_content.each do |text|
|
45
|
+
p.tableblock=text
|
@@ -0,0 +1 @@
|
|
1
|
+
hr
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- if @document.attr? :toc
|
2
|
+
- toc_id = @id
|
3
|
+
- toc_role = (attr 'role', (@document.attr 'toc-class', 'toc'))
|
4
|
+
- toc_title_id = nil
|
5
|
+
- toc_title = title? ? title : (@document.attr 'toc-title')
|
6
|
+
- toc_levels = (attr? :levels) ? (attr :levels).to_i : (@document.attr :toclevels, 2).to_i
|
7
|
+
- if !toc_id && (@document.embedded? || !(@document.attr? 'toc-placement'))
|
8
|
+
- toc_id = 'toc'
|
9
|
+
- toc_title_id = 'toctitle'
|
10
|
+
div id=toc_id class=toc_role
|
11
|
+
.title id=toc_title_id =toc_title
|
12
|
+
=Asciidoctor::HTML5::DocumentTemplate.outline(@document, toc_levels)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- if (checklist = (option? :checklist) ? 'checklist' : nil)
|
2
|
+
- if option? :interactive
|
3
|
+
- marker_checked = '<input type="checkbox" data-item-complete="1" checked>'
|
4
|
+
- marker_unchecked = '<input type="checkbox" data-item-complete="0">'
|
5
|
+
- else
|
6
|
+
- if @document.attr? :icons, 'font'
|
7
|
+
- marker_checked = '<i class="icon-check"></i>'
|
8
|
+
- marker_unchecked = '<i class="icon-check-empty"></i>'
|
9
|
+
- else
|
10
|
+
/ could use ☑ (checked ballot) and ☐ (ballot) w/o font instead
|
11
|
+
- marker_checked = '<input type="checkbox" data-item-complete="1" checked disabled>'
|
12
|
+
- marker_unchecked = '<input type="checkbox" data-item-complete="0" disabled>'
|
13
|
+
.ulist id=@id class=[checklist,@style,role]
|
14
|
+
- if title?
|
15
|
+
.title=title
|
16
|
+
ul class=(checklist || @style)
|
17
|
+
- items.each do |item|
|
18
|
+
li class=('fragment' if (option? :step) || (has_role? 'step'))
|
19
|
+
p
|
20
|
+
- if checklist && (item.attr? :checkbox)
|
21
|
+
=%(#{(item.attr? :checked) ? marker_checked : marker_unchecked}#{item.text})
|
22
|
+
- else
|
23
|
+
=item.text
|
24
|
+
- if item.blocks?
|
25
|
+
=item.content
|
@@ -0,0 +1,14 @@
|
|
1
|
+
.verseblock id=@id class=role
|
2
|
+
- if title?
|
3
|
+
.title=title
|
4
|
+
pre.content=content
|
5
|
+
- attribution = (attr? :attribution) ? (attr :attribution) : nil
|
6
|
+
- citetitle = (attr? :citetitle) ? (attr :citetitle) : nil
|
7
|
+
- if attribution || citetitle
|
8
|
+
.attribution
|
9
|
+
- if citetitle
|
10
|
+
cite=citetitle
|
11
|
+
- if attribution
|
12
|
+
- if citetitle
|
13
|
+
br
|
14
|
+
| — #{attribution}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
/ in a slide-deck context we assume video should take as much place as possible
|
2
|
+
/ unless already specified
|
3
|
+
- no_stretch = ((attr? :width) || (attr? :height))
|
4
|
+
- width = (attr? :width) ? (attr :width) : "100%"
|
5
|
+
- height = (attr? :height) ? (attr :height) : "100%"
|
6
|
+
/ we apply revealjs stretch class to the videoblock take all the place we can
|
7
|
+
.videoblock id=@id class=[@style,role,(no_stretch ? nil : "stretch")]
|
8
|
+
- if title?
|
9
|
+
.title=captioned_title
|
10
|
+
- case attr :poster
|
11
|
+
- when 'vimeo'
|
12
|
+
- unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?
|
13
|
+
- asset_uri_scheme = %(#{asset_uri_scheme}:)
|
14
|
+
- start_anchor = (attr? :start) ? "#at=#{attr :start}" : nil
|
15
|
+
- delimiter = '?'
|
16
|
+
- loop_param = (option? 'loop') ? "#{delimiter}loop=1" : nil
|
17
|
+
- src = %(#{asset_uri_scheme}//player.vimeo.com/video/#{attr :target}#{start_anchor}#{loop_param})
|
18
|
+
iframe(width=(width) height=(height) src=src frameborder=0
|
19
|
+
webkitAllowFullScreen=true mozallowfullscreen=true allowFullScreen=true
|
20
|
+
data-autoplay=(option? 'autoplay'))
|
21
|
+
/ data-autoplay is not supported on vimeo videos
|
22
|
+
/ upstream: https://github.com/hakimel/reveal.js/issues/388
|
23
|
+
- when 'youtube'
|
24
|
+
- unless (asset_uri_scheme = (attr :asset_uri_scheme, 'https')).empty?
|
25
|
+
- asset_uri_scheme = %(#{asset_uri_scheme}:)
|
26
|
+
- params = ['rel=0']
|
27
|
+
- params << "start=#{attr :start}" if attr? :start
|
28
|
+
- params << "end=#{attr :end}" if attr? :end
|
29
|
+
- params << "loop=1" if option? 'loop'
|
30
|
+
- params << "controls=0" if option? 'nocontrols'
|
31
|
+
- src = %(#{asset_uri_scheme}//www.youtube.com/embed/#{attr :target}?#{params * '&'})
|
32
|
+
iframe(width=(width) height=(height) src=src
|
33
|
+
frameborder=0 allowfullscreen=!(option? 'nofullscreen')
|
34
|
+
data-autoplay=(option? 'autoplay'))
|
35
|
+
- else
|
36
|
+
video(src=media_uri(attr :target) width=(width) height=(height)
|
37
|
+
poster=((attr :poster) ? media_uri(attr :poster) : nil)
|
38
|
+
data-autoplay=(option? 'autoplay') controls=!(option? 'nocontrols')
|
39
|
+
loop=(option? 'loop'))
|
40
|
+
|Your browser does not support the video tag.
|
@@ -0,0 +1,184 @@
|
|
1
|
+
doctype 5
|
2
|
+
html lang=(attr :lang, 'en' unless attr? :nolang)
|
3
|
+
head
|
4
|
+
meta charset="utf-8"
|
5
|
+
- revealjsdir = (attr :revealjsdir, 'reveal.js')
|
6
|
+
- unless (asset_uri_scheme = (attr 'asset-uri-scheme', 'https')).empty?
|
7
|
+
- asset_uri_scheme = %(#{asset_uri_scheme}:)
|
8
|
+
- cdn_base = %(#{asset_uri_scheme}//cdnjs.cloudflare.com/ajax/libs)
|
9
|
+
- [:description, :keywords, :author, :copyright].each do |key|
|
10
|
+
- if attr? key
|
11
|
+
meta name=key content=(attr key)
|
12
|
+
title=(doctitle sanitize: true, use_fallback: true)
|
13
|
+
meta content="yes" name="apple-mobile-web-app-capable"
|
14
|
+
meta content="black-translucent" name="apple-mobile-web-app-status-bar-style"
|
15
|
+
meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" name="viewport"
|
16
|
+
link href="#{revealjsdir}/css/reveal.css" rel="stylesheet"
|
17
|
+
/ Default theme required even when using custom theme
|
18
|
+
- if attr? :revealjs_customtheme
|
19
|
+
link rel='stylesheet' href=(attr :revealjs_customtheme) id='theme'
|
20
|
+
- else
|
21
|
+
link rel='stylesheet' href='#{revealjsdir}/css/theme/#{attr 'revealjs_theme', 'black'}.css' id='theme'
|
22
|
+
- if attr? :icons, 'font'
|
23
|
+
- if attr? 'iconfont-remote'
|
24
|
+
link rel='stylesheet' href=(attr 'iconfont-cdn', %(#{cdn_base}/font-awesome/4.3.0/css/font-awesome.min.css))
|
25
|
+
- else
|
26
|
+
link rel='stylesheet' href=(normalize_web_path %(#{attr 'iconfont-name', 'font-awesome'}.css), (attr 'stylesdir', ''), false)
|
27
|
+
- if attr? :stem
|
28
|
+
- eqnums_val = (attr 'eqnums', 'none')
|
29
|
+
- eqnums_val = 'AMS' if eqnums_val == ''
|
30
|
+
- eqnums_opt = %( equationNumbers: { autoNumber: "#{eqnums_val}" } )
|
31
|
+
script type='text/x-mathjax-config'
|
32
|
+
| MathJax.Hub.Config({
|
33
|
+
tex2jax: {
|
34
|
+
inlineMath: [#{Asciidoctor::INLINE_MATH_DELIMITERS[:latexmath].to_s}],
|
35
|
+
displayMath: [#{Asciidoctor::BLOCK_MATH_DELIMITERS[:latexmath].to_s}],
|
36
|
+
ignoreClass: "nostem|nolatexmath"
|
37
|
+
},
|
38
|
+
asciimath2jax: {
|
39
|
+
delimiters: [#{Asciidoctor::BLOCK_MATH_DELIMITERS[:asciimath].to_s}],
|
40
|
+
ignoreClass: "nostem|noasciimath"
|
41
|
+
},
|
42
|
+
TeX: {#{eqnums_opt}}
|
43
|
+
});
|
44
|
+
script src='#{cdn_base}/mathjax/2.4.0/MathJax.js?config=TeX-MML-AM_HTMLorMML'
|
45
|
+
- case attr 'source-highlighter'
|
46
|
+
- when 'coderay'
|
47
|
+
- if (attr 'coderay-css', 'class') == 'class'
|
48
|
+
- if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss)
|
49
|
+
link rel='stylesheet' href=normalize_web_path('asciidoctor-coderay.css', (attr :stylesdir, ''))
|
50
|
+
- else
|
51
|
+
style=Asciidoctor::Stylesheets.instance.coderay_stylesheet_data
|
52
|
+
- when 'pygments'
|
53
|
+
- if (attr 'pygments-css', 'class') == 'class'
|
54
|
+
- if @safe >= Asciidoctor::SafeMode::SECURE || (attr? :linkcss)
|
55
|
+
link rel='stylesheet' href=normalize_web_path('asciidoctor-pygments.css', (attr :stylesdir, ''))
|
56
|
+
- else
|
57
|
+
style=Asciidoctor::Stylesheets.instance.pygments_stylesheet_data(attr 'pygments-style')
|
58
|
+
/ For syntax highlighting
|
59
|
+
- if attr? 'highlightjs-theme'
|
60
|
+
link href=(attr 'highlightjs-theme') rel="stylesheet"
|
61
|
+
- else
|
62
|
+
link href="#{revealjsdir}/lib/css/zenburn.css" rel="stylesheet"
|
63
|
+
/ If the query includes 'print-pdf', use the PDF print sheet
|
64
|
+
javascript:
|
65
|
+
document.write( '<link rel="stylesheet" href="#{revealjsdir}/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
|
66
|
+
- unless (docinfo_content = docinfo :header, '.html').empty?
|
67
|
+
=docinfo_content
|
68
|
+
- if attr? :customcss
|
69
|
+
link rel='stylesheet' href=((customcss = attr :customcss).empty? ? 'asciidoctor-revealjs.css' : customcss)
|
70
|
+
body
|
71
|
+
.reveal
|
72
|
+
/ Any section element inside of this container is displayed as a slide
|
73
|
+
.slides
|
74
|
+
- unless notitle || !has_header?
|
75
|
+
- bg_image = (attr? 'title-slide-background-image') ? (image_uri(attr 'title-slide-background-image')) : nil
|
76
|
+
- bg_video = (attr? 'title-slide-background-video') ? (media_uri(attr 'title-slide-background-video')) : nil
|
77
|
+
section.title(class = role
|
78
|
+
data-transition=(attr 'title-slide-transition')
|
79
|
+
data-transition-speed=(attr 'title-slide-transition-speed')
|
80
|
+
data-background=(attr 'title-slide-background')
|
81
|
+
data-background-size=(attr 'title-slide-background-size')
|
82
|
+
data-background-image=bg_image
|
83
|
+
data-background-video=bg_video
|
84
|
+
data-background-video-loop=(attr 'title-slide-background-video-loop')
|
85
|
+
data-background-video-muted=(attr 'title-slide-background-video-muted')
|
86
|
+
data-background-iframe=(attr 'title-slide-background-iframe')
|
87
|
+
data-background-color=(attr 'title-slide-background-color')
|
88
|
+
data-background-repeat=(attr 'title-slide-background-repeat')
|
89
|
+
data-background-position=(attr 'title-slide-background-position')
|
90
|
+
data-background-transition=(attr 'title-slide-background-transition'))
|
91
|
+
- if (_title_obj = doctitle partition: true, use_fallback: true).subtitle?
|
92
|
+
h1=slice_text _title_obj.title, (_slice = header.option? :slice)
|
93
|
+
h2=slice_text _title_obj.subtitle, _slice
|
94
|
+
- else
|
95
|
+
h1=@header.title
|
96
|
+
- preamble = @document.find_by context: :preamble
|
97
|
+
- unless preamble.nil? or preamble.length == 0
|
98
|
+
div.preamble=preamble.pop.content
|
99
|
+
- unless author.nil?
|
100
|
+
p.author: small=author
|
101
|
+
=content
|
102
|
+
script src="#{revealjsdir}/lib/js/head.min.js"
|
103
|
+
script src="#{revealjsdir}/js/reveal.js"
|
104
|
+
javascript:
|
105
|
+
// See https://github.com/hakimel/reveal.js#configuration for a full list of configuration options
|
106
|
+
Reveal.initialize({
|
107
|
+
// Display controls in the bottom right corner
|
108
|
+
controls: #{attr 'revealjs_controls', 'true'},
|
109
|
+
// Display a presentation progress bar
|
110
|
+
progress: #{attr 'revealjs_progress', 'true'},
|
111
|
+
// Display the page number of the current slide
|
112
|
+
slideNumber: #{attr 'revealjs_slidenumber', 'false'},
|
113
|
+
// Push each slide change to the browser history
|
114
|
+
history: #{attr 'revealjs_history', 'false'},
|
115
|
+
// Enable keyboard shortcuts for navigation
|
116
|
+
keyboard: #{attr 'revealjs_keyboard', 'true'},
|
117
|
+
// Enable the slide overview mode
|
118
|
+
overview: #{attr 'revealjs_overview', 'true'},
|
119
|
+
// Vertical centering of slides
|
120
|
+
center: #{attr 'revealjs_center', 'true'},
|
121
|
+
// Enables touch navigation on devices with touch input
|
122
|
+
touch: #{attr 'revealjs_touch', 'true'},
|
123
|
+
// Loop the presentation
|
124
|
+
loop: #{attr 'revealjs_loop', 'false'},
|
125
|
+
// Change the presentation direction to be RTL
|
126
|
+
rtl: #{attr 'revealjs_rtl', 'false'},
|
127
|
+
// Turns fragments on and off globally
|
128
|
+
fragments: #{attr 'revealjs_fragments', 'true'},
|
129
|
+
// Flags if the presentation is running in an embedded mode,
|
130
|
+
// i.e. contained within a limited portion of the screen
|
131
|
+
embedded: #{attr 'revealjs_embedded', 'false'},
|
132
|
+
// Number of milliseconds between automatically proceeding to the
|
133
|
+
// next slide, disabled when set to 0, this value can be overwritten
|
134
|
+
// by using a data-autoslide attribute on your slides
|
135
|
+
autoSlide: #{attr 'revealjs_autoslide', 0},
|
136
|
+
// Stop auto-sliding after user input
|
137
|
+
autoSlideStoppable: #{attr 'revealjs_autoslidestoppable', 'true'},
|
138
|
+
// Enable slide navigation via mouse wheel
|
139
|
+
mouseWheel: #{attr 'revealjs_mousewheel', 'false'},
|
140
|
+
// Hides the address bar on mobile devices
|
141
|
+
hideAddressBar: #{attr 'revealjs_hideaddressbar', 'true'},
|
142
|
+
// Opens links in an iframe preview overlay
|
143
|
+
previewLinks: #{attr 'revealjs_previewlinks', 'false'},
|
144
|
+
// Theme (e.g., beige, black, league, night, serif, simple, sky, solarized, white)
|
145
|
+
// NOTE setting the theme in the config no longer works in reveal.js 3.x
|
146
|
+
//theme: Reveal.getQueryHash().theme || '#{attr 'revealjs_theme', 'black'}',
|
147
|
+
// Transition style (e.g., none, fade, slide, convex, concave, zoom)
|
148
|
+
transition: Reveal.getQueryHash().transition || '#{attr 'revealjs_transition', 'slide'}',
|
149
|
+
// Transition speed (e.g., default, fast, slow)
|
150
|
+
transitionSpeed: '#{attr 'revealjs_transitionspeed', 'default'}',
|
151
|
+
// Transition style for full page slide backgrounds (e.g., none, fade, slide, convex, concave, zoom)
|
152
|
+
backgroundTransition: '#{attr 'revealjs_backgroundtransition', 'fade'}',
|
153
|
+
// Number of slides away from the current that are visible
|
154
|
+
viewDistance: #{attr 'revealjs_viewdistance', 3},
|
155
|
+
// Parallax background image (e.g., "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'")
|
156
|
+
parallaxBackgroundImage: '#{attr 'revealjs_parallaxbackgroundimage', ''}',
|
157
|
+
// Parallax background size in CSS syntax (e.g., "2100px 900px")
|
158
|
+
parallaxBackgroundSize: '#{attr 'revealjs_parallaxbackgroundsize', ''}',
|
159
|
+
|
160
|
+
// The "normal" size of the presentation, aspect ratio will be preserved
|
161
|
+
// when the presentation is scaled to fit different resolutions. Can be
|
162
|
+
// specified using percentage units.
|
163
|
+
width: #{attr 'revealjs_width', 960},
|
164
|
+
height: #{attr 'revealjs_height', 700},
|
165
|
+
|
166
|
+
// Factor of the display size that should remain empty around the content
|
167
|
+
margin: #{attr 'revealjs_margin', 0.1},
|
168
|
+
|
169
|
+
// Bounds for smallest/largest possible scale to apply to content
|
170
|
+
minScale: #{attr 'revealjs_minscale', 0.2},
|
171
|
+
maxScale: #{attr 'revealjs_maxscale', 1.5},
|
172
|
+
|
173
|
+
// Optional libraries used to extend on reveal.js
|
174
|
+
dependencies: [
|
175
|
+
{ src: '#{revealjsdir}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
176
|
+
{ src: '#{revealjsdir}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
177
|
+
{ src: '#{revealjsdir}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
178
|
+
#{(attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : nil}
|
179
|
+
{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
|
180
|
+
{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
|
181
|
+
]
|
182
|
+
});
|
183
|
+
- unless (docinfo_content = (docinfo :footer, '.html')).empty?
|
184
|
+
=docinfo_content
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- unless notitle || !has_header?
|
2
|
+
h1 id=@id =@header.title
|
3
|
+
=content
|
4
|
+
- unless !footnotes? || attr?(:nofootnotes)
|
5
|
+
#footnotes
|
6
|
+
hr
|
7
|
+
- footnotes.each do |fn|
|
8
|
+
.footnote id='_footnote_#{fn.index}'
|
9
|
+
<a href="#_footnoteref_#{fn.index}">#{fn.index}</a>. #{fn.text}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# This helper file borrows from the Bespoke converter
|
2
|
+
# https://github.com/asciidoctor/asciidoctor-bespoke
|
3
|
+
require 'asciidoctor'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
if Gem::Version.new(Asciidoctor::VERSION) <= Gem::Version.new('1.5.3')
|
7
|
+
fail 'asciidoctor: FAILED: reveal.js backend needs Asciidoctor >=1.5.4!'
|
8
|
+
end
|
9
|
+
|
10
|
+
unless defined? Slim::Include
|
11
|
+
fail 'asciidoctor: FAILED: reveal.js backend needs Slim >= 2.1.0!'
|
12
|
+
end
|
13
|
+
|
14
|
+
# This module gets mixed in to every node (the context of the template) at the
|
15
|
+
# time the node is being converted. The properties and methods in this module
|
16
|
+
# effectively become direct members of the template.
|
17
|
+
module Slim::Helpers
|
18
|
+
|
19
|
+
EOL = %(\n)
|
20
|
+
SliceHintRx = / +/
|
21
|
+
|
22
|
+
def slice_text str, active = nil
|
23
|
+
if (active || (active.nil? && (option? :slice))) && (str.include? ' ')
|
24
|
+
(str.split SliceHintRx).map {|line| %(<span class="line">#{line}</span>) }.join EOL
|
25
|
+
else
|
26
|
+
str
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
# More custom functions can be added in another namespace if required
|
33
|
+
#module Helpers
|
34
|
+
#end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- case @type
|
2
|
+
- when :xref
|
3
|
+
- refid = (attr :refid) || @target
|
4
|
+
a href=@target =(@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')
|
5
|
+
- when :ref
|
6
|
+
a id=@target
|
7
|
+
- when :bibref
|
8
|
+
a id=@target
|
9
|
+
|[#{@target}]
|
10
|
+
- else
|
11
|
+
a href=@target class=role target=(attr :window) =@text
|
@@ -0,0 +1 @@
|
|
1
|
+
b.button=@text
|
@@ -0,0 +1,6 @@
|
|
1
|
+
- if @type == :xref
|
2
|
+
span.footnoteref
|
3
|
+
| [<a class="footnote" href="#_footnote_#{attr :index}" title="View footnote.">#{attr :index}</a>]
|
4
|
+
- else
|
5
|
+
span.footnote id=("_footnote_#{@id}" if @id)
|
6
|
+
| [<a id="_footnoteref_#{attr :index}" class="footnote" href="#_footnote_#{attr :index}" title="View footnote.">#{attr :index}</a>]
|