asciidoctor-revealjs 4.0.1 → 4.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +75 -35
  3. data/Rakefile +18 -3
  4. data/asciidoctor-revealjs.gemspec +1 -1
  5. data/examples/a11y-dark.css +99 -0
  6. data/examples/autoslide.adoc +22 -0
  7. data/examples/custom-layout.adoc +10 -0
  8. data/examples/data-attributes.adoc +245 -0
  9. data/examples/font-awesome-specific-version.adoc +11 -0
  10. data/examples/font-awesome.adoc +16 -2
  11. data/examples/footnotes.adoc +46 -0
  12. data/examples/fragments.adoc +12 -0
  13. data/examples/grid-layout-3x2.adoc +50 -0
  14. data/examples/grid-layout-docinfo-revealjs.html +1 -1
  15. data/examples/grid-layout.adoc +21 -1
  16. data/examples/images/cute-cat-1.jpg +0 -0
  17. data/examples/images/cute-cat-2.jpg +0 -0
  18. data/examples/images/cute-cat-3.jpg +0 -0
  19. data/examples/images/flock-of-seagulls_daniel-simion.mp3 +0 -0
  20. data/examples/issue-grid-layout-images.adoc +25 -0
  21. data/examples/mathjax-cdn.adoc +21 -0
  22. data/examples/mathjax.adoc +20 -0
  23. data/examples/release-4.0.adoc +2 -5
  24. data/examples/release-4.1.adoc +133 -0
  25. data/examples/release-4.1.css +50 -0
  26. data/examples/revealjs-custom-theme.adoc +10 -0
  27. data/examples/steps.adoc +87 -0
  28. data/examples/text-alignments.adoc +44 -0
  29. data/examples/video.adoc +19 -6
  30. data/lib/asciidoctor-revealjs/converter.rb +754 -647
  31. data/lib/asciidoctor-revealjs/version.rb +1 -1
  32. data/templates/admonition.html.slim +1 -1
  33. data/templates/asciidoctor-compatibility.css +303 -54
  34. data/templates/audio.html.slim +1 -1
  35. data/templates/colist.html.slim +1 -1
  36. data/templates/dlist.html.slim +3 -3
  37. data/templates/document.html.slim +12 -7
  38. data/templates/example.html.slim +1 -1
  39. data/templates/helpers.rb +80 -7
  40. data/templates/image.html.slim +2 -2
  41. data/templates/inline_anchor.html.slim +5 -4
  42. data/templates/inline_button.html.slim +2 -1
  43. data/templates/inline_footnote.html.slim +11 -4
  44. data/templates/inline_image.html.slim +2 -5
  45. data/templates/inline_kbd.html.slim +3 -2
  46. data/templates/inline_menu.html.slim +4 -3
  47. data/templates/inline_quoted.html.slim +13 -21
  48. data/templates/listing.html.slim +14 -9
  49. data/templates/literal.html.slim +1 -1
  50. data/templates/olist.html.slim +2 -2
  51. data/templates/open.html.slim +3 -3
  52. data/templates/paragraph.html.slim +1 -1
  53. data/templates/quote.html.slim +1 -1
  54. data/templates/section.html.slim +18 -1
  55. data/templates/sidebar.html.slim +1 -1
  56. data/templates/stem.html.slim +1 -1
  57. data/templates/table.html.slim +3 -2
  58. data/templates/ulist.html.slim +3 -3
  59. data/templates/verse.html.slim +1 -1
  60. data/templates/video.html.slim +14 -8
  61. metadata +26 -10
  62. data/CHANGELOG.adoc +0 -546
  63. data/HACKING.adoc +0 -412
@@ -0,0 +1,25 @@
1
+ // .issue-grid-layout-images
2
+ // Images would get shrunk before we added a flex-basis auto exception when columns wrap
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = Grid Wrapping Tests
6
+ :imagesdir: images/
7
+ // reveal.js config
8
+ :revealjs_hash: true
9
+ :revealjs_center: false
10
+ :revealjs_height: 1080
11
+ :revealjs_width: 1920
12
+
13
+ [.columns.wrap]
14
+ == Should Wrap But Doesn't
15
+
16
+ [.column]
17
+ * Things here should wrap
18
+ * But instead images shrink
19
+ * But now it's good
20
+
21
+ [.column]
22
+ image::cover.jpg[width=900px]
23
+
24
+ [.column]
25
+ image::70s.jpg[width=900px]
@@ -0,0 +1,21 @@
1
+ // .mathjax-cdn
2
+ // Demonstration of the Mathjax :mathjaxdir: attribute in action
3
+ // :include: //head/link | //div[@class="slides"]
4
+ // :header_footer:
5
+ = MathJax
6
+ :stem:
7
+ :revealjsdir: https://cdn.jsdelivr.net/npm/reveal.js@3.9.2
8
+ :mathjaxdir: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/
9
+
10
+ == Math Equation
11
+
12
+ Using standard latexmath:[\LaTeX] syntax:
13
+
14
+ [stem]
15
+ ++++
16
+ \sqrt{37} = \sqrt{\frac{73^2-1}{12^2}} \approx \frac{73}{12} (1 - \frac{1}{2\cdot73^2})
17
+ ++++
18
+
19
+ Another one:
20
+
21
+ stem:[\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}]
@@ -0,0 +1,20 @@
1
+ // .mathjax
2
+ // Demonstration of our Mathjax integration
3
+ // :include: //div[@class="slides"]
4
+ // :header_footer:
5
+ = MathJax
6
+ :stem:
7
+ :revealjsdir: https://cdn.jsdelivr.net/npm/reveal.js@3.9.2
8
+
9
+ == Math Equation
10
+
11
+ Using standard latexmath:[\LaTeX] syntax:
12
+
13
+ [stem]
14
+ ++++
15
+ \sqrt{37} = \sqrt{\frac{73^2-1}{12^2}} \approx \frac{73}{12} (1 - \frac{1}{2\cdot73^2})
16
+ ++++
17
+
18
+ Another one:
19
+
20
+ stem:[\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}]
@@ -1,4 +1,4 @@
1
- = Asciidoctor reveal.js 4.0.0
1
+ = Asciidoctor reveal.js 4.0
2
2
  :source-highlighter: highlight.js
3
3
  :highlightjs-languages: x86asm,asciidoc
4
4
  :icons: font
@@ -11,11 +11,8 @@
11
11
  == Supports all of reveal.js 3.9.2 features
12
12
 
13
13
 
14
- [background-video="synthwave.mp4",background-opacity=0.7]
14
+ [background-video="https://github.com/obilodeau/asciidoctor-assets/raw/master/videos/synthwave.mp4",background-opacity=0.7]
15
15
  === Background videos
16
- // Video not hosted in git due to size
17
- // Available here: https://pixabay.com/videos/synthwave-retro-sunset-retrowave-29225/
18
- // Pixabay Free License (No Attribution Required)
19
16
 
20
17
  === Automatic Source Code Highlighting!
21
18
 
@@ -0,0 +1,133 @@
1
+ = Asciidoctor reveal.js 4.1
2
+ :source-highlighter: highlight.js
3
+ :highlightjs-theme: a11y-dark.css
4
+ :highlightjs-languages: asciidoc
5
+ :icons: font
6
+ :imagesdir: images/
7
+ // reveal.js config
8
+ :customcss: release-4.1.css
9
+ :revealjs_hash: true
10
+ :revealjs_width: 1080
11
+
12
+ == New Features icon:rocket[set=fas]
13
+
14
+ == Steps
15
+
16
+ You can use steps to [.highlight-strong.step]#highlight# or [.highlight-strong.step]#incrementally reveal individual elements# on a slide!
17
+
18
+ [%notitle]
19
+ === Cats!
20
+
21
+ [.grow,step=1]
22
+ Here's some cute cats!
23
+
24
+ image:cute-cat-1.jpg[cute-cat-laying,step=4]
25
+ image:cute-cat-2.jpg[cute-cat-yawning,step=2]
26
+ image:cute-cat-3.jpg[cute-cat-melting,step=3]
27
+
28
+ [%notitle]
29
+ === List
30
+
31
+ You can declare the `%step` option on lists...
32
+
33
+ [%step]
34
+ * α
35
+ * β
36
+ * γ
37
+
38
+ [%notitle]
39
+ === Blocks
40
+
41
+ ...or on virtually any block like code blocks, tables, images or paragraphs
42
+
43
+ [%step]
44
+ --
45
+ [.highlight-blue%step]
46
+ blue
47
+
48
+ white
49
+
50
+ [.highlight-red%step]
51
+ red
52
+ --
53
+
54
+ == Footnotesfootnote:[Just a title, nothing more.]
55
+
56
+ [%notitle]
57
+ === Press Release
58
+
59
+ The hail-and-rainbow protocol can be initiated at three levels:
60
+
61
+ . doublefootnote:[The double hail-and-rainbow level makes my toes tingle.]
62
+ . tertiary
63
+ . supermassive
64
+
65
+ A bold statement!footnote:disclaimer[Opinions are my own.]
66
+
67
+ Another outrageous statement.footnote:disclaimer[]
68
+
69
+ == Data attributes
70
+
71
+ You can declare custom data attributes on _virtually any blocks_ using AsciiDoc attributes prefixed by `data-`. +
72
+ Here's an example:
73
+
74
+ [source, asciidoc]
75
+ ----
76
+ == Atom podium
77
+
78
+ [data-medal=gold]
79
+ . Protons
80
+
81
+ [data-medal=silver]
82
+ . Electrons
83
+
84
+ [data-medal=bronze]
85
+ . Neutrons
86
+ ----
87
+
88
+ == Font Awesome icon:font-awesome-flag[set=fab]
89
+
90
+ * Version 5.13.0
91
+ * Support icon sets (using `set` attribute)
92
+ ** *Brand:* icon:firefox[set=fab]
93
+ ** *Solid*: icon:address-book[set=fas]
94
+ ** *Regular*: icon:address-book[set=far]
95
+ * `font-awesome-version` attribute
96
+
97
+ == MathJax
98
+
99
+ * Version 2.7.6
100
+ * `mathjaxdir` attributefootnote:[Configure MathJax location.]
101
+
102
+ [.text-left]
103
+ == Built-in text alignments
104
+
105
+ [%notitle]
106
+ === Text Alignments
107
+
108
+ [.text-left]
109
+ --
110
+ [.text-align-attr]`[.text-left]` +
111
+ Let's go to the left!
112
+ --
113
+
114
+ [.text-center]
115
+ --
116
+ [.text-align-attr]`[.text-center]` +
117
+ Right in the middle
118
+ --
119
+
120
+ [.text-right]
121
+ --
122
+ [.text-align-attr]`[.text-right]` +
123
+ Now to the right!
124
+ --
125
+
126
+ [transition=fade,transition-speed=slow]
127
+ == Learn More!
128
+
129
+ * https://github.com/asciidoctor/asciidoctor-reveal.js/[Asciidoctor reveal.js]
130
+ * https://revealjs.com[reveal.js]
131
+ * https://github.com/asciidoctor/asciidoctor/[Asciidoctor]
132
+ * https://asciidoctor.org/docs/what-is-asciidoc/[What is AsciiDoc?]
133
+ * https://github.com/asciidoctor/asciidoctor-reveal.js/raw/master/examples/release-4.1.adoc[This slide deck's AsciiDoc source]
@@ -0,0 +1,50 @@
1
+ .reveal .slides section .fragment.highlight-strong{
2
+ opacity: 1;
3
+ visibility: inherit;
4
+ background-image: linear-gradient(transparent 7px, #0352a7 0);
5
+ background-size: 0;
6
+ background-repeat: no-repeat;
7
+ display: inline;
8
+ -webkit-transition: 0.5s ease;
9
+ transition: 0.5s ease;
10
+ }
11
+
12
+ .reveal .slides section .fragment.highlight-strong.visible {
13
+ background-size: 100%;
14
+ }
15
+
16
+ .reveal .slides section :not(pre) > code {
17
+ padding: .2em .4em;
18
+ margin: 0;
19
+ font-size: 85%;
20
+ background-color: #8787877a;
21
+ border-radius: 6px;
22
+ font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
23
+ }
24
+
25
+ .reveal .slides .paragraph + .ulist {
26
+ padding-top: 2rem;
27
+ }
28
+
29
+ .reveal .slides .paragraph + .openblock {
30
+ padding-top: 2rem;
31
+ }
32
+
33
+ .reveal .slides .paragraph + .listingblock {
34
+ padding-top: 2rem;
35
+ }
36
+
37
+ .footnotes {
38
+ border-top: 1px solid #fff3;
39
+ color: #c3c3c3;
40
+ }
41
+
42
+ .reveal .slides section :not(pre) > code.text-align-attr {
43
+ padding: 0;
44
+ margin: 0;
45
+ font-size: 1.5rem;
46
+ background-color: transparent;
47
+ border-radius: 6px;
48
+ color: #f5ab35;
49
+ font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
50
+ }
@@ -0,0 +1,10 @@
1
+ // .revealjs-custom-theme
2
+ // :include: //head//link[@rel="stylesheet"]
3
+ // :header_footer:
4
+ = Use a Custom reveal.js Theme
5
+ // please note that in this specific case it would be better to use :revealjs_theme: beige
6
+ :revealjs_customtheme: reveal.js/css/theme/beige.css
7
+
8
+ == Beige is the New Black
9
+
10
+ Some text.
@@ -0,0 +1,87 @@
1
+ // .steps
2
+ // :include: //div[@class="slides"]
3
+ // :header_footer:
4
+ = Steps
5
+ :revealjs_hash: true
6
+ :revealjs_autoSlide: 2000
7
+
8
+ == Unordered List
9
+
10
+ [%step]
11
+ * Edgar Allan Poe
12
+ * Sheri S. Tepper
13
+ * Bill Bryson
14
+
15
+ == Ordered List
16
+
17
+ [%step]
18
+ . Protons
19
+ . Electrons
20
+ . Neutrons
21
+
22
+ == Paragraphs With Style
23
+
24
+ [.highlight-blue%step]
25
+ blue
26
+
27
+ [%step]
28
+ white
29
+
30
+ [.highlight-red%step]
31
+ red
32
+
33
+ == Admonition Order
34
+
35
+ [TIP,step=3]
36
+ Finally, a pro tip...
37
+
38
+ [WARNING,step=1]
39
+ First, watch out for...
40
+
41
+ [IMPORTANT.fade-up,step=2]
42
+ Second, don't forget...
43
+
44
+ == Inline Images
45
+ :imagesdir: images
46
+
47
+ image:cute-cat-1.jpg[cute-cat-laying,step=3]
48
+ image:cute-cat-2.jpg[cute-cat-yawning,step=1]
49
+ image:cute-cat-3.jpg[cute-cat-melting,step=2]
50
+
51
+ == Image Blocks
52
+
53
+ image::cute-cat-1.jpg[cute-cat-laying,height="100px",step=]
54
+
55
+ image::cute-cat-2.jpg[cute-cat-yawning,height="100px",step=]
56
+
57
+ image::cute-cat-3.jpg[cute-cat-melting,height="100px",step=]
58
+
59
+ == Lists
60
+
61
+ [%step]
62
+ --
63
+ .First
64
+ * a
65
+ * b
66
+ * c
67
+ --
68
+
69
+ [%step]
70
+ --
71
+ .Second
72
+ [%step]
73
+ * d
74
+ * e
75
+ * f
76
+ --
77
+
78
+ == Inline Phrases
79
+
80
+ The [.step.highlight-red]#greatest glory in living# lies not in never falling,
81
+ but in [.step.highlight-red]#rising every time we fall#.
82
+
83
+ == Inside a List
84
+
85
+ . [.step]#Protons#
86
+ . [.step]#Electrons#
87
+ . [.step]#Neutrons#
@@ -0,0 +1,44 @@
1
+ = Text Alignments
2
+
3
+ == Default
4
+
5
+ This is the default (boring) alignment!
6
+
7
+ == Center
8
+
9
+ [.text-center]
10
+ This text is centered.
11
+
12
+ == Left
13
+
14
+ [.text-left]
15
+ This text is left-aligned.
16
+
17
+ == Right
18
+
19
+ [.text-right]
20
+ This text is right-aligned.
21
+
22
+ == Justified
23
+
24
+ [.text-justify]
25
+ This text is justified.
26
+
27
+ [.text-right]
28
+ == Title is Right-Aligned
29
+
30
+ Content too!
31
+
32
+ == Back to Normal!
33
+
34
+ Content too!
35
+
36
+ [.text-left]
37
+ == Title is Left-Aligned
38
+
39
+ Content too!
40
+
41
+ [.text-center]
42
+ == Title is Centered
43
+
44
+ Content too!
@@ -4,11 +4,15 @@
4
4
  // :header_footer:
5
5
  = Video tests
6
6
  :revealjs_hash: true
7
+ :imagesdir: images/
7
8
 
8
9
  == YouTube Auto-sized
9
10
 
11
+ video::kZH9JtPBq7k[youtube, start=34]
12
+
13
+ == YouTube Auto-sized Auto-starts
14
+
10
15
  video::kZH9JtPBq7k[youtube, start=34, options=autoplay]
11
- //video::kZH9JtPBq7k[youtube, start=34, height=600, width=800, options=autoplay]
12
16
 
13
17
  [%notitle]
14
18
  == YouTube Auto-sized notitle
@@ -25,17 +29,26 @@ This video is auto-sized!
25
29
  video::https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm[]
26
30
 
27
31
  [%notitle,background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&start=3&enablejsapi=1&autoplay=1&loop=1&controls=0&modestbranding=1"]
28
- == background
32
+ == background video at URL
29
33
 
30
34
  [%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]
31
- == video file, named attributes
35
+ == background video at URL with named attributes
32
36
 
33
37
  [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"]
38
+ == background video at URL with options
39
+
40
+ // Download this file and put in examples/images/ for this to be visible
41
+ // https://github.com/obilodeau/asciidoctor-assets/blob/master/videos/synthwave.mp4
42
+ [%notitle,background-video="synthwave.mp4",background-video-loop=true,background-video-muted=true]
43
+ == background video file with named attributes
44
+
45
+ // Download this file and put in examples/images/ for this to be visible
46
+ // https://github.com/obilodeau/asciidoctor-assets/blob/master/videos/synthwave.mp4
34
47
  == video file, options
35
48
 
49
+ video::synthwave.mp4[options="autoplay,loop"]
50
+
51
+
36
52
  == vimeo autostart
37
53
 
38
54
  video::44878206[vimeo, options=autoplay]
39
-
40
- // data-autoplay is not supported on vimeo videos
41
- // upstream: https://github.com/hakimel/reveal.js/issues/388