asciidoctor-revealjs 3.0.0 → 4.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.adoc +1 -1
- data/README.adoc +390 -63
- data/Rakefile +30 -7
- data/asciidoctor-revealjs.gemspec +6 -4
- data/bin/asciidoctor-revealjs +7 -0
- data/examples/a11y-dark.css +99 -0
- data/examples/autoslide.adoc +22 -0
- data/examples/custom-layout.adoc +10 -0
- data/examples/customcss.adoc +1 -1
- data/examples/data-attributes.adoc +245 -0
- data/examples/docinfo-footer-revealjs.html +10 -0
- data/examples/docinfo-revealjs.html +7 -0
- data/examples/font-awesome-specific-version.adoc +11 -0
- data/examples/font-awesome.adoc +23 -4
- data/examples/font-awesome.css +3 -0
- data/examples/footnotes.adoc +46 -0
- data/examples/fragments.adoc +44 -0
- data/examples/fragments.css +18 -0
- data/examples/grid-layout-3x2.adoc +50 -0
- data/examples/grid-layout-docinfo-revealjs.html +11 -0
- data/examples/grid-layout.adoc +194 -0
- data/examples/history-hash.adoc +19 -0
- data/examples/history-regression-tests.adoc +0 -5
- data/examples/history.adoc +4 -4
- data/examples/images/asciidoctor-logo.svg +102 -0
- data/examples/images/cute-cat-1.jpg +0 -0
- data/examples/images/cute-cat-2.jpg +0 -0
- data/examples/images/cute-cat-3.jpg +0 -0
- data/examples/images/flock-of-seagulls_daniel-simion.mp3 +0 -0
- data/examples/issue-grid-layout-images.adoc +25 -0
- data/examples/level-sectnums.adoc +24 -0
- data/examples/links-preview.adoc +32 -0
- data/examples/links.adoc +39 -0
- data/examples/mathjax-cdn.adoc +21 -0
- data/examples/mathjax.adoc +20 -0
- data/examples/release-4.0.adoc +192 -0
- data/examples/release-4.0.css +23 -0
- data/examples/release-4.1.adoc +133 -0
- data/examples/release-4.1.css +50 -0
- data/examples/revealjs-custom-theme.adoc +10 -0
- data/examples/source-coderay.adoc +15 -0
- data/examples/source-emphasis.adoc +128 -0
- data/examples/source-highlightjs-html.adoc +1 -1
- data/examples/source-highlightjs-languages.adoc +27 -0
- data/examples/source-highlightjs.adoc +85 -2
- data/examples/source-pygments.adoc +12 -0
- data/examples/source-rouge-docinfo.html +8 -0
- data/examples/source-rouge.adoc +18 -0
- data/examples/steps.adoc +87 -0
- data/examples/text-alignments.adoc +44 -0
- data/examples/video.adoc +30 -8
- data/examples/with-docinfo-shared.adoc +13 -0
- data/lib/asciidoctor-revealjs/converter.rb +1053 -769
- data/lib/asciidoctor-revealjs/highlightjs.rb +333 -2
- data/lib/asciidoctor-revealjs/version.rb +1 -1
- data/templates/admonition.html.slim +1 -1
- data/templates/asciidoctor-compatibility.css +390 -0
- data/templates/audio.html.slim +1 -1
- data/templates/colist.html.slim +1 -1
- data/templates/dlist.html.slim +3 -3
- data/templates/document.html.slim +76 -59
- data/templates/example.html.slim +1 -1
- data/templates/helpers.rb +170 -5
- data/templates/image.html.slim +3 -3
- data/templates/inline_anchor.html.slim +6 -4
- data/templates/inline_button.html.slim +2 -1
- data/templates/inline_footnote.html.slim +11 -4
- data/templates/inline_image.html.slim +5 -8
- data/templates/inline_kbd.html.slim +3 -2
- data/templates/inline_menu.html.slim +4 -3
- data/templates/inline_quoted.html.slim +13 -21
- data/templates/listing.html.slim +15 -10
- data/templates/literal.html.slim +1 -1
- data/templates/olist.html.slim +2 -2
- data/templates/open.html.slim +3 -3
- data/templates/paragraph.html.slim +1 -1
- data/templates/quote.html.slim +1 -1
- data/templates/section.html.slim +51 -43
- data/templates/sidebar.html.slim +1 -1
- data/templates/stem.html.slim +1 -1
- data/templates/stretch_nested_elements.js.slim +65 -0
- data/templates/table.html.slim +3 -2
- data/templates/title_slide.html.slim +28 -0
- data/templates/ulist.html.slim +3 -3
- data/templates/verse.html.slim +1 -1
- data/templates/video.html.slim +14 -8
- metadata +81 -18
- data/CHANGELOG.adoc +0 -425
- data/HACKING.adoc +0 -386
- data/examples/revealjs-features.adoc +0 -23
- data/templates/asciidoctor_revealjs.css.slim +0 -59
data/templates/image.html.slim
CHANGED
@@ -10,10 +10,10 @@
|
|
10
10
|
- height = "100%"
|
11
11
|
|
12
12
|
- unless attributes[1] == 'background' || attributes[1] == 'canvas'
|
13
|
-
.
|
14
|
-
|
13
|
+
- inline_style = [("text-align: #{attr :align}" if attr? :align),("float: #{attr :float}" if attr? :float)].compact.join('; ')
|
14
|
+
= html_tag('div', { :id => @id, :class => ['imageblock', role, ('fragment' if (option? :step) || (attr? 'step'))], :style => inline_style }.merge(data_attrs(@attributes)))
|
15
15
|
- if attr? :link
|
16
|
-
a.image href=(attr :link)
|
16
|
+
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
|
17
17
|
img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil)
|
18
18
|
- else
|
19
19
|
img src=image_uri(attr :target) alt=(attr :alt) width=(width) height=(height) style=((attr? :background) ? "background: #{attr :background}" : nil)
|
@@ -1,11 +1,13 @@
|
|
1
1
|
- case @type
|
2
2
|
- when :xref
|
3
3
|
- refid = (attr :refid) || @target
|
4
|
-
a href
|
4
|
+
= html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)))
|
5
|
+
=(@text || @document.references[:ids].fetch(refid, "[#{refid}]")).tr_s("\n", ' ')
|
5
6
|
- when :ref
|
6
|
-
a id
|
7
|
+
= html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))
|
7
8
|
- when :bibref
|
8
|
-
a id
|
9
|
+
= html_tag('a', { :id => @target }.merge(data_attrs(@attributes)))
|
9
10
|
|[#{@target}]
|
10
11
|
- else
|
11
|
-
a href
|
12
|
+
= html_tag('a', { :href => @target, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact, :target => (attr :window), 'data-preview-link' => (bool_data_attr :preview) }.merge(data_attrs(@attributes)))
|
13
|
+
=@text
|
@@ -1 +1,2 @@
|
|
1
|
-
b.
|
1
|
+
= html_tag('b', { :class => ['button'] }.merge(data_attrs(@attributes)))
|
2
|
+
= @text
|
@@ -1,6 +1,13 @@
|
|
1
|
+
- footnote = slide_footnote(self)
|
2
|
+
- index = footnote.attr(:index)
|
3
|
+
- id = footnote.id
|
1
4
|
- if @type == :xref
|
2
|
-
|
3
|
-
| [
|
5
|
+
= html_tag('sup', { :class => ['footnoteref'] }.merge(data_attrs(footnote.attributes)))
|
6
|
+
| [
|
7
|
+
span(class="footnote" title="View footnote.") = index
|
8
|
+
| ]
|
4
9
|
- else
|
5
|
-
|
6
|
-
| [
|
10
|
+
= html_tag('sup', { :id => ("_footnote_#{id}" if id), :class => ['footnote'] }.merge(data_attrs(footnote.attributes)))
|
11
|
+
| [
|
12
|
+
span(class="footnote" title="View footnote.") = index
|
13
|
+
| ]
|
@@ -1,24 +1,21 @@
|
|
1
|
-
span class
|
1
|
+
= html_tag('span', { :class => [@type, role, ('fragment' if (option? :step) || (attr? 'step'))], :style => ("float: #{attr :float}" if attr? :float) }.merge(data_attrs(@attributes)))
|
2
2
|
- if @type == 'icon' && (@document.attr? :icons, 'font')
|
3
|
-
- style_class = [
|
4
|
-
- style_class << "fa-#{attr :size}" if attr? :size
|
5
|
-
- style_class << "fa-rotate-#{attr :rotate}" if attr? :rotate
|
6
|
-
- style_class << "fa-flip-#{attr :flip}" if attr? :flip
|
3
|
+
- style_class = [(attr :set, 'fa'), "fa-#{@target}", ("fa-#{attr :size}" if attr? :size), ("fa-rotate-#{attr :rotate}" if attr? :rotate), ("fa-flip-#{attr :flip}" if attr? :flip)]
|
7
4
|
- if attr? :link
|
8
|
-
a.image href=(attr :link) target=(attr :window)
|
5
|
+
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
|
9
6
|
i class=style_class title=(attr :title)
|
10
7
|
- else
|
11
8
|
i class=style_class title=(attr :title)
|
12
9
|
- elsif @type == 'icon' && !(@document.attr? :icons)
|
13
10
|
- if attr? :link
|
14
|
-
a.image href=(attr :link) target=(attr :window)
|
11
|
+
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
|
15
12
|
|[#{attr :alt}]
|
16
13
|
- else
|
17
14
|
|[#{attr :alt}]
|
18
15
|
- else
|
19
16
|
- src = (@type == 'icon' ? (icon_uri @target) : (image_uri @target))
|
20
17
|
- if attr? :link
|
21
|
-
a.image href=(attr :link) target=(attr :window)
|
18
|
+
a.image href=(attr :link) target=(attr :window) data-preview-link=(bool_data_attr :link_preview)
|
22
19
|
img src=src alt=(attr :alt) width=(attr :width) height=(attr :height) title=(attr :title)
|
23
20
|
- else
|
24
21
|
img src=src alt=(attr :alt) width=(attr :width) height=(attr :height) title=(attr :title)
|
@@ -1,7 +1,8 @@
|
|
1
1
|
- if (keys = attr 'keys').size == 1
|
2
|
-
kbd
|
2
|
+
= html_tag('kbd', data_attrs(@attributes))
|
3
|
+
= keys.first
|
3
4
|
- else
|
4
|
-
span.
|
5
|
+
= html_tag('span', { :class => ['keyseq'] }.merge(data_attrs(@attributes)))
|
5
6
|
- keys.each_with_index do |key, idx|
|
6
7
|
- unless idx.zero?
|
7
8
|
|+
|
@@ -1,15 +1,16 @@
|
|
1
1
|
- menu = attr 'menu'
|
2
2
|
- menuitem = attr 'menuitem'
|
3
3
|
- if !(submenus = attr 'submenus').empty?
|
4
|
-
span.
|
4
|
+
= html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes)))
|
5
5
|
span.menu=menu
|
6
6
|
| ▸ 
|
7
7
|
=submenus.map {|submenu| %(<span class="submenu">#{submenu}</span> ▸ ) }.join
|
8
8
|
span.menuitem=menuitem
|
9
9
|
- elsif !menuitem.nil?
|
10
|
-
span.
|
10
|
+
= html_tag('span', { :class => ['menuseq'] }.merge(data_attrs(@attributes)))
|
11
11
|
span.menu=menu
|
12
12
|
| ▸ 
|
13
13
|
span.menuitem=menuitem
|
14
14
|
- else
|
15
|
-
span.
|
15
|
+
= html_tag('span', { :class => ['menu'] }.merge(data_attrs(@attributes)))
|
16
|
+
= menu
|
@@ -1,22 +1,14 @@
|
|
1
|
-
-
|
2
|
-
|
3
|
-
|
4
|
-
- when :emphasis
|
5
|
-
em class=role =@text
|
6
|
-
- when :strong
|
7
|
-
strong class=role =@text
|
8
|
-
- when :monospaced
|
9
|
-
code class=role =@text
|
10
|
-
- when :superscript
|
11
|
-
sup class=role =@text
|
12
|
-
- when :subscript
|
13
|
-
sub class=role =@text
|
14
|
-
- when :double
|
15
|
-
=role? ? %(<span class="#{role}">“#{@text}”</span>) : %(“#{@text}”)
|
16
|
-
- when :single
|
17
|
-
=role? ? %(<span class="#{role}">‘#{@text}’</span>) : %(‘#{@text}’)
|
18
|
-
- when :asciimath, :latexmath
|
19
|
-
- open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]
|
20
|
-
|#{open}#{@text}#{close}
|
1
|
+
- quote_tags = { emphasis: 'em', strong: 'strong', monospaced: 'code', superscript: 'sup', subscript: 'sup' }
|
2
|
+
- if (quote_tag = quote_tags[@type])
|
3
|
+
= html_tag(quote_tag, { :id => @id, :class => [role, ('fragment' if (option? :step) || (attr? 'step'))].compact }.merge(data_attrs(@attributes)), @text)
|
21
4
|
- else
|
22
|
-
|
5
|
+
- case @type
|
6
|
+
- when :double
|
7
|
+
- inline_text_container("“#{@text}”")
|
8
|
+
- when :single
|
9
|
+
= inline_text_container("‘#{@text}’")
|
10
|
+
- when :asciimath, :latexmath
|
11
|
+
- open, close = Asciidoctor::INLINE_MATH_DELIMITERS[@type]
|
12
|
+
= inline_text_container("#{open}#{@text}#{close}")
|
13
|
+
- else
|
14
|
+
= inline_text_container(@text)
|
data/templates/listing.html.slim
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
- nowrap = (option? 'nowrap') || !(document.attr? 'prewrap')
|
2
|
-
- syntax_hl = document.syntax_highlighter
|
3
2
|
- if @style == 'source'
|
3
|
+
- syntax_hl = document.syntax_highlighter
|
4
4
|
- lang = attr :language
|
5
5
|
- if syntax_hl
|
6
6
|
- doc_attrs = document.attributes
|
@@ -8,12 +8,17 @@
|
|
8
8
|
- style = doc_attrs[%(#{syntax_hl.name}-style)]
|
9
9
|
- opts = syntax_hl.highlight? ? { css_mode: css_mode, style: style } : {}
|
10
10
|
- opts[:nowrap] = nowrap
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
|
11
|
+
= html_tag('div', { :id => id, :class => ['listingblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
12
|
+
- if title?
|
13
|
+
div.title= captioned_title
|
14
|
+
div.content
|
15
|
+
- if syntax_hl
|
16
|
+
= (syntax_hl.format self, lang, opts)
|
17
|
+
- else
|
18
|
+
- if @style == 'source'
|
19
|
+
pre class = ['highlight', ('nowrap' if nowrap)]
|
20
|
+
code class = [("language-#{lang}" if lang)] data-lang = ("#{lang}" if lang)
|
21
|
+
= content || ''
|
22
|
+
- else
|
23
|
+
pre class = [('nowrap' if nowrap)]
|
24
|
+
= content || ''
|
data/templates/literal.html.slim
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
= html_tag('div', { :id => id, :class => ['literalblock', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
2
2
|
- if title?
|
3
3
|
.title=title
|
4
4
|
.content: pre class=(!(@document.attr? :prewrap) || (option? 'nowrap') ? 'nowrap' : nil) =content
|
data/templates/olist.html.slim
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
= html_tag('div', { :id => @id, :class => ['olist', @style, role] }.merge(data_attrs(@attributes)))
|
2
2
|
- if title?
|
3
3
|
.title=title
|
4
4
|
ol class=@style start=(attr :start) type=list_marker_keyword
|
5
5
|
- items.each do |item|
|
6
|
-
li class=('fragment' if (option? :step)
|
6
|
+
li class=('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))
|
7
7
|
p=item.text
|
8
8
|
- if item.blocks?
|
9
9
|
=item.content
|
data/templates/open.html.slim
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
- if @parent == @document && @document.doctype == 'book'
|
3
3
|
- puts 'asciidoctor: WARNING: abstract block cannot be used in a document without a title when doctype is book. Excluding block content.'
|
4
4
|
- else
|
5
|
-
|
5
|
+
= html_tag('div', { :id => @id, :class => ['quoteblock', 'abstract', role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
6
6
|
- if title?
|
7
7
|
.title=title
|
8
8
|
blockquote=content
|
9
9
|
- elsif @style == 'partintro' && (@level != 0 || @parent.context != :section || @document.doctype != 'book')
|
10
|
-
- puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\'s a child of a book part. Excluding block content.'
|
10
|
+
- puts 'asciidoctor: ERROR: partintro block can only be used when doctype is book and it\'s a child of a book part. Excluding block content.'
|
11
11
|
- else
|
12
12
|
- if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes')
|
13
13
|
include notes.html.slim
|
14
14
|
- else
|
15
|
-
|
15
|
+
= html_tag('div', { :id => @id, :class => ['openblock', (@style != 'open' ? @style : nil), role, ('fragment' if (option? :step) || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
16
16
|
- if title?
|
17
17
|
.title=title
|
18
18
|
.content=content
|
data/templates/quote.html.slim
CHANGED
data/templates/section.html.slim
CHANGED
@@ -30,35 +30,62 @@
|
|
30
30
|
- if attr? 'background-image'
|
31
31
|
- data_background_image = image_uri(attr 'background-image')
|
32
32
|
|
33
|
+
- if attr? 'background-video'
|
34
|
+
- data_background_video = media_uri(attr 'background-video')
|
35
|
+
|
33
36
|
- if attr? 'background-color'
|
34
37
|
- data_background_color = attr 'background-color'
|
35
38
|
|
39
|
+
- parent_section_with_vertical_slides = @level == 1 && !vertical_slides.empty?
|
40
|
+
|
41
|
+
- content_for :footnotes
|
42
|
+
- slide_footnotes = slide_footnotes(self)
|
43
|
+
- if document.footnotes? && !(parent.attr? 'nofootnotes') && !slide_footnotes.empty?
|
44
|
+
.footnotes
|
45
|
+
- slide_footnotes.each do |footnote|
|
46
|
+
.footnote
|
47
|
+
= "#{footnote.index}. #{footnote.text}"
|
48
|
+
|
49
|
+
- content_for :section
|
50
|
+
section(id=(titleless ? nil : id)
|
51
|
+
class=roles
|
52
|
+
data-transition=(attr 'transition')
|
53
|
+
data-transition-speed=(attr 'transition-speed')
|
54
|
+
data-background-color=data_background_color
|
55
|
+
data-background-image=data_background_image
|
56
|
+
data-background-size=(data_background_size || attr('background-size'))
|
57
|
+
data-background-repeat=(data_background_repeat || attr('background-repeat'))
|
58
|
+
data-background-transition=(data_background_transition || attr('background-transition'))
|
59
|
+
data-background-position=(data_background_position || attr('background-position'))
|
60
|
+
data-background-iframe=(attr "background-iframe")
|
61
|
+
data-background-video=data_background_video
|
62
|
+
data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
|
63
|
+
data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
|
64
|
+
data-background-opacity=(attr "background-opacity")
|
65
|
+
data-autoslide=(attr "autoslide")
|
66
|
+
data-state=(attr 'state'))
|
67
|
+
- unless hide_title
|
68
|
+
h2=section_title
|
69
|
+
- if parent_section_with_vertical_slides
|
70
|
+
- unless (_blocks = blocks - vertical_slides).empty?
|
71
|
+
div.slide-content
|
72
|
+
- _blocks.each do |block|
|
73
|
+
=block.convert
|
74
|
+
- yield_content :footnotes
|
75
|
+
|
76
|
+
- else
|
77
|
+
- unless (_content = content.chomp).empty?
|
78
|
+
div.slide-content
|
79
|
+
=_content
|
80
|
+
- yield_content :footnotes
|
81
|
+
|
82
|
+
- clear_slide_footnotes
|
83
|
+
|
36
84
|
/ RENDERING
|
37
85
|
/ render parent section of vertical slides set
|
38
|
-
- if
|
86
|
+
- if parent_section_with_vertical_slides
|
39
87
|
section
|
40
|
-
|
41
|
-
section(id=(titleless ? nil : id)
|
42
|
-
class=roles
|
43
|
-
data-transition=(attr 'transition')
|
44
|
-
data-transition-speed=(attr 'transition-speed')
|
45
|
-
data-background-color=data_background_color
|
46
|
-
data-background-image=data_background_image
|
47
|
-
data-background-size=(data_background_size || attr('background-size'))
|
48
|
-
data-background-repeat=(data_background_repeat || attr('background-repeat'))
|
49
|
-
data-background-transition=(data_background_transition || attr('background-transition'))
|
50
|
-
data-background-position=(data_background_position || attr('background-position'))
|
51
|
-
data-background-iframe=(attr "background-iframe")
|
52
|
-
data-background-video=(attr "background-video")
|
53
|
-
data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
|
54
|
-
data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
|
55
|
-
data-background-opacity=(attr "background-opacity")
|
56
|
-
data-state=(attr 'state'))
|
57
|
-
|
58
|
-
- unless hide_title
|
59
|
-
h2=title
|
60
|
-
- (blocks - vertical_slides).each do |block|
|
61
|
-
=block.convert
|
88
|
+
- yield_content :section
|
62
89
|
- vertical_slides.each do |subsection|
|
63
90
|
=subsection.convert
|
64
91
|
|
@@ -69,23 +96,4 @@
|
|
69
96
|
h level=(@level) =title
|
70
97
|
=content.chomp
|
71
98
|
- else
|
72
|
-
|
73
|
-
class=roles
|
74
|
-
data-transition=(attr 'transition')
|
75
|
-
data-transition-speed=(attr 'transition-speed')
|
76
|
-
data-background-color=data_background_color
|
77
|
-
data-background-image=data_background_image
|
78
|
-
data-background-size=(data_background_size || attr('background-size'))
|
79
|
-
data-background-repeat=(data_background_repeat || attr('background-repeat'))
|
80
|
-
data-background-transition=(data_background_transition || attr('background-transition'))
|
81
|
-
data-background-position=(data_background_position || attr('background-position'))
|
82
|
-
data-background-iframe=(attr "background-iframe")
|
83
|
-
data-background-video=(attr "background-video")
|
84
|
-
data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
|
85
|
-
data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
|
86
|
-
data-background-opacity=(attr "background-opacity")
|
87
|
-
data-state=(attr 'state'))
|
88
|
-
|
89
|
-
- unless hide_title
|
90
|
-
h2=title
|
91
|
-
=content.chomp
|
99
|
+
- yield_content :section
|
data/templates/sidebar.html.slim
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
- if (has_role? 'aside') or (has_role? 'speaker') or (has_role? 'notes')
|
2
2
|
include notes.html.slim
|
3
3
|
- else
|
4
|
-
|
4
|
+
= html_tag('div', { :id => @id, :class => ['sidebarblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
5
5
|
.content
|
6
6
|
- if title?
|
7
7
|
.title=title
|
data/templates/stem.html.slim
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
- equation = sub_specialcharacters equation
|
5
5
|
- unless (equation.start_with? open) && (equation.end_with? close)
|
6
6
|
- equation = %(#{open}#{equation}#{close})
|
7
|
-
|
7
|
+
= html_tag('div', { :id => @id, :class => ['stemblock', role, ('fragment' if (option? :step) || (has_role? 'step') || (attr? 'step'))] }.merge(data_attrs(@attributes)))
|
8
8
|
- if title?
|
9
9
|
.title=title
|
10
10
|
.content=equation
|
@@ -0,0 +1,65 @@
|
|
1
|
+
javascript:
|
2
|
+
var dom = {};
|
3
|
+
dom.slides = document.querySelector('.reveal .slides');
|
4
|
+
|
5
|
+
function getRemainingHeight(element, slideElement, height) {
|
6
|
+
height = height || 0;
|
7
|
+
if (element) {
|
8
|
+
var newHeight, oldHeight = element.style.height;
|
9
|
+
// Change the .stretch element height to 0 in order find the height of all
|
10
|
+
// the other elements
|
11
|
+
element.style.height = '0px';
|
12
|
+
// In Overview mode, the parent (.slide) height is set of 700px.
|
13
|
+
// Restore it temporarily to its natural height.
|
14
|
+
slideElement.style.height = 'auto';
|
15
|
+
newHeight = height - slideElement.offsetHeight;
|
16
|
+
// Restore the old height, just in case
|
17
|
+
element.style.height = oldHeight + 'px';
|
18
|
+
// Clear the parent (.slide) height. .removeProperty works in IE9+
|
19
|
+
slideElement.style.removeProperty('height');
|
20
|
+
return newHeight;
|
21
|
+
}
|
22
|
+
return height;
|
23
|
+
}
|
24
|
+
|
25
|
+
function layoutSlideContents(width, height) {
|
26
|
+
// Handle sizing of elements with the 'stretch' class
|
27
|
+
toArray(dom.slides.querySelectorAll('section .stretch')).forEach(function (element) {
|
28
|
+
// Determine how much vertical space we can use
|
29
|
+
var limit = 5; // hard limit
|
30
|
+
var parent = element.parentNode;
|
31
|
+
while (parent.nodeName !== 'SECTION' && limit > 0) {
|
32
|
+
parent = parent.parentNode;
|
33
|
+
limit--;
|
34
|
+
}
|
35
|
+
if (limit === 0) {
|
36
|
+
// unable to find parent, aborting!
|
37
|
+
return;
|
38
|
+
}
|
39
|
+
var remainingHeight = getRemainingHeight(element, parent, height);
|
40
|
+
// Consider the aspect ratio of media elements
|
41
|
+
if (/(img|video)/gi.test(element.nodeName)) {
|
42
|
+
var nw = element.naturalWidth || element.videoWidth, nh = element.naturalHeight || element.videoHeight;
|
43
|
+
var es = Math.min(width / nw, remainingHeight / nh);
|
44
|
+
element.style.width = (nw * es) + 'px';
|
45
|
+
element.style.height = (nh * es) + 'px';
|
46
|
+
} else {
|
47
|
+
element.style.width = width + 'px';
|
48
|
+
element.style.height = remainingHeight + 'px';
|
49
|
+
}
|
50
|
+
});
|
51
|
+
}
|
52
|
+
|
53
|
+
function toArray(o) {
|
54
|
+
return Array.prototype.slice.call(o);
|
55
|
+
}
|
56
|
+
|
57
|
+
Reveal.addEventListener('slidechanged', function () {
|
58
|
+
layoutSlideContents(#{attr 'revealjs_width', 960}, #{attr 'revealjs_height', 700})
|
59
|
+
});
|
60
|
+
Reveal.addEventListener('ready', function () {
|
61
|
+
layoutSlideContents(#{attr 'revealjs_width', 960}, #{attr 'revealjs_height', 700})
|
62
|
+
});
|
63
|
+
Reveal.addEventListener('resize', function () {
|
64
|
+
layoutSlideContents(#{attr 'revealjs_width', 960}, #{attr 'revealjs_height', 700})
|
65
|
+
});
|
data/templates/table.html.slim
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
- classes = ['tableblock', "frame-#{attr :frame, 'all'}", "grid-#{attr :grid, 'all'}", role, ('fragment' if (option? :step) || (attr? 'step'))]
|
2
|
+
- styles = [("width:#{attr :tablepcwidth}%" unless option? 'autowidth'), ("float:#{attr :float}" if attr? :float)].compact.join('; ')
|
3
|
+
= html_tag('table', { :id => @id, :class => classes, :style => styles }.merge(data_attrs(@attributes)))
|
3
4
|
- if title?
|
4
5
|
caption.title=captioned_title
|
5
6
|
- unless (attr :rowcount).zero?
|