asciidoctor-revealjs 3.1.0 → 4.0.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 +86 -0
- data/HACKING.adoc +18 -11
- data/README.adoc +260 -27
- data/Rakefile +12 -4
- data/asciidoctor-revealjs.gemspec +4 -2
- data/examples/docinfo-footer-revealjs.html +10 -0
- data/examples/docinfo-revealjs.html +7 -0
- data/examples/font-awesome.adoc +2 -1
- data/examples/font-awesome.css +3 -0
- data/examples/fragments.adoc +32 -0
- data/examples/fragments.css +18 -0
- data/examples/grid-layout-docinfo-revealjs.html +11 -0
- data/examples/grid-layout.adoc +174 -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/level-sectnums.adoc +24 -0
- data/examples/links-preview.adoc +32 -0
- data/examples/links.adoc +39 -0
- data/examples/release-4.0.adoc +195 -0
- data/examples/release-4.0.css +23 -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/video.adoc +12 -3
- data/examples/with-docinfo-shared.adoc +13 -0
- data/lib/asciidoctor-revealjs/converter.rb +312 -136
- data/lib/asciidoctor-revealjs/highlightjs.rb +333 -2
- data/lib/asciidoctor-revealjs/version.rb +1 -1
- data/templates/asciidoctor-compatibility.css +141 -0
- data/templates/document.html.slim +64 -53
- data/templates/helpers.rb +93 -1
- data/templates/image.html.slim +1 -1
- data/templates/inline_anchor.html.slim +2 -1
- data/templates/inline_image.html.slim +3 -3
- data/templates/listing.html.slim +1 -1
- data/templates/section.html.slim +34 -43
- data/templates/stretch_nested_elements.js.slim +65 -0
- data/templates/title_slide.html.slim +28 -0
- metadata +55 -8
- data/examples/revealjs-features.adoc +0 -23
- data/templates/asciidoctor_revealjs.css.slim +0 -59
@@ -0,0 +1,24 @@
|
|
1
|
+
// .sections
|
2
|
+
// Demonstration of section numbers and their specific reveal.js integration.
|
3
|
+
// :include: //div[@class="slides"]
|
4
|
+
// :header_footer:
|
5
|
+
= Sectnums
|
6
|
+
:backend: revealjs
|
7
|
+
:sectnums:
|
8
|
+
:sectnumlevels: 2
|
9
|
+
|
10
|
+
== First level
|
11
|
+
|
12
|
+
First content
|
13
|
+
|
14
|
+
== Vertical
|
15
|
+
|
16
|
+
Vertical slides are using level 2 sections
|
17
|
+
|
18
|
+
=== Level 2
|
19
|
+
|
20
|
+
==== Level 3 does not have sectnum, sectnumlevels is 2
|
21
|
+
|
22
|
+
== Horizontal slide
|
23
|
+
|
24
|
+
=== Also supports levels
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// .links-with-preview
|
2
|
+
// Demonstration of reveal.js global data-preview-link feature
|
3
|
+
// :include: //div[@class="slides"] | //body/*[last()-1]
|
4
|
+
// :header_footer:
|
5
|
+
= Links With Preview Tests
|
6
|
+
:revealjs_previewlinks: True
|
7
|
+
:imagesdir: images/
|
8
|
+
|
9
|
+
== Set Globally
|
10
|
+
|
11
|
+
https://en.wikipedia.org/wiki/February_4[Here's a link]
|
12
|
+
|
13
|
+
== Disabled Locally
|
14
|
+
|
15
|
+
https://en.wikipedia.org/wiki/February_4[Link One, preview=false]
|
16
|
+
|
17
|
+
https://en.wikipedia.org/wiki/February_4[Link Two, preview=0]
|
18
|
+
|
19
|
+
https://en.wikipedia.org/wiki/February_4[Link Three, preview=False]
|
20
|
+
|
21
|
+
== Image block with a Link
|
22
|
+
|
23
|
+
image::70s.jpg[link="https://montrehack.ca/"]
|
24
|
+
|
25
|
+
== Image block with a Link Disabled Locally
|
26
|
+
|
27
|
+
image::70s.jpg[link="https://montrehack.ca/", link_preview=false]
|
28
|
+
|
29
|
+
== Inlined Images
|
30
|
+
|
31
|
+
image:70s.jpg[link="https://montrehack.ca/", width=200px]
|
32
|
+
image:70s.jpg[link="https://montrehack.ca/", width=200px, link_preview=false]
|
data/examples/links.adoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
// .links
|
2
|
+
// Demonstration of reveal.js and AsciiDoc links
|
3
|
+
// :include: //div[@class="slides"]
|
4
|
+
// :header_footer:
|
5
|
+
= Links
|
6
|
+
:imagesdir: images/
|
7
|
+
|
8
|
+
== Regular
|
9
|
+
|
10
|
+
https://en.wikipedia.org/wiki/February_4[Link]
|
11
|
+
|
12
|
+
https://en.wikipedia.org/wiki/February_4[In new Window, window="_blank"]
|
13
|
+
|
14
|
+
https://en.wikipedia.org/wiki/February_4[In new Window (alternate syntax)^]
|
15
|
+
|
16
|
+
|
17
|
+
== With iFrame Preview Overlay
|
18
|
+
|
19
|
+
https://en.wikipedia.org/wiki/February_4[Link One, preview=true]
|
20
|
+
|
21
|
+
https://en.wikipedia.org/wiki/February_4[Link Two, preview=1]
|
22
|
+
|
23
|
+
https://en.wikipedia.org/wiki/February_4[Link Three, preview=True]
|
24
|
+
|
25
|
+
|
26
|
+
== Image Block with a Link
|
27
|
+
|
28
|
+
image::70s.jpg[link="https://montrehack.ca/", window="_blank"]
|
29
|
+
|
30
|
+
|
31
|
+
== Image Block with a Link With iFrame Preview
|
32
|
+
|
33
|
+
image::70s.jpg[link="https://montrehack.ca/", link_preview=true]
|
34
|
+
|
35
|
+
|
36
|
+
== Inlined Images
|
37
|
+
|
38
|
+
image:70s.jpg[link="https://montrehack.ca/", width=200px]
|
39
|
+
image:70s.jpg[link="https://montrehack.ca/", width=200px, link_preview=true]
|
@@ -0,0 +1,195 @@
|
|
1
|
+
= Asciidoctor reveal.js 4.0.0
|
2
|
+
:source-highlighter: highlight.js
|
3
|
+
:highlightjs-languages: x86asm,asciidoc
|
4
|
+
:icons: font
|
5
|
+
:imagesdir: images/
|
6
|
+
// reveal.js config
|
7
|
+
:customcss: release-4.0.css
|
8
|
+
:revealjs_hash: true
|
9
|
+
:revealjs_width: 1080
|
10
|
+
|
11
|
+
== Supports all of reveal.js 3.9.2 features
|
12
|
+
|
13
|
+
|
14
|
+
[background-video="synthwave.mp4",background-opacity=0.7]
|
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
|
+
|
20
|
+
=== Automatic Source Code Highlighting!
|
21
|
+
|
22
|
+
icon:exclamation-circle[] Including step-by-step line highlights
|
23
|
+
|
24
|
+
[.columns.is-vcentered]
|
25
|
+
=== Assembly from a Compiler
|
26
|
+
|
27
|
+
[.column]
|
28
|
+
[source,x86asm,highlight="3..6|7..9|10|11,12"]
|
29
|
+
----
|
30
|
+
main proc near
|
31
|
+
var_10 = dword ptr -10h
|
32
|
+
push ebp
|
33
|
+
mov ebp, esp
|
34
|
+
and esp, 0FFFFFFF0h
|
35
|
+
sub esp, 10h
|
36
|
+
mov eax, offset aHelloWorld
|
37
|
+
mov [esp+10h+var_10], eax
|
38
|
+
call _printf
|
39
|
+
mov eax, 0
|
40
|
+
leave
|
41
|
+
retn
|
42
|
+
main endp
|
43
|
+
----
|
44
|
+
|
45
|
+
[.column.is-one-third]
|
46
|
+
--
|
47
|
+
* Backed by Highlight.js
|
48
|
+
* Many languages supported
|
49
|
+
* Ability to focus on specific lines
|
50
|
+
--
|
51
|
+
|
52
|
+
=== With very simple source!
|
53
|
+
|
54
|
+
[source,asciidoc]
|
55
|
+
....
|
56
|
+
[source,x86asm,highlight="3..6|7..9|10|11,12"]
|
57
|
+
----
|
58
|
+
main proc near
|
59
|
+
var_10 = dword ptr -10h
|
60
|
+
push ebp
|
61
|
+
mov ebp, esp
|
62
|
+
and esp, 0FFFFFFF0h
|
63
|
+
sub esp, 10h
|
64
|
+
mov eax, offset aHelloWorld
|
65
|
+
mov [esp+10h+var_10], eax
|
66
|
+
call _printf
|
67
|
+
mov eax, 0
|
68
|
+
leave
|
69
|
+
retn
|
70
|
+
main endp
|
71
|
+
----
|
72
|
+
....
|
73
|
+
|
74
|
+
=== And More!
|
75
|
+
|
76
|
+
* Background images (and gif!)
|
77
|
+
* Speaker notes
|
78
|
+
* Embedded videos
|
79
|
+
* Embedded and interactive iframes
|
80
|
+
* etc.
|
81
|
+
|
82
|
+
|
83
|
+
[.columns.is-vcentered]
|
84
|
+
== Plus AsciiDoc Features
|
85
|
+
|
86
|
+
[.column]
|
87
|
+
--
|
88
|
+
image::asciidoctor-logo.svg[]
|
89
|
+
|
90
|
+
Powered by Asciidoctor
|
91
|
+
--
|
92
|
+
|
93
|
+
[.column]
|
94
|
+
.Available toolchains
|
95
|
+
* Ruby / Bundler
|
96
|
+
* JavaScript / NPM
|
97
|
+
* Standalone executables
|
98
|
+
* icon:exclamation-circle[] JVM / Maven
|
99
|
+
|
100
|
+
[.columns.is-vcentered]
|
101
|
+
=== Easy Grid Layout
|
102
|
+
|
103
|
+
[.column]
|
104
|
+
* Easy
|
105
|
+
|
106
|
+
[.column]
|
107
|
+
* Flexible
|
108
|
+
|
109
|
+
[.column]
|
110
|
+
Grid Layout
|
111
|
+
|
112
|
+
[.column.is-one-third]
|
113
|
+
--
|
114
|
+
[source,asciidoc]
|
115
|
+
.Source
|
116
|
+
....
|
117
|
+
[.columns]
|
118
|
+
=== Easy Grid Layout
|
119
|
+
|
120
|
+
[.column]
|
121
|
+
* Easy
|
122
|
+
|
123
|
+
[.column]
|
124
|
+
* Flexible
|
125
|
+
|
126
|
+
[.column]
|
127
|
+
Grid Layout
|
128
|
+
|
129
|
+
[.column.is-one-third]
|
130
|
+
[source,asciidoc]
|
131
|
+
[...]
|
132
|
+
....
|
133
|
+
--
|
134
|
+
|
135
|
+
[.columns.is-vcentered]
|
136
|
+
=== FontAwesome Integration
|
137
|
+
|
138
|
+
[.column.is-one-third]
|
139
|
+
--
|
140
|
+
Expressive icon:palette[] Icons icon:icons[]
|
141
|
+
at your Fingertips icon:hand-holding-heart[]
|
142
|
+
|
143
|
+
[.red]
|
144
|
+
icon:heart[size=3x]
|
145
|
+
--
|
146
|
+
|
147
|
+
[.column]
|
148
|
+
--
|
149
|
+
[source,asciidoc]
|
150
|
+
.Source
|
151
|
+
....
|
152
|
+
Expressive icon:palette[]
|
153
|
+
Icons icon:icons[]
|
154
|
+
at your Fingertips
|
155
|
+
icon:hand-holding-heart[]
|
156
|
+
|
157
|
+
[.red]
|
158
|
+
icon:heart[size=3x]
|
159
|
+
....
|
160
|
+
--
|
161
|
+
|
162
|
+
[.columns]
|
163
|
+
=== Includes
|
164
|
+
|
165
|
+
[.column]
|
166
|
+
You can include content from other files.
|
167
|
+
Including source code!
|
168
|
+
|
169
|
+
[.column]
|
170
|
+
--
|
171
|
+
[source,asciidoc]
|
172
|
+
.Example Source
|
173
|
+
....
|
174
|
+
[source,python]
|
175
|
+
----
|
176
|
+
\include::demo.py[]
|
177
|
+
----
|
178
|
+
....
|
179
|
+
--
|
180
|
+
|
181
|
+
=== For Great Technical Presentations!
|
182
|
+
|
183
|
+
|
184
|
+
[.important.white.background,transition="zoom"]
|
185
|
+
== Can you do that PowerPoint?
|
186
|
+
|
187
|
+
|
188
|
+
[transition=fade,transition-speed=slow]
|
189
|
+
== Learn More!
|
190
|
+
|
191
|
+
* https://github.com/asciidoctor/asciidoctor-reveal.js/[Asciidoctor reveal.js]
|
192
|
+
* https://revealjs.com[reveal.js]
|
193
|
+
* https://github.com/asciidoctor/asciidoctor/[Asciidoctor]
|
194
|
+
* https://asciidoctor.org/docs/what-is-asciidoc/[What is AsciiDoc?]
|
195
|
+
* https://github.com/asciidoctor/asciidoctor-reveal.js/raw/master/examples/release-4.0.adoc[This slide deck's AsciiDoc source]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@import url('https://fonts.googleapis.com/css?family=Permanent+Marker&display=swap');
|
2
|
+
section.white.background {
|
3
|
+
background-color: white;
|
4
|
+
}
|
5
|
+
|
6
|
+
section.important h2 {
|
7
|
+
font-family: 'Permanent Marker', cursive;
|
8
|
+
text-transform: none;
|
9
|
+
font-size: 3em;
|
10
|
+
}
|
11
|
+
|
12
|
+
div.red > p > span.icon {
|
13
|
+
color: red;
|
14
|
+
}
|
15
|
+
|
16
|
+
/* theme overrides */
|
17
|
+
.reveal pre code {
|
18
|
+
max-height: none;
|
19
|
+
}
|
20
|
+
.reveal section img {
|
21
|
+
background: none;
|
22
|
+
border: none;
|
23
|
+
}
|
@@ -31,3 +31,18 @@ to your `Gemfile` and re-run:
|
|
31
31
|
|
32
32
|
puts 'Hello, world!'
|
33
33
|
----
|
34
|
+
|
35
|
+
== Highlight Lines
|
36
|
+
|
37
|
+
// TODO linenums CSS negatively affects the output
|
38
|
+
// TODO highlighting is invisible
|
39
|
+
|
40
|
+
[source,ruby,highlight=2..5]
|
41
|
+
----
|
42
|
+
ORDERED_LIST_KEYWORDS = {
|
43
|
+
'loweralpha' => 'a',
|
44
|
+
'lowerroman' => 'i',
|
45
|
+
'upperalpha' => 'A',
|
46
|
+
'upperroman' => 'I',
|
47
|
+
}
|
48
|
+
----
|
@@ -0,0 +1,128 @@
|
|
1
|
+
// .source-emphasis
|
2
|
+
// Demonstration of highlighting portions of source
|
3
|
+
// :include: //div[@class="slides"]
|
4
|
+
// :header_footer:
|
5
|
+
= Source Code Emphasis
|
6
|
+
:icons: font
|
7
|
+
:source-highlighter: highlightjs
|
8
|
+
:highlightjs-languages: x86asm
|
9
|
+
:revealjs_hash: yes
|
10
|
+
:revealjs_height: 1080
|
11
|
+
:revealjs_width: 1920
|
12
|
+
|
13
|
+
== Using Asciidoctor features
|
14
|
+
|
15
|
+
=== Bold markers and `subs="+quotes,+macros"` attribute
|
16
|
+
|
17
|
+
[source,java,subs="+quotes,+macros"]
|
18
|
+
----
|
19
|
+
protected void configure(HttpSecurity http) throws Exception {
|
20
|
+
http
|
21
|
+
.authorizeRequests()
|
22
|
+
**.antMatchers("/resources/$$**$$").permitAll()**
|
23
|
+
.anyRequest().authenticated()
|
24
|
+
.and()
|
25
|
+
.formLogin()
|
26
|
+
.loginPage("/login")
|
27
|
+
.permitAll();
|
28
|
+
----
|
29
|
+
|
30
|
+
=== Callouts
|
31
|
+
|
32
|
+
[source, rust]
|
33
|
+
----
|
34
|
+
fn main() {
|
35
|
+
println!("Hello World!"); // <1>
|
36
|
+
}
|
37
|
+
----
|
38
|
+
<1> `println!` is a macro.
|
39
|
+
|
40
|
+
|
41
|
+
== Using reveal.js <mark> tags
|
42
|
+
|
43
|
+
Needs `subs="none"` attribute
|
44
|
+
|
45
|
+
[source, rust, subs="none"]
|
46
|
+
----
|
47
|
+
fn main() {
|
48
|
+
<mark>println!</mark>("Hello marked World!");
|
49
|
+
}
|
50
|
+
----
|
51
|
+
|
52
|
+
== Using reveal.js data-line-numbers
|
53
|
+
|
54
|
+
// This example was taken from Reveal.js README
|
55
|
+
// https://github.com/hakimel/reveal.js/blob/master/README.md#line-numbers--highlights
|
56
|
+
|
57
|
+
Highlights are using Asciidoctor syntax not reveal.js.
|
58
|
+
Ex: `4..8,11` instead of `4-8,11`.
|
59
|
+
|
60
|
+
[source, javascript, highlight="4..8,11"]
|
61
|
+
----
|
62
|
+
import React, { useState } from 'react';
|
63
|
+
|
64
|
+
function Example() {
|
65
|
+
const [count, setCount] = useState(0);
|
66
|
+
|
67
|
+
return (
|
68
|
+
<div>
|
69
|
+
<p>You clicked {count} times</p>
|
70
|
+
<button onClick={() => setCount(count + 1)}>
|
71
|
+
Click me
|
72
|
+
</button>
|
73
|
+
</div>
|
74
|
+
);
|
75
|
+
}
|
76
|
+
----
|
77
|
+
|
78
|
+
== Step by Step with data-line-numbers
|
79
|
+
|
80
|
+
// Requires reveal.js 3.9.0+
|
81
|
+
Highlights are using Asciidoctor syntax not reveal.js.
|
82
|
+
Ex: `1|2..3|4,6..10` instead of `1|2-3|4,6-10`.
|
83
|
+
|
84
|
+
[source, javascript, highlight="1|2..3|4,6..10"]
|
85
|
+
----
|
86
|
+
import React, { useState } from 'react';
|
87
|
+
|
88
|
+
function Example() {
|
89
|
+
const [count, setCount] = useState(0);
|
90
|
+
|
91
|
+
return (
|
92
|
+
<div>
|
93
|
+
<p>You clicked {count} times</p>
|
94
|
+
<button onClick={() => setCount(count + 1)}>
|
95
|
+
Click me
|
96
|
+
</button>
|
97
|
+
</div>
|
98
|
+
);
|
99
|
+
}
|
100
|
+
----
|
101
|
+
|
102
|
+
[.columns]
|
103
|
+
== ASM from Compiler
|
104
|
+
|
105
|
+
[source.column,x86asm,highlight="3..6|7..9|10|11,12"]
|
106
|
+
----
|
107
|
+
main proc near
|
108
|
+
var_10 = dword ptr -10h
|
109
|
+
push ebp <1>
|
110
|
+
mov ebp, esp
|
111
|
+
and esp, 0FFFFFFF0h
|
112
|
+
sub esp, 10h
|
113
|
+
mov eax, offset aHelloWorld <2>
|
114
|
+
mov [esp+10h+var_10], eax
|
115
|
+
call _printf
|
116
|
+
mov eax, 0 <3>
|
117
|
+
leave <4>
|
118
|
+
retn
|
119
|
+
main endp
|
120
|
+
----
|
121
|
+
|
122
|
+
[.column]
|
123
|
+
--
|
124
|
+
<1> Function prologue
|
125
|
+
<2> Preparing arguments and calling `printf`
|
126
|
+
<3> Clean-up registers
|
127
|
+
<4> Function epilogue
|
128
|
+
--
|