asciidoctor-revealjs 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +40 -9
- data/Gemfile +4 -0
- data/HACKING.adoc +104 -39
- data/LICENSE.adoc +1 -1
- data/README.adoc +57 -27
- data/Rakefile +114 -0
- data/asciidoctor-revealjs.gemspec +13 -4
- data/examples/README.adoc +17 -0
- data/examples/admonitions-icons.adoc +37 -0
- data/examples/admonitions.adoc +38 -0
- data/examples/concealed-slide-titles.adoc +20 -0
- data/examples/customcss.adoc +9 -0
- data/examples/customcss.css +8 -0
- data/examples/data-background-newstyle.adoc +63 -0
- data/examples/data-background-oldstyle.adoc +44 -0
- data/examples/history-regression-tests.adoc +34 -0
- data/examples/history.adoc +19 -0
- data/examples/images.adoc +19 -0
- data/examples/images/70s.jpg +0 -0
- data/examples/images/bio.jpg +0 -0
- data/examples/images/cover.jpg +0 -0
- data/examples/images/meme-2.jpg +0 -0
- data/examples/images/meme-7.png +0 -0
- data/examples/images/web_surfing_time.gif +0 -0
- data/examples/keyboard-shortcuts.adoc +24 -0
- data/examples/level-sections.adoc +44 -0
- data/examples/multi-destination-content.adoc +66 -0
- data/examples/revealjs-stretch.adoc +22 -0
- data/examples/slide-state.adoc +18 -0
- data/examples/slide-state.css +6 -0
- data/examples/source-callouts.adoc +20 -0
- data/examples/speaker-notes.adoc +21 -0
- data/examples/theme-custom.adoc +33 -0
- data/examples/theme-custom.css +33 -0
- data/examples/title-preamble.adoc +10 -0
- data/examples/title-slide-color.adoc +10 -0
- data/examples/title-slide-image.adoc +13 -0
- data/examples/title-slide-video.adoc +13 -0
- data/examples/title-subtitle-partitioning.adoc +7 -0
- data/examples/transitions.adoc +20 -0
- data/examples/vertical-slides.adoc +24 -0
- data/examples/video.adoc +32 -0
- data/lib/asciidoctor-revealjs.rb +1 -1
- data/lib/asciidoctor-revealjs/version.rb +1 -1
- data/lib/asciidoctor-templates-compiler.rb +11 -0
- data/templates/{slim/block_admonition.html.slim → admonition.html.slim} +2 -2
- data/templates/{slim/block_audio.html.slim → audio.html.slim} +0 -0
- data/templates/{slim/block_colist.html.slim → colist.html.slim} +0 -0
- data/templates/{slim/block_dlist.html.slim → dlist.html.slim} +0 -0
- data/templates/{slim/document.html.slim → document.html.slim} +25 -5
- data/templates/{slim/embedded.html.slim → embedded.html.slim} +0 -0
- data/templates/{slim/block_example.html.slim → example.html.slim} +0 -0
- data/templates/floating_title.html.slim +2 -0
- data/templates/helpers.rb +99 -0
- data/templates/{slim/block_image.html.slim → image.html.slim} +1 -1
- data/templates/{slim/inline_anchor.html.slim → inline_anchor.html.slim} +0 -0
- data/templates/{slim/inline_break.html.slim → inline_break.html.slim} +0 -0
- data/templates/{slim/inline_button.html.slim → inline_button.html.slim} +0 -0
- data/templates/{slim/inline_callout.html.slim → inline_callout.html.slim} +0 -0
- data/templates/{slim/inline_footnote.html.slim → inline_footnote.html.slim} +0 -0
- data/templates/{slim/inline_image.html.slim → inline_image.html.slim} +0 -0
- data/templates/{slim/inline_indexterm.html.slim → inline_indexterm.html.slim} +0 -0
- data/templates/{slim/inline_kbd.html.slim → inline_kbd.html.slim} +0 -0
- data/templates/{slim/inline_menu.html.slim → inline_menu.html.slim} +0 -0
- data/templates/{slim/inline_quoted.html.slim → inline_quoted.html.slim} +0 -0
- data/templates/{slim/block_listing.html.slim → listing.html.slim} +1 -1
- data/templates/{slim/block_literal.html.slim → literal.html.slim} +0 -0
- data/templates/{slim/block_olist.html.slim → olist.html.slim} +0 -0
- data/templates/{slim/block_open.html.slim → open.html.slim} +0 -0
- data/templates/outline.html.slim +9 -0
- data/templates/{slim/block_page_break.html.slim → page_break.html.slim} +0 -0
- data/templates/{slim/block_paragraph.html.slim → paragraph.html.slim} +0 -0
- data/templates/{slim/block_pass.html.slim → pass.html.slim} +0 -0
- data/templates/{slim/block_preamble.html.slim → preamble.html.slim} +0 -0
- data/templates/{slim/block_quote.html.slim → quote.html.slim} +0 -0
- data/templates/{jade/ruler.jade → ruler.html.slim} +0 -0
- data/templates/{slim/section.html.slim → section.html.slim} +8 -5
- data/templates/{slim/block_sidebar.html.slim → sidebar.html.slim} +0 -0
- data/templates/{slim/block_stem.html.slim → stem.html.slim} +0 -0
- data/templates/{slim/block_table.html.slim → table.html.slim} +5 -3
- data/templates/{jade/thematic_break.jade → thematic_break.html.slim} +0 -0
- data/templates/toc.html.slim +17 -0
- data/templates/{slim/block_ulist.html.slim → ulist.html.slim} +0 -0
- data/templates/{slim/block_verse.html.slim → verse.html.slim} +0 -0
- data/templates/{slim/block_video.html.slim → video.html.slim} +0 -0
- metadata +179 -89
- data/lib/asciidoctor-revealjs/converter.rb +0 -38
- data/templates/jade/admonition.jade +0 -17
- data/templates/jade/audio.jade +0 -6
- data/templates/jade/colist.jade +0 -22
- data/templates/jade/dlist.jade +0 -60
- data/templates/jade/document.jade +0 -103
- data/templates/jade/embedded.jade +0 -11
- data/templates/jade/example.jade +0 -4
- data/templates/jade/floating_title.jade +0 -2
- data/templates/jade/image.jade +0 -12
- data/templates/jade/inline_anchor.jade +0 -9
- data/templates/jade/inline_break.jade +0 -2
- data/templates/jade/inline_button.jade +0 -1
- data/templates/jade/inline_callout.jade +0 -9
- data/templates/jade/inline_image.jade +0 -24
- data/templates/jade/inline_indexterm.jade +0 -2
- data/templates/jade/inline_kbd.jade +0 -9
- data/templates/jade/inline_quoted.jade +0 -26
- data/templates/jade/listing.jade +0 -29
- data/templates/jade/literal.jade +0 -5
- data/templates/jade/olist.jade +0 -9
- data/templates/jade/page_break.jade +0 -1
- data/templates/jade/paragraph.jade +0 -7
- data/templates/jade/pass.jade +0 -1
- data/templates/jade/quote.jade +0 -11
- data/templates/jade/section.jade +0 -15
- data/templates/jade/sidebar.jade +0 -5
- data/templates/jade/table.jade +0 -45
- data/templates/jade/ulist.jade +0 -25
- data/templates/jade/verse.jade +0 -14
- data/templates/jade/video.jade +0 -30
- data/templates/slim/block_floating_title.html.slim +0 -1
- data/templates/slim/block_ruler.html.slim +0 -1
- data/templates/slim/block_thematic_break.html.slim +0 -1
- data/templates/slim/block_toc.html.slim +0 -12
- data/templates/slim/helpers.rb +0 -38
data/examples/video.adoc
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
// .video
|
2
|
+
// Demonstration of various reveal.js video features and AsciiDoc compact syntax for youtube.
|
3
|
+
// :include: //div[@class="slides"]
|
4
|
+
// :header_footer:
|
5
|
+
= Video tests
|
6
|
+
|
7
|
+
== Auto-sized
|
8
|
+
|
9
|
+
video::kZH9JtPBq7k[youtube, start=34, options=autoplay]
|
10
|
+
//video::kZH9JtPBq7k[youtube, start=34, height=600, width=800, options=autoplay]
|
11
|
+
|
12
|
+
[%notitle]
|
13
|
+
== Auto-sized notitle
|
14
|
+
|
15
|
+
video::kZH9JtPBq7k[youtube, start=34, options=autoplay]
|
16
|
+
|
17
|
+
[%notitle,background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&start=3&enablejsapi=1&autoplay=1&loop=1&controls=0&modestbranding=1"]
|
18
|
+
== background
|
19
|
+
|
20
|
+
[%notitle,background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm",background-video-loop=true,background-video-muted=true]
|
21
|
+
== video file, named attributes
|
22
|
+
|
23
|
+
[background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm",options="loop,muted,notitle"]
|
24
|
+
== video file, options
|
25
|
+
|
26
|
+
|
27
|
+
== vimeo autostart
|
28
|
+
|
29
|
+
video::44878206[vimeo, options=autoplay]
|
30
|
+
|
31
|
+
// data-autoplay is not supported on vimeo videos
|
32
|
+
// upstream: https://github.com/hakimel/reveal.js/issues/388
|
data/lib/asciidoctor-revealjs.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
if RUBY_ENGINE == 'opal'
|
2
2
|
require 'asciidoctor-revealjs/converter'
|
3
|
-
`require('asciidoctor-template.js')`
|
4
3
|
else
|
5
4
|
require 'asciidoctor' unless defined? Asciidoctor::Converter
|
6
5
|
require_relative 'asciidoctor-revealjs/converter'
|
6
|
+
require_relative 'asciidoctor-revealjs/version'
|
7
7
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'asciidoctor-templates-compiler'
|
2
|
+
|
3
|
+
module Asciidoctor::TemplatesCompiler
|
4
|
+
class RevealjsSlim < Asciidoctor::TemplatesCompiler::Slim
|
5
|
+
def engine_options
|
6
|
+
::Asciidoctor::Converter::TemplateConverter::DEFAULT_ENGINE_OPTIONS[:slim].merge(
|
7
|
+
generator: Temple::Generators::ArrayBuffer.new(capture_generator: 'ArrayBuffer')
|
8
|
+
)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -7,11 +7,11 @@
|
|
7
7
|
td.icon
|
8
8
|
- if @document.attr? :icons, 'font'
|
9
9
|
- icon_mapping = Hash['caution', 'fire', 'important', 'exclamation-circle', 'note', 'info-circle', 'tip', 'lightbulb-o', 'warning', 'warning']
|
10
|
-
i class=%(fa fa-#{icon_mapping[attr :name]}) title
|
10
|
+
i class=%(fa fa-#{icon_mapping[attr :name]}) title=(attr :textlabel || @caption)
|
11
11
|
- elsif @document.attr? :icons
|
12
12
|
img src=icon_uri(attr :name) alt=@caption
|
13
13
|
- else
|
14
|
-
.title
|
14
|
+
.title=(attr :textlabel) || @caption
|
15
15
|
td.content
|
16
16
|
- if title?
|
17
17
|
.title=title
|
File without changes
|
File without changes
|
File without changes
|
@@ -62,7 +62,13 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
|
|
62
62
|
link href="#{revealjsdir}/lib/css/zenburn.css" rel="stylesheet"
|
63
63
|
/ If the query includes 'print-pdf', use the PDF print sheet
|
64
64
|
javascript:
|
65
|
-
|
65
|
+
var link = document.createElement( 'link' );
|
66
|
+
link.rel = 'stylesheet';
|
67
|
+
link.type = 'text/css';
|
68
|
+
link.href = window.location.search.match( /print-pdf/gi ) ? "#{revealjsdir}/css/print/pdf.css" : "#{revealjsdir}/css/print/paper.css";
|
69
|
+
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
70
|
+
/[if lt IE 9]
|
71
|
+
<script src="#{revealjsdir}/lib/js/html5shiv.js"></script>
|
66
72
|
- unless (docinfo_content = docinfo :header, '.html').empty?
|
67
73
|
=docinfo_content
|
68
74
|
- if attr? :customcss
|
@@ -109,6 +115,8 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
|
|
109
115
|
controls: #{to_boolean(attr 'revealjs_controls', true)},
|
110
116
|
// Display a presentation progress bar
|
111
117
|
progress: #{to_boolean(attr 'revealjs_progress', true)},
|
118
|
+
// Set a per-slide timing for speaker notes, null means none
|
119
|
+
defaultTiming: #{attr 'revealjs_defaultTiming', 'null'},
|
112
120
|
// Display the page number of the current slide
|
113
121
|
slideNumber: #{to_boolean(attr 'revealjs_slidenumber', false)},
|
114
122
|
// Push each slide change to the browser history
|
@@ -125,11 +133,23 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
|
|
125
133
|
loop: #{to_boolean(attr 'revealjs_loop', false)},
|
126
134
|
// Change the presentation direction to be RTL
|
127
135
|
rtl: #{to_boolean(attr 'revealjs_rtl', false)},
|
136
|
+
// Randomizes the order of slides each time the presentation loads
|
137
|
+
shuffle: #{to_boolean(attr 'revealjs_shuffle', false)},
|
128
138
|
// Turns fragments on and off globally
|
129
139
|
fragments: #{to_boolean(attr 'revealjs_fragments', true)},
|
130
140
|
// Flags if the presentation is running in an embedded mode,
|
131
141
|
// i.e. contained within a limited portion of the screen
|
132
142
|
embedded: #{to_boolean(attr 'revealjs_embedded', false)},
|
143
|
+
// Flags if we should show a help overlay when the questionmark
|
144
|
+
// key is pressed
|
145
|
+
help: #{to_boolean(attr 'revealjs_help', true)},
|
146
|
+
// Flags if speaker notes should be visible to all viewers
|
147
|
+
showNotes: #{to_boolean(attr 'revealjs_showNotes', false)},
|
148
|
+
// Global override for autolaying embedded media (video/audio/iframe)
|
149
|
+
// - null: Media will only autoplay if data-autoplay is present
|
150
|
+
// - true: All media will autoplay, regardless of individual setting
|
151
|
+
// - false: No media will autoplay, regardless of individual setting
|
152
|
+
autoPlayMedia: #{attr 'revealjs_autoPlayMedia', 'null'},
|
133
153
|
// Number of milliseconds between automatically proceeding to the
|
134
154
|
// next slide, disabled when set to 0, this value can be overwritten
|
135
155
|
// by using a data-autoslide attribute on your slides
|
@@ -157,7 +177,7 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
|
|
157
177
|
parallaxBackgroundImage: '#{attr 'revealjs_parallaxbackgroundimage', ''}',
|
158
178
|
// Parallax background size in CSS syntax (e.g., "2100px 900px")
|
159
179
|
parallaxBackgroundSize: '#{attr 'revealjs_parallaxbackgroundsize', ''}',
|
160
|
-
|
180
|
+
|
161
181
|
// The "normal" size of the presentation, aspect ratio will be preserved
|
162
182
|
// when the presentation is scaled to fit different resolutions. Can be
|
163
183
|
// specified using percentage units.
|
@@ -170,15 +190,15 @@ html lang=(attr :lang, 'en' unless attr? :nolang)
|
|
170
190
|
// Bounds for smallest/largest possible scale to apply to content
|
171
191
|
minScale: #{attr 'revealjs_minscale', 0.2},
|
172
192
|
maxScale: #{attr 'revealjs_maxscale', 1.5},
|
173
|
-
|
193
|
+
|
174
194
|
// Optional libraries used to extend on reveal.js
|
175
195
|
dependencies: [
|
176
196
|
{ src: '#{revealjsdir}/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
177
197
|
{ src: '#{revealjsdir}/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
178
198
|
{ src: '#{revealjsdir}/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
179
199
|
#{(attr? 'source-highlighter', 'highlightjs') ? "{ src: '#{revealjsdir}/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }," : nil}
|
180
|
-
{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true
|
181
|
-
{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true
|
200
|
+
{ src: '#{revealjsdir}/plugin/zoom-js/zoom.js', async: true },
|
201
|
+
{ src: '#{revealjsdir}/plugin/notes/notes.js', async: true }
|
182
202
|
]
|
183
203
|
});
|
184
204
|
- unless (docinfo_content = (docinfo :footer, '.html')).empty?
|
File without changes
|
File without changes
|
@@ -0,0 +1,99 @@
|
|
1
|
+
unless RUBY_ENGINE == 'opal'
|
2
|
+
# This helper file borrows from the Bespoke converter
|
3
|
+
# https://github.com/asciidoctor/asciidoctor-bespoke
|
4
|
+
require 'asciidoctor'
|
5
|
+
end
|
6
|
+
|
7
|
+
# This module gets mixed in to every node (the context of the template) at the
|
8
|
+
# time the node is being converted. The properties and methods in this module
|
9
|
+
# effectively become direct members of the template.
|
10
|
+
module Slim::Helpers
|
11
|
+
|
12
|
+
EOL = %(\n)
|
13
|
+
SliceHintRx = / +/
|
14
|
+
|
15
|
+
def slice_text str, active = nil
|
16
|
+
if (active || (active.nil? && (option? :slice))) && (str.include? ' ')
|
17
|
+
(str.split SliceHintRx).map {|line| %(<span class="line">#{line}</span>) }.join EOL
|
18
|
+
else
|
19
|
+
str
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_boolean val
|
24
|
+
val && val != 'false' && val.to_s != '0' || false
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# These constants and functions are from the asciidictor-html5s project
|
29
|
+
# https://github.com/jirutka/asciidoctor-html5s/blob/a71db48a1dd5196b668b3a3d93693c5d877c5bf3/data/templates/helpers.rb
|
30
|
+
|
31
|
+
# Defaults
|
32
|
+
DEFAULT_TOCLEVELS = 2
|
33
|
+
DEFAULT_SECTNUMLEVELS = 3
|
34
|
+
|
35
|
+
|
36
|
+
VOID_ELEMENTS = %w(area base br col command embed hr img input keygen link
|
37
|
+
meta param source track wbr)
|
38
|
+
|
39
|
+
##
|
40
|
+
# Creates an HTML tag with the given name and optionally attributes. Can take
|
41
|
+
# a block that will run between the opening and closing tags.
|
42
|
+
#
|
43
|
+
# @param name [#to_s] the name of the tag.
|
44
|
+
# @param attributes [Hash] (default: {})
|
45
|
+
# @param content [#to_s] the content; +nil+ to call the block. (default: nil).
|
46
|
+
# @yield The block of Slim/HTML code within the tag (optional).
|
47
|
+
# @return [String] a rendered HTML element.
|
48
|
+
#
|
49
|
+
|
50
|
+
def html_tag(name, attributes = {}, content = nil)
|
51
|
+
attrs = attributes.inject([]) do |attrs, (k, v)|
|
52
|
+
next attrs if !v || v.nil_or_empty?
|
53
|
+
v = v.compact.join(' ') if v.is_a? Array
|
54
|
+
attrs << (v == true ? k : %(#{k}="#{v}"))
|
55
|
+
end
|
56
|
+
attrs_str = attrs.empty? ? '' : attrs.join(' ').prepend(' ')
|
57
|
+
|
58
|
+
|
59
|
+
if VOID_ELEMENTS.include? name.to_s
|
60
|
+
%(<#{name}#{attrs_str}>)
|
61
|
+
else
|
62
|
+
content ||= yield if block_given?
|
63
|
+
%(<#{name}#{attrs_str}>#{content}</#{name}>)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
##
|
69
|
+
# Returns corrected section level.
|
70
|
+
#
|
71
|
+
# @param sec [Asciidoctor::Section] the section node (default: self).
|
72
|
+
# @return [Integer]
|
73
|
+
#
|
74
|
+
def section_level(sec = self)
|
75
|
+
@_section_level ||= (sec.level == 0 && sec.special) ? 1 : sec.level
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
##
|
80
|
+
# Returns the captioned section's title, optionally numbered.
|
81
|
+
#
|
82
|
+
# @param sec [Asciidoctor::Section] the section node (default: self).
|
83
|
+
# @return [String]
|
84
|
+
#
|
85
|
+
def section_title(sec = self)
|
86
|
+
sectnumlevels = document.attr(:sectnumlevels, DEFAULT_SECTNUMLEVELS).to_i
|
87
|
+
|
88
|
+
if sec.numbered && !sec.caption && sec.level <= sectnumlevels
|
89
|
+
[sec.sectnum, sec.captioned_title].join(' ')
|
90
|
+
else
|
91
|
+
sec.captioned_title
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
# More custom functions can be added in another namespace if required
|
98
|
+
#module Helpers
|
99
|
+
#end
|
@@ -9,7 +9,7 @@
|
|
9
9
|
- if (has_role? 'stretch') && !((attr? :width) || (attr? :height))
|
10
10
|
- height = "100%"
|
11
11
|
|
12
|
-
- unless
|
12
|
+
- unless attributes[1] == 'background' || attributes[1] == 'canvas'
|
13
13
|
.imageblock(id=@id class=roles
|
14
14
|
style=[("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; '))
|
15
15
|
- if attr? :link
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- nowrap = !(@document.attr? :prewrap) || (option? 'nowrap')
|
6
6
|
/ implicit listing blocks and source blocks are rendered as code
|
7
7
|
/ explicit listing blocks stay listing
|
8
|
-
- if @style == 'source' || (@style == 'listing' &&
|
8
|
+
- if @style == 'source' || (@style == 'listing' && attributes[1] != 'listing')
|
9
9
|
- language = attr :language
|
10
10
|
- code_class = language ? [language, "language-#{language}"] : nil
|
11
11
|
- pre_class = ['highlight']
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,9 @@
|
|
1
|
+
- unless sections.empty?
|
2
|
+
- toclevels ||= (document.attr 'toclevels', DEFAULT_TOCLEVELS).to_i
|
3
|
+
- slevel = section_level sections.first
|
4
|
+
ol class="sectlevel#{slevel}"
|
5
|
+
- sections.each do |sec|
|
6
|
+
li
|
7
|
+
a href="##{sec.id}" =section_title sec
|
8
|
+
- if (sec.level < toclevels) && (child_toc = converter.convert sec, 'outline')
|
9
|
+
= child_toc
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,9 @@
|
|
1
1
|
/ OPTIONS PROCESSING
|
2
|
-
/ strip IDs the same way revealjs does
|
3
|
-
|
2
|
+
/ strip IDs the same way revealjs does to make links to direct slides work using URL fragments gh#127
|
3
|
+
/ Strip unallowed characters globally then strip anything non a-Z from start of string until something matches
|
4
|
+
/ TODO remove when hakimel/reveal.js#1230 is fixed
|
5
|
+
- _id = id.gsub(/[^a-zA-Z0-9\-\_\:\.]/, '').gsub(/^[^a-zA-Z]+/, '')
|
6
|
+
|
4
7
|
|
5
8
|
/ hide slides on %conceal, %notitle and named "!"
|
6
9
|
- titleless = (title = self.title) == '!'
|
@@ -16,11 +19,11 @@
|
|
16
19
|
/ process the first image block in the current section that acts as a background
|
17
20
|
- section_images = blocks.map do |block|
|
18
21
|
- if (ctx = block.context) == :image
|
19
|
-
- ['background', 'canvas'].include?(block.
|
22
|
+
- ['background', 'canvas'].include?(block.attributes[1]) ? block : []
|
20
23
|
- elsif ctx == :section
|
21
24
|
- []
|
22
25
|
- else
|
23
|
-
- block.find_by(context: :image) {|image| ['background', 'canvas'].include?(image.
|
26
|
+
- block.find_by(context: :image) {|image| ['background', 'canvas'].include?(image.attributes[1]) } || []
|
24
27
|
- if (bg_image = section_images.flatten.first)
|
25
28
|
- data_background_image = image_uri(bg_image.attr 'target')
|
26
29
|
/ make sure no crash on nil and default values make sense
|
@@ -66,7 +69,7 @@
|
|
66
69
|
- else
|
67
70
|
- if @level >= 3
|
68
71
|
/ dynamic tags which maps <hX> with level
|
69
|
-
|
72
|
+
h level=(@level) =title
|
70
73
|
=content.chomp
|
71
74
|
- else
|
72
75
|
section(id=(titleless ? nil : _id)
|
File without changes
|
File without changes
|
@@ -11,7 +11,8 @@ table(id=@id class=['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :gri
|
|
11
11
|
- @columns.each do |col|
|
12
12
|
col style="width:#{col.attr :colpcwidth}%"
|
13
13
|
- [:head, :foot, :body].select {|tblsec| !@rows[tblsec].empty? }.each do |tblsec|
|
14
|
-
|
14
|
+
/ not sure about this one, done when converting to a compilable slim template
|
15
|
+
<t#{tblsec}>
|
15
16
|
- @rows[tblsec].each do |row|
|
16
17
|
tr
|
17
18
|
- row.each do |cell|
|
@@ -24,9 +25,10 @@ table(id=@id class=['tableblock',"frame-#{attr :frame, 'all'}","grid-#{attr :gri
|
|
24
25
|
- cell_content = cell.text
|
25
26
|
- else
|
26
27
|
- cell_content = cell.content
|
27
|
-
|
28
|
+
= html_tag(tblsec == :head || cell.style == :header ? 'th' : 'td',
|
29
|
+
:class=>['tableblock', "halign-#{cell.attr :halign}", "valign-#{cell.attr :valign}"],
|
28
30
|
:colspan=>cell.colspan, :rowspan=>cell.rowspan,
|
29
|
-
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil)
|
31
|
+
:style=>((@document.attr? :cellbgcolor) ? %(background-color:#{@document.attr :cellbgcolor};) : nil))
|
30
32
|
- if tblsec == :head
|
31
33
|
=cell_content
|
32
34
|
- else
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/ this made tests crash so I replaced it with asciidoctor-backends HTML5 slim template
|
2
|
+
/- if @document.attr? :toc
|
3
|
+
/ - toc_id = @id
|
4
|
+
/ - toc_role = (attr 'role', (@document.attr 'toc-class', 'toc'))
|
5
|
+
/ - toc_title_id = nil
|
6
|
+
/ - toc_title = title? ? title : (@document.attr 'toc-title')
|
7
|
+
/ - toc_levels = (attr? :levels) ? (attr :levels).to_i : (@document.attr :toclevels, 2).to_i
|
8
|
+
/ - if !toc_id && (@document.embedded? || !(@document.attr? 'toc-placement'))
|
9
|
+
/ - toc_id = 'toc'
|
10
|
+
/ - toc_title_id = 'toctitle'
|
11
|
+
/ div id=toc_id class=toc_role
|
12
|
+
/ .title id=toc_title_id =toc_title
|
13
|
+
/ =Asciidoctor::HTML5::DocumentTemplate.outline(@document, toc_levels)
|
14
|
+
#toc class=(attr 'toc-class', 'toc')
|
15
|
+
#toctitle =(attr 'toc-title')
|
16
|
+
/ Renders block_outline.html.
|
17
|
+
= converter.convert document, 'outline'
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,71 +1,155 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-revealjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Bilodeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.5.
|
19
|
+
version: 1.5.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.5.
|
26
|
+
version: 1.5.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: thread_safe
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 0.3.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 0.3.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
48
|
-
type: :
|
47
|
+
version: 10.4.2
|
48
|
+
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 10.4.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: asciidoctor-doctest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.0.0.beta.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.0.0.beta.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 10.4
|
75
|
+
version: 0.10.4
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 10.4
|
82
|
+
version: 0.10.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: colorize
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: asciidoctor-templates-compiler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.3.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.3.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: slim
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 3.0.6
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 3.0.6
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: slim-htag
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.1.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.1.0
|
69
153
|
description: Reveal.JS back-end for Asciidoctor and Asciidoctor.js. Write slides in
|
70
154
|
AsciiDoc!
|
71
155
|
email:
|
@@ -79,85 +163,91 @@ extra_rdoc_files:
|
|
79
163
|
- HACKING.adoc
|
80
164
|
files:
|
81
165
|
- CHANGELOG.adoc
|
166
|
+
- Gemfile
|
82
167
|
- HACKING.adoc
|
83
168
|
- LICENSE.adoc
|
84
169
|
- README.adoc
|
170
|
+
- Rakefile
|
85
171
|
- asciidoctor-revealjs.gemspec
|
86
172
|
- bin/asciidoctor-revealjs
|
173
|
+
- examples/README.adoc
|
174
|
+
- examples/admonitions-icons.adoc
|
175
|
+
- examples/admonitions.adoc
|
176
|
+
- examples/concealed-slide-titles.adoc
|
177
|
+
- examples/customcss.adoc
|
178
|
+
- examples/customcss.css
|
179
|
+
- examples/data-background-newstyle.adoc
|
180
|
+
- examples/data-background-oldstyle.adoc
|
181
|
+
- examples/history-regression-tests.adoc
|
182
|
+
- examples/history.adoc
|
183
|
+
- examples/images.adoc
|
184
|
+
- examples/images/70s.jpg
|
185
|
+
- examples/images/bio.jpg
|
186
|
+
- examples/images/cover.jpg
|
187
|
+
- examples/images/meme-2.jpg
|
188
|
+
- examples/images/meme-7.png
|
189
|
+
- examples/images/web_surfing_time.gif
|
190
|
+
- examples/keyboard-shortcuts.adoc
|
191
|
+
- examples/level-sections.adoc
|
192
|
+
- examples/multi-destination-content.adoc
|
193
|
+
- examples/revealjs-stretch.adoc
|
194
|
+
- examples/slide-state.adoc
|
195
|
+
- examples/slide-state.css
|
196
|
+
- examples/source-callouts.adoc
|
197
|
+
- examples/speaker-notes.adoc
|
198
|
+
- examples/theme-custom.adoc
|
199
|
+
- examples/theme-custom.css
|
200
|
+
- examples/title-preamble.adoc
|
201
|
+
- examples/title-slide-color.adoc
|
202
|
+
- examples/title-slide-image.adoc
|
203
|
+
- examples/title-slide-video.adoc
|
204
|
+
- examples/title-subtitle-partitioning.adoc
|
205
|
+
- examples/transitions.adoc
|
206
|
+
- examples/vertical-slides.adoc
|
207
|
+
- examples/video.adoc
|
87
208
|
- lib/asciidoctor-revealjs.rb
|
88
|
-
- lib/asciidoctor-revealjs/converter.rb
|
89
209
|
- lib/asciidoctor-revealjs/version.rb
|
90
|
-
- templates
|
91
|
-
- templates/
|
92
|
-
- templates/
|
93
|
-
- templates/
|
94
|
-
- templates/
|
95
|
-
- templates/
|
96
|
-
- templates/
|
97
|
-
- templates/
|
98
|
-
- templates/
|
99
|
-
- templates/
|
100
|
-
- templates/
|
101
|
-
- templates/
|
102
|
-
- templates/
|
103
|
-
- templates/
|
104
|
-
- templates/
|
105
|
-
- templates/
|
106
|
-
- templates/
|
107
|
-
- templates/
|
108
|
-
- templates/
|
109
|
-
- templates/
|
110
|
-
- templates/
|
111
|
-
- templates/
|
112
|
-
- templates/
|
113
|
-
- templates/
|
114
|
-
- templates/
|
115
|
-
- templates/
|
116
|
-
- templates/
|
117
|
-
- templates/
|
118
|
-
- templates/
|
119
|
-
- templates/
|
120
|
-
- templates/
|
121
|
-
- templates/
|
122
|
-
- templates/
|
123
|
-
- templates/
|
124
|
-
- templates/
|
125
|
-
- templates/
|
126
|
-
- templates/
|
127
|
-
- templates/
|
128
|
-
- templates/
|
129
|
-
- templates/
|
130
|
-
- templates/
|
131
|
-
- templates/slim/block_olist.html.slim
|
132
|
-
- templates/slim/block_open.html.slim
|
133
|
-
- templates/slim/block_page_break.html.slim
|
134
|
-
- templates/slim/block_paragraph.html.slim
|
135
|
-
- templates/slim/block_pass.html.slim
|
136
|
-
- templates/slim/block_preamble.html.slim
|
137
|
-
- templates/slim/block_quote.html.slim
|
138
|
-
- templates/slim/block_ruler.html.slim
|
139
|
-
- templates/slim/block_sidebar.html.slim
|
140
|
-
- templates/slim/block_stem.html.slim
|
141
|
-
- templates/slim/block_table.html.slim
|
142
|
-
- templates/slim/block_thematic_break.html.slim
|
143
|
-
- templates/slim/block_toc.html.slim
|
144
|
-
- templates/slim/block_ulist.html.slim
|
145
|
-
- templates/slim/block_verse.html.slim
|
146
|
-
- templates/slim/block_video.html.slim
|
147
|
-
- templates/slim/document.html.slim
|
148
|
-
- templates/slim/embedded.html.slim
|
149
|
-
- templates/slim/helpers.rb
|
150
|
-
- templates/slim/inline_anchor.html.slim
|
151
|
-
- templates/slim/inline_break.html.slim
|
152
|
-
- templates/slim/inline_button.html.slim
|
153
|
-
- templates/slim/inline_callout.html.slim
|
154
|
-
- templates/slim/inline_footnote.html.slim
|
155
|
-
- templates/slim/inline_image.html.slim
|
156
|
-
- templates/slim/inline_indexterm.html.slim
|
157
|
-
- templates/slim/inline_kbd.html.slim
|
158
|
-
- templates/slim/inline_menu.html.slim
|
159
|
-
- templates/slim/inline_quoted.html.slim
|
160
|
-
- templates/slim/section.html.slim
|
210
|
+
- lib/asciidoctor-templates-compiler.rb
|
211
|
+
- templates/admonition.html.slim
|
212
|
+
- templates/audio.html.slim
|
213
|
+
- templates/colist.html.slim
|
214
|
+
- templates/dlist.html.slim
|
215
|
+
- templates/document.html.slim
|
216
|
+
- templates/embedded.html.slim
|
217
|
+
- templates/example.html.slim
|
218
|
+
- templates/floating_title.html.slim
|
219
|
+
- templates/helpers.rb
|
220
|
+
- templates/image.html.slim
|
221
|
+
- templates/inline_anchor.html.slim
|
222
|
+
- templates/inline_break.html.slim
|
223
|
+
- templates/inline_button.html.slim
|
224
|
+
- templates/inline_callout.html.slim
|
225
|
+
- templates/inline_footnote.html.slim
|
226
|
+
- templates/inline_image.html.slim
|
227
|
+
- templates/inline_indexterm.html.slim
|
228
|
+
- templates/inline_kbd.html.slim
|
229
|
+
- templates/inline_menu.html.slim
|
230
|
+
- templates/inline_quoted.html.slim
|
231
|
+
- templates/listing.html.slim
|
232
|
+
- templates/literal.html.slim
|
233
|
+
- templates/olist.html.slim
|
234
|
+
- templates/open.html.slim
|
235
|
+
- templates/outline.html.slim
|
236
|
+
- templates/page_break.html.slim
|
237
|
+
- templates/paragraph.html.slim
|
238
|
+
- templates/pass.html.slim
|
239
|
+
- templates/preamble.html.slim
|
240
|
+
- templates/quote.html.slim
|
241
|
+
- templates/ruler.html.slim
|
242
|
+
- templates/section.html.slim
|
243
|
+
- templates/sidebar.html.slim
|
244
|
+
- templates/stem.html.slim
|
245
|
+
- templates/table.html.slim
|
246
|
+
- templates/thematic_break.html.slim
|
247
|
+
- templates/toc.html.slim
|
248
|
+
- templates/ulist.html.slim
|
249
|
+
- templates/verse.html.slim
|
250
|
+
- templates/video.html.slim
|
161
251
|
homepage: https://github.com/asciidoctor/asciidoctor-reveal.js
|
162
252
|
licenses:
|
163
253
|
- MIT
|
@@ -178,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
268
|
version: '0'
|
179
269
|
requirements: []
|
180
270
|
rubyforge_project:
|
181
|
-
rubygems_version: 2.6.
|
271
|
+
rubygems_version: 2.6.14
|
182
272
|
signing_key:
|
183
273
|
specification_version: 4
|
184
274
|
summary: Converts AsciiDoc to HTML for a Reveal.js presentation
|