asciidoctor-revealjs 3.1.0 → 4.1.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +328 -55
  3. data/Rakefile +30 -7
  4. data/asciidoctor-revealjs.gemspec +5 -3
  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/docinfo-footer-revealjs.html +10 -0
  10. data/examples/docinfo-revealjs.html +7 -0
  11. data/examples/font-awesome-specific-version.adoc +11 -0
  12. data/examples/font-awesome.adoc +18 -3
  13. data/examples/font-awesome.css +3 -0
  14. data/examples/footnotes.adoc +46 -0
  15. data/examples/fragments.adoc +44 -0
  16. data/examples/fragments.css +18 -0
  17. data/examples/grid-layout-3x2.adoc +50 -0
  18. data/examples/grid-layout-docinfo-revealjs.html +11 -0
  19. data/examples/grid-layout.adoc +194 -0
  20. data/examples/history-hash.adoc +19 -0
  21. data/examples/history-regression-tests.adoc +0 -5
  22. data/examples/history.adoc +4 -4
  23. data/examples/images/asciidoctor-logo.svg +102 -0
  24. data/examples/images/cute-cat-1.jpg +0 -0
  25. data/examples/images/cute-cat-2.jpg +0 -0
  26. data/examples/images/cute-cat-3.jpg +0 -0
  27. data/examples/images/flock-of-seagulls_daniel-simion.mp3 +0 -0
  28. data/examples/issue-grid-layout-images.adoc +25 -0
  29. data/examples/level-sectnums.adoc +24 -0
  30. data/examples/links-preview.adoc +32 -0
  31. data/examples/links.adoc +39 -0
  32. data/examples/mathjax-cdn.adoc +21 -0
  33. data/examples/mathjax.adoc +20 -0
  34. data/examples/release-4.0.adoc +192 -0
  35. data/examples/release-4.0.css +23 -0
  36. data/examples/release-4.1.adoc +133 -0
  37. data/examples/release-4.1.css +50 -0
  38. data/examples/revealjs-custom-theme.adoc +10 -0
  39. data/examples/source-coderay.adoc +15 -0
  40. data/examples/source-emphasis.adoc +128 -0
  41. data/examples/source-highlightjs-html.adoc +1 -1
  42. data/examples/source-highlightjs-languages.adoc +27 -0
  43. data/examples/source-highlightjs.adoc +85 -2
  44. data/examples/source-pygments.adoc +12 -0
  45. data/examples/source-rouge-docinfo.html +8 -0
  46. data/examples/source-rouge.adoc +18 -0
  47. data/examples/steps.adoc +87 -0
  48. data/examples/text-alignments.adoc +44 -0
  49. data/examples/video.adoc +30 -8
  50. data/examples/with-docinfo-shared.adoc +13 -0
  51. data/lib/asciidoctor-revealjs/converter.rb +1053 -770
  52. data/lib/asciidoctor-revealjs/highlightjs.rb +333 -2
  53. data/lib/asciidoctor-revealjs/version.rb +1 -1
  54. data/templates/admonition.html.slim +1 -1
  55. data/templates/asciidoctor-compatibility.css +390 -0
  56. data/templates/audio.html.slim +1 -1
  57. data/templates/colist.html.slim +1 -1
  58. data/templates/dlist.html.slim +3 -3
  59. data/templates/document.html.slim +76 -60
  60. data/templates/example.html.slim +1 -1
  61. data/templates/helpers.rb +170 -5
  62. data/templates/image.html.slim +3 -3
  63. data/templates/inline_anchor.html.slim +6 -4
  64. data/templates/inline_button.html.slim +2 -1
  65. data/templates/inline_footnote.html.slim +11 -4
  66. data/templates/inline_image.html.slim +5 -8
  67. data/templates/inline_kbd.html.slim +3 -2
  68. data/templates/inline_menu.html.slim +4 -3
  69. data/templates/inline_quoted.html.slim +13 -21
  70. data/templates/listing.html.slim +15 -10
  71. data/templates/literal.html.slim +1 -1
  72. data/templates/olist.html.slim +2 -2
  73. data/templates/open.html.slim +3 -3
  74. data/templates/paragraph.html.slim +1 -1
  75. data/templates/quote.html.slim +1 -1
  76. data/templates/section.html.slim +51 -43
  77. data/templates/sidebar.html.slim +1 -1
  78. data/templates/stem.html.slim +1 -1
  79. data/templates/stretch_nested_elements.js.slim +65 -0
  80. data/templates/table.html.slim +3 -2
  81. data/templates/title_slide.html.slim +28 -0
  82. data/templates/ulist.html.slim +3 -3
  83. data/templates/verse.html.slim +1 -1
  84. data/templates/video.html.slim +14 -8
  85. metadata +79 -16
  86. data/CHANGELOG.adoc +0 -456
  87. data/HACKING.adoc +0 -404
  88. data/examples/revealjs-features.adoc +0 -23
  89. data/templates/asciidoctor_revealjs.css.slim +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6ee61188a486fd610ff46c9364a470569462c8ee9b2efe321a9f036d15b3a4e
4
- data.tar.gz: adccc770637abffd5d78be47aa7f11f02fa7bbb2ac4facfa0222128529b70e14
3
+ metadata.gz: 956cea7e64ff8700318b5996c49b60ee2b1876acdbbd8f345313907ce2f5ae96
4
+ data.tar.gz: 4be32d8656c4cf7be74856a490c56c3a2b3b56281fc3d92eca44a732fb867d2f
5
5
  SHA512:
6
- metadata.gz: 0ac43abbce7bb8229f6951653d85e85adb9187758e3b58b3d29e5f410a2f3b22ef4898de07e7c1c6033a1f4dac0e534716efda3e82610aa20ea4b083124ee631
7
- data.tar.gz: ff848d465227488c034f3b1347977685dffd785427faac7abfcaf33aee1249092449d2e28e185914ac8837f9ca9a97cc30b98bb92bc61b422d601b349d22f66c
6
+ metadata.gz: 073f7db9e29acf415f188432c7fad7c709703cd26dbb883ae0f99985b9750144ba4bd415e39c2645a2f20f8766c59af99fea17886349e67ead118bb1b811566d
7
+ data.tar.gz: a3b4864f58b2b3e71779b14e702288d0f627104383fde2fb67577aad31fd29ebd7e8d413742792c94569ff9c2a3de66a3591723e8cc27e1ded768c00b7ad426e
@@ -18,10 +18,11 @@ endif::[]
18
18
  :uri-project-repo: https://github.com/asciidoctor/asciidoctor-reveal.js
19
19
  :uri-asciidoctor: https://github.com/asciidoctor/asciidoctor
20
20
  :uri-asciidoctorjs: https://github.com/asciidoctor/asciidoctor.js
21
- :uri-revealjs-home: http://lab.hakim.se/reveal-js/
22
- :uri-revealjs-gh: https://github.com/hakimel/reveal.js
21
+ :uri-revealjs-home: https://revealjs.com
22
+ :uri-revealjs-gh: https://github.com/hakimel/reveal.js/blob/v3.9
23
+ :uri-revealjs-doc: {uri-revealjs-gh}/README.md
23
24
  :uri-nodejs-download: https://nodejs.org/en/download/
24
- :showcasedir: showcase
25
+ :showcasedir: showcase
25
26
 
26
27
  ifdef::env-github[]
27
28
  image:https://travis-ci.org/asciidoctor/asciidoctor-reveal.js.svg?branch=master[Build Status,link=https://travis-ci.org/asciidoctor/asciidoctor-reveal.js]
@@ -34,34 +35,27 @@ endif::[]
34
35
 
35
36
  TIP: Want to see some example presentations, see <<Showcase Presentations>>
36
37
 
37
- There are three main technology stacks that can transform AsciiDoc into HTML5 / reveal.js:
38
+ There are four main technology stacks that can convert AsciiDoc into HTML5 / reveal.js:
38
39
 
39
40
  * Asciidoctor / Ruby / Bundler (See <<Ruby Setup>>)
40
41
  * Asciidoctor.js / JavaScript (Node.js) / npm (See <<Node / JavaScript Setup>>)
41
42
  * Standalone Executable (See <<Standalone Executable>>)
43
+ * AsciidoctorJ / JVM / Maven (See https://github.com/asciidoctor/asciidoctorj-reveal.js[this project])
42
44
 
43
45
  ifeval::['{branch}' == 'master']
44
46
  NOTE: You're viewing the documentation for an upcoming release.
45
47
  If you're looking for the documentation for the current release or an older one, please click on the appropriate link below: +
46
- {uri-project-repo}/tree/v2.0.1#readme[2.0.1] (latest release)
48
+ {uri-project-repo}/tree/v4.0.0#readme[4.0.1] (latest from 4.x series)
47
49
  &hybull;
48
- {uri-project-repo}/tree/v1.1.3#readme[1.1.3] (latest from 1.1 series)
50
+ {uri-project-repo}/tree/v3.1.0#readme[3.1.0] (latest from 3.x series)
49
51
  &hybull;
50
- {uri-project-repo}/tree/maint-1.0.x#readme[1.0.x]
51
- &hybull;
52
- {uri-project-repo}/tree/reveal.js-2.x#readme[Unversioned pre-release] (compatible with RevealJS 2.x)
52
+ {uri-project-repo}/tree/reveal.js-2.x#readme[Unversioned pre-release] (compatible with reveal.js 2.x)
53
53
  endif::[]
54
54
 
55
55
 
56
56
  == Ruby Setup
57
57
 
58
- NOTE: asciidoctor-reveal.js is now a Ruby Gem.
59
- To ensure repeatability, we recommend that you manage your presentation projects using bundler.
60
-
61
- For a quick start clone our https://github.com/obilodeau/presentation-revealjs-starter[starter repository] and follow instructions there.
62
-
63
- For more complete instructions, read on.
64
-
58
+ NOTE: To ensure repeatability, we recommend that you manage your presentation projects using http://bundler.io/[bundler].
65
59
 
66
60
  === Prerequisites
67
61
 
@@ -106,7 +100,7 @@ NOTE: For some reason, when you use the system Ruby on Fedora, you also have to
106
100
  . Optional: Copy or clone reveal.js presentation framework.
107
101
  Allows you to modify themes or view slides offline.
108
102
 
109
- $ git clone -b 3.7.0 --depth 1 https://github.com/hakimel/reveal.js.git
103
+ $ git clone -b 3.9.2 --depth 1 https://github.com/hakimel/reveal.js.git
110
104
 
111
105
 
112
106
  === Rendering the AsciiDoc into slides
@@ -117,7 +111,7 @@ NOTE: For some reason, when you use the system Ruby on Fedora, you also have to
117
111
  . Generate HTML presentation from the AsciiDoc source
118
112
 
119
113
  $ bundle exec asciidoctor-revealjs \
120
- -a revealjsdir=https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0 CONTENT_FILE.adoc
114
+ -a revealjsdir=https://cdn.jsdelivr.net/npm/reveal.js@3.9.2 CONTENT_FILE.adoc
121
115
 
122
116
  . If you did the optional step of having a local reveal.js clone you can
123
117
  convert AsciiDoc source with
@@ -126,6 +120,29 @@ NOTE: For some reason, when you use the system Ruby on Fedora, you also have to
126
120
 
127
121
  TIP: If you are using https://pages.github.com/[GitHub Pages], plan ahead by keeping your source files on `master` branch and all output files on the `gh-pages` branch.
128
122
 
123
+ === Features Unique to the Ruby CLI
124
+
125
+ Starting with 4.0.0 you can specify a set of custom templates to use instead of the ones provided by this project.
126
+ This can help you achieve even more concise AsciiDoc syntax and integration with reveal.js at the cost of more maintenance.
127
+
128
+ To use it, add the following dependencies to your `Gemfile`:
129
+
130
+ gem 'tilt', '~>2.0'
131
+ gem 'slim', '~>4.0'
132
+
133
+ Then install the dependencies with:
134
+
135
+ $ bundle install
136
+
137
+ The feature is activated with the `--template-dir` or `-T` option:
138
+
139
+ $ bundle exec asciidoctor-revealjs -T templates/ CONTENT_FILE.adoc
140
+
141
+ Any individual template file not provided in the directory specified on the command-line will fall back to the template provided by your version of Asciidoctor reveal.js.
142
+ Refer to our https://github.com/asciidoctor/asciidoctor-reveal.js/tree/master/templates[templates] for inspiration.
143
+
144
+ This feature hasn't been ported to the JavaScript CLI (and API) or the standalone executables.
145
+
129
146
 
130
147
  == Node / JavaScript Setup
131
148
 
@@ -229,7 +246,7 @@ The executables are built using the <<Node / JavaScript Setup,Node / JavaScript>
229
246
  * Copy or clone the reveal.js presentation framework in the directory where you will build your slidedeck.
230
247
  Here we do a shallow clone of the repo:
231
248
 
232
- $ git clone -b 3.7.0 --depth 1 https://github.com/hakimel/reveal.js.git
249
+ $ git clone -b 3.9.2 --depth 1 https://github.com/hakimel/reveal.js.git
233
250
 
234
251
  === Convert AsciiDoc into slides
235
252
 
@@ -298,7 +315,7 @@ A Great Story
298
315
  --
299
316
  ----
300
317
 
301
- In previous snippet we are creating a slide titled Slide One with bullets and another one titled Slide Two with centered text (reveal.js`' default behavior) with {uri-revealjs-gh}#speaker-notes[speaker notes].
318
+ In previous snippet we are creating a slide titled Slide One with bullets and another one titled Slide Two with centered text (reveal.js`' default behavior) with {uri-revealjs-doc}#speaker-notes[speaker notes].
302
319
  Other syntax exists to create speaker notes, see `examples/speaker-notes.adoc`.
303
320
 
304
321
  Starting with Reveal.js 3.5 speaker notes supports configurable layouts:
@@ -385,7 +402,7 @@ NOTE: The `canvas` keyword can be used instead of `background` for the same effe
385
402
  Is very yellow
386
403
  ----
387
404
 
388
- Slide Three applies the attribute {uri-revealjs-gh}#slide-backgrounds[data-background-color] to the `reveal.js` <section> tag.
405
+ Slide Three applies the attribute {uri-revealjs-doc}#slide-backgrounds[data-background-color] to the `reveal.js` <section> tag.
389
406
  Anything accepted by CSS color formats works.
390
407
 
391
408
 
@@ -402,7 +419,7 @@ image::cover.jpg[background, size=cover]
402
419
  This will put `cover.jpg` as the slide's background image.
403
420
  It sets reveal.js`' `data-background-image` attribute.
404
421
  The `size` attribute is also supported.
405
- See the {uri-revealjs-gh}#image-backgrounds[relevant reveal.js documentation] for details.
422
+ See the {uri-revealjs-doc}#image-backgrounds[relevant reveal.js documentation] for details.
406
423
 
407
424
  NOTE: Background images file names are now relative to the `:imagesdir:` attribute if set.
408
425
 
@@ -440,7 +457,7 @@ For example:
440
457
  == Nice background!
441
458
  ----
442
459
 
443
- See {uri-revealjs-gh}#video-backgrounds[the relevant reveal.js documentation] for details.
460
+ See {uri-revealjs-doc}#video-backgrounds[the relevant reveal.js documentation] for details.
444
461
  Note that the `data-` prefix is not required in asciidoc files.
445
462
 
446
463
 
@@ -454,7 +471,7 @@ The background can be replaced with anything a browser can render in an iframe u
454
471
  == a youtube video
455
472
  ----
456
473
 
457
- See {uri-revealjs-gh}#iframe-backgrounds[the relevant reveal.js documentation] for details.
474
+ See {uri-revealjs-doc}#iframe-backgrounds[the relevant reveal.js documentation] for details.
458
475
 
459
476
 
460
477
  === Slide Transitions
@@ -472,7 +489,7 @@ This slide will override the presentation transition and zoom!
472
489
  Choose from three transition speeds: default, fast or slow!
473
490
  ----
474
491
 
475
- See {uri-revealjs-gh}#slide-transitions[the relevant reveal.js documentation] for details.
492
+ See {uri-revealjs-doc}#slide-transitions[the relevant reveal.js documentation] for details.
476
493
 
477
494
 
478
495
  === Fragments
@@ -489,9 +506,9 @@ See {uri-revealjs-gh}#slide-transitions[the relevant reveal.js documentation] fo
489
506
  ----
490
507
 
491
508
  Slide Four has bullets that are revealed one after the other.
492
- This is what `reveal.js` calls http://lab.hakim.se/reveal-js/#/fragments[fragments].
509
+ This is what `reveal.js` calls {uri-revealjs-home}/fragments[fragments].
493
510
  Applying the step option or role on a list (`[%step]` or `[.step]`) will do the trick.
494
- Here is {uri-revealjs-gh}#fragments[the relevant reveal.js
511
+ Here is {uri-revealjs-doc}#fragments[the relevant reveal.js
495
512
  documentation] on the topic.
496
513
  Note that only `fade-in` is supported for lists at the moment.
497
514
 
@@ -507,7 +524,7 @@ To apply that class to block simply use asciidoctor's class assignment:
507
524
 
508
525
  [.stretch]
509
526
 
510
- See {uri-revealjs-gh}#stretching-elements[reveal.js documentation on stretching elements].
527
+ See {uri-revealjs-doc}#stretching-elements[reveal.js documentation on stretching elements].
511
528
 
512
529
 
513
530
  === Videos
@@ -528,9 +545,9 @@ To override that behavior use the `width` and `height` named attributes.
528
545
 
529
546
  === Syntax highlighting
530
547
 
531
- Reveal.js is well integrated with https://highlightjs.org/[highlight.js] for syntax highlighting.
532
- Asciidoctor-reveal.js supports that.
533
- You can activate highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows:
548
+ reveal.js is well integrated with https://highlightjs.org/[Highlight.js] for syntax highlighting.
549
+ Asciidoctor reveal.js supports that.
550
+ You can activate Highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows:
534
551
 
535
552
  [source, asciidoc]
536
553
  ----
@@ -539,7 +556,26 @@ You can activate highlight.js syntax highlighting (disabled by default) by setti
539
556
  :source-highlighter: highlightjs
540
557
  ----
541
558
 
542
- Once enabled you can write code blocks as usual:
559
+ [NOTE]
560
+ ====
561
+ By default, we are using a prebuilt version of Highlight.js with 34 commonly used languages hosted on https://cdnjs.com/[cdnjs].
562
+ You can load additionnal languages using the `:highlightjs-languages:` attribute:
563
+
564
+ ```
565
+ // load yaml and scilab languages
566
+ :highlightjs-languages: yaml, scilab
567
+ ```
568
+
569
+ You can also load Highlight.js from a custom base directory (or remote URL) using the `:highlightjsdir:` attribute:
570
+
571
+ ```
572
+ // load from a local path
573
+ :highlightjsdir: highlight
574
+ // load from jsdelivr CDN
575
+ //:highlightjsdir: https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build
576
+ ====
577
+
578
+ Once enabled, you can write code blocks as usual:
543
579
 
544
580
  [source, asciidoc]
545
581
  ....
@@ -569,7 +605,8 @@ print "$0: hello world\n"
569
605
  ....
570
606
 
571
607
  [NOTE]
572
- Alternatively, you can use http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as syntax highlighters if you are using the Asciidoctor/Ruby/Bundler toolchain (not Asciidoctor.js/JavaScript/npm).
608
+ Alternatively, you can use http://rouge.jneen.net/[Rouge], http://coderay.rubychan.de[Coderay] or http://pygments.org[Pygments] as syntax highlighters,
609
+ if you are using the Asciidoctor/Ruby/Bundler toolchain (not Asciidoctor.js/JavaScript/npm).
573
610
  Check the `examples/` directory for examples and notes about what needs to be done for them to work.
574
611
  They are considered unsupported by the asciidoctor-reveal.js project.
575
612
 
@@ -589,11 +626,135 @@ This is a vertical subslide
589
626
 
590
627
  Slide Six uses the vertical slide feature of `reveal.js`.
591
628
  Slide Six.One will be rendered vertically below Slide Six.
592
- Here is {uri-revealjs-gh}#markup[the relevant reveal.js
629
+ Here is {uri-revealjs-doc}#markup[the relevant reveal.js
593
630
  documentation] on that topic.
594
631
 
632
+ === Columns layout
633
+
634
+ Inspired by https://bulma.io/[Bulma], Asciidoctor reveal.js supports columns layout out-of-the-box:
635
+
636
+ [source, asciidoc]
637
+ ....
638
+ [.columns]
639
+ == 2 columns
640
+
641
+ [.column]
642
+ --
643
+ * **Edgar Allen Poe**
644
+ * Sheri S. Tepper
645
+ * Bill Bryson
646
+ --
647
+
648
+ [.column]
649
+ --
650
+ Edgar Allan Poe (/poʊ/; born Edgar Poe; January 19, 1809 – October 7, 1849) was an American writer, editor, and literary critic.
651
+ --
652
+ ....
653
+
654
+ If you do not specify a size, each column will have an equal width, no matter the number of columns.
655
+
656
+ [source, asciidoc]
657
+ ....
658
+ [.columns]
659
+ == 3 columns
660
+
661
+ [.column]
662
+ * Java
663
+ * **Kotlin**
664
+
665
+ [.column]
666
+ * Node
667
+ * **Deno**
668
+
669
+ [.column]
670
+ * Ruby
671
+ * **Crystal**
672
+ ....
673
+
674
+ If you want to change the size of a single column, you can use one of the following classes:
675
+
676
+ * `is-three-quarters`
677
+ * `is-two-thirds`
678
+ * `is-half`
679
+ * `is-one-third`
680
+ * `is-one-quarter`
681
+ * `is-full`
682
+
683
+ The other columns will fill up the remaining space automatically. +
684
+ You can use the following multiples of 20% as well:
685
+
686
+ * `is-four-fifths`
687
+ * `is-three-fifths`
688
+ * `is-two-fifths`
689
+ * `is-one-fifth`
690
+
691
+ [source, asciidoc]
692
+ ....
693
+ [.columns]
694
+ == Columns with size
695
+
696
+ [.column.is-one-third]
697
+ --
698
+ * **Kotlin**
699
+ * Java
700
+ * Scala
701
+ --
702
+
703
+ [.column]
704
+ --
705
+ Programming language for Android, mobile cross-platform
706
+ and web development, server-side, native,
707
+ and data science. Open source forever Github.
708
+ --
709
+ ....
710
+
711
+ The vertical alignment of columns defaults to top aligned.
712
+ Content can be centered by adding the `is-vcentered` class to the slide.
713
+
714
+ [source, asciidoc]
715
+ ....
716
+ [.columns.is-vcentered]
717
+ == Columns Vertically Centered
718
+
719
+ [.column]
720
+ --
721
+ * Few
722
+ * Bullets
723
+ * Here
724
+ --
725
+
726
+ [.column]
727
+ image::large-image.png[]
728
+ ....
729
+
730
+ Text alignment of columns is also supported.
731
+ Text content on individual columns can be aligned with `has-text-left`, `has-text-right` and `has-text-justified` CSS classes.
732
+
733
+ [source, asciidoc]
734
+ ....
735
+ [.columns]
736
+ == Column Text Alignment
737
+
738
+ [.column.has-text-left]
739
+ --
740
+ Something Short
741
+
742
+ Something So Long That We Need It Aligned
743
+ --
595
744
 
596
- === Asciidoctor-reveal.js specific roles
745
+ [.column.has-text-justified]
746
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
747
+
748
+ [.column.has-text-right]
749
+ --
750
+ Something Short
751
+
752
+ Something So Long That We Need It Aligned
753
+ --
754
+ ....
755
+
756
+
757
+ === Asciidoctor reveal.js specific roles
597
758
 
598
759
  Roles are usually applied with the following syntax where the `important-text` CSS class would be applied to the slide title in the generated HTML:
599
760
 
@@ -628,6 +789,17 @@ Here is a list of supported roles:
628
789
  right:: Will apply a `float: right` style to the affected block
629
790
 
630
791
 
792
+ === Asciidoctor reveal.js specific attributes
793
+
794
+ ==== iFrame Preview Overlay
795
+
796
+ The reveal.js feature activated by a global `previewLinks: true` configuration or by adding the `data-preview-link` HTML attribute to `<a>` tags can be activated by using special AsciiDoc attributes.
797
+
798
+ On links use the `preview=true` attribute, on images use the `link_preview=true` attribute and globally you can set `:revealjs_previewlinks:` attribute.
799
+
800
+ See <<examples/links.adoc#,links.adoc>> and <<examples/links-preview.adoc#,links-preview.adoc>> for examples.
801
+
802
+
631
803
  === Title slide customization
632
804
 
633
805
  The title slide is customized via Asciidoc attributes.
@@ -637,7 +809,7 @@ title that look like this: `:name: value`.
637
809
  This converter supports changing the color, image, video, iframe and
638
810
  transitions of the title slide.
639
811
 
640
- Read {uri-revealjs-gh}#slide-backgrounds[the relevant reveal.js documentation] to understand what attributes need to be set.
812
+ Read {uri-revealjs-doc}#slide-backgrounds[the relevant reveal.js documentation] to understand what attributes need to be set.
641
813
  Keep in mind that for title slides you must replace `data-` with `title-slide-`.
642
814
 
643
815
  ifeval::[{safe-mode-level} >= 20]
@@ -720,7 +892,7 @@ If the `:customcss:` attribute value is empty then `asciidoctor-revealjs.css` is
720
892
 
721
893
  === Slide state
722
894
 
723
- Reveal.js supports a {uri-revealjs-gh}#slide-states[data-state] tag that can be added on slides which gets rendered into `<section>` tags.
895
+ Reveal.js supports a {uri-revealjs-doc}#slide-states[data-state] tag that can be added on slides which gets rendered into `<section>` tags.
724
896
  In AsciiDoc the `data-state` can be applied to a slide by adding a state attribute to a section like this:
725
897
 
726
898
  [source, asciidoc]
@@ -763,6 +935,41 @@ WARNING: This presentation is dangerous!
763
935
 
764
936
  Here are details about Asciidoctor's http://asciidoctor.org/docs/user-manual/#admonition-icons[Admonition icons] support.
765
937
 
938
+ === Supplemental Content with Docinfo
939
+ // Originally from https://github.com/asciidoctor/asciidoctor-bespoke#supplemental-content
940
+
941
+ It's possible to inject supplemental content into the output document using http://asciidoctor.org/docs/user-manual/#docinfo-file[docinfo files].
942
+ This core feature of AsciiDoc has been adapted to work with the reveal.js converter.
943
+
944
+ Currently, there are three insertion locations for docinfo content in a reveal.js document:
945
+
946
+ head:: content is inserted after the last child of the `<head>` element
947
+ header:: content is inserted before the first child of the `<div class="slides">` element (before the slides)
948
+ footer:: content is inserted after the last child of the `<div class="slides">` element (after the slides)
949
+
950
+ The content you want to insert goes into a sibling file of the slide deck document with the following filename patterns:
951
+
952
+ head:: `docinfo-revealjs.html`
953
+ header:: `docinfo-header-revealjs.html`
954
+ footer:: `docinfo-footer-revealjs.html`
955
+
956
+ For example, let's say you want to embed a tweet into your slide deck.
957
+ You might inject the shared embedding JavaScript using a footer docinfo file:
958
+
959
+ .src/docinfo-footer-revealjs.html
960
+ [source,html]
961
+ ----
962
+ <script src="https://platform.twitter.com/widgets.js"></script>
963
+ ----
964
+
965
+ You then need to set the following document attribute in the AsciiDoc header:
966
+
967
+ ----
968
+ :docinfo: shared
969
+ ----
970
+
971
+ When this attribute is defined, the converter will automatically read the docinfo file(s) and insert the contents into the specified location in the output document.
972
+
766
973
 
767
974
  == Reveal.js Options
768
975
 
@@ -778,7 +985,7 @@ NOTE: Default settings are based on `reveal.js` default settings.
778
985
 
779
986
  |:revealjs_theme:
780
987
  |beige, *black*, league, night, serif, simple, sky, solarized, white
781
- |Chooses one of reveal.js`' {uri-revealjs-gh}#theming[built-in themes].
988
+ |Chooses one of reveal.js`' {uri-revealjs-doc}#theming[built-in themes].
782
989
 
783
990
  |:revealjs_customtheme:
784
991
  |<file\|URL>
@@ -794,7 +1001,7 @@ Default is built-in [path]_lib/css/zenburn.css_.
794
1001
  |<file\|URL>
795
1002
  |Overrides reveal.js directory.
796
1003
  Example: ../reveal.js or
797
- https://cdnjs.com/libraries/reveal.js/3.7.0[https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0].
1004
+ https://cdn.jsdelivr.net/npm/reveal.js@3.9.2.
798
1005
  Default is `reveal.js/` unless in a Node.js environment where it is `node_modules/reveal.js/`.
799
1006
 
800
1007
  |:revealjs_controls:
@@ -836,9 +1043,13 @@ all:: show on all views (default)
836
1043
  speaker:: only show slide numbers on speaker notes view
837
1044
  print:: only show slide numbers when printing to PDF
838
1045
 
1046
+ |:revealjs_hash:
1047
+ |true, *false*
1048
+ |Add the current slide number to the URL hash so that reloading the page/copying the URL will return you to the same slide
1049
+
839
1050
  |:revealjs_history:
840
1051
  |true, *false*
841
- |Push each slide change to the browser history.
1052
+ |Push each slide change to the browser history. Implies `hash: true`
842
1053
 
843
1054
  |:revealjs_keyboard:
844
1055
  |*true*, false
@@ -864,6 +1075,14 @@ print:: only show slide numbers when printing to PDF
864
1075
  |true, *false*
865
1076
  |Change the presentation direction to be RTL.
866
1077
 
1078
+ |:revealjs_navigationMode:
1079
+ |*default*, linear, grid
1080
+ |See {uri-revealjs-doc}#navigation-mode for details
1081
+
1082
+ |:revealjs_shuffle:
1083
+ |true, *false*
1084
+ |Randomizes the order of slides each time the presentation loads
1085
+
867
1086
  |:revealjs_fragments:
868
1087
  |*true*, false
869
1088
  |Turns fragments on and off globally.
@@ -892,6 +1111,14 @@ null:: Media will only autoplay if data-autoplay is present
892
1111
  true:: All media will autoplay, regardless of individual setting
893
1112
  false:: No media will autoplay, regardless of individual setting
894
1113
 
1114
+ |:revealjs_preloadIframes:
1115
+ |*null*, true, false
1116
+ a|Global override for preloading lazy-loaded iframes
1117
+
1118
+ null:: Iframes with `data-src` AND `data-preload` will be loaded when within the `viewDistance`, iframes with only `data-src` will be loaded when visible
1119
+ true:: All iframes with `data-src` will be loaded when within the `viewDistance`
1120
+ false:: All iframes with `data-src` will be loaded only when visible
1121
+
895
1122
  |:revealjs_autoSlide:
896
1123
  |<integer>
897
1124
  |Delay in milliseconds between automatically proceeding to the next slide.
@@ -912,10 +1139,31 @@ This value can be overwritten by using a `data-autoslide` attribute on your slid
912
1139
  This is used to show a pacing timer in the speaker view.
913
1140
  Defaults to *120*
914
1141
 
1142
+ |:revealjs_totalTime:
1143
+ |<integer>
1144
+ |Specify the total time in seconds that is available to present.
1145
+ If this is set to a nonzero value, the pacing timer will work out the time available for each slide, instead of using the defaultTiming value.
1146
+ Defaults to *0*
1147
+
1148
+ |:revealjs_minimumTimePerSlide:
1149
+ |<integer>
1150
+ |Specify the minimum amount of time you want to allot to each slide, if using the totalTime calculation method.
1151
+ If the automated time allocation causes slide pacing to fall below this threshold, then you will see an alert in the speaker notes window.
1152
+ Defaults to *0*.
1153
+
915
1154
  |:revealjs_mouseWheel:
916
1155
  |true, *false*
917
1156
  |Enable slide navigation via mouse wheel.
918
1157
 
1158
+ |:revealjs_hideInactiveCursor:
1159
+ |*true*, false
1160
+ |Hide cursor if inactive
1161
+
1162
+ |:revealjs_hideCursorTime:
1163
+ |<integer>
1164
+ |Time before the cursor is hidden (in ms).
1165
+ Defaults to *5000*.
1166
+
919
1167
  |:revealjs_hideAddressBar:
920
1168
  |*true*, false
921
1169
  |Hides the address bar on mobile devices.
@@ -923,7 +1171,7 @@ Defaults to *120*
923
1171
  |:revealjs_previewLinks:
924
1172
  |true, *false*
925
1173
  |Opens links in an iframe preview overlay.
926
- Add `data-preview-link` and `data-preview-link="false"` to customise each link individually
1174
+ Add the `preview=true` attribute on links or `link_preview=true` attribute on images to customize each link individually.
927
1175
 
928
1176
  |:revealjs_transition:
929
1177
  |none, fade, *slide*, convex, concave, zoom
@@ -939,7 +1187,14 @@ Add `data-preview-link` and `data-preview-link="false"` to customise each link i
939
1187
 
940
1188
  |:revealjs_viewDistance:
941
1189
  |<integer>
942
- |Number of slides away from the current that are visible. Default: 3
1190
+ |Number of slides away from the current that are visible.
1191
+ Default: *3*.
1192
+
1193
+ |:revealjs_mobileViewDistance:
1194
+ |<integer>
1195
+ |Number of slides away from the current that are visible on mobile devices.
1196
+ It is advisable to set this to a lower number than viewDistance in order to save resources.
1197
+ Default *3*.
943
1198
 
944
1199
  |:revealjs_parallaxBackgroundImage:
945
1200
  |<file\|URL>
@@ -997,10 +1252,17 @@ Defaults to *1*
997
1252
 
998
1253
  If you want to build a custom theme or customize an existing one you should
999
1254
  look at the
1000
- {uri-revealjs-gh}/blob/master/css/theme/README.md[reveal.js
1255
+ {uri-revealjs-gh}/css/theme/README.md[reveal.js
1001
1256
  theme documentation] and use the `revealjs_customtheme` AsciiDoc attribute to
1002
1257
  activate it.
1003
1258
 
1259
+
1260
+ === PDF Export
1261
+
1262
+ Follow {uri-revealjs-doc}#pdf-export[reveal.js' documentation] for PDF export.
1263
+ We would add that we have successfully used PDF export without the requirement of a Web server.
1264
+
1265
+
1004
1266
  === Default plugins
1005
1267
 
1006
1268
  By default, generated presentations will have the following reveal.js plugins enabled:
@@ -1019,17 +1281,6 @@ For example, to disable all the default plugins set the following document attri
1019
1281
  :revealjs_plugin_notes: disabled
1020
1282
  ----
1021
1283
 
1022
- reveal.js ships with a plugin that allows to create a PDF from a slide deck.
1023
- To enable this plugin, set the `revealjs_plugin_pdf` attribute.
1024
-
1025
- ----
1026
- :revealjs_plugin_pdf: enabled
1027
- ----
1028
-
1029
- When the plugin is enabled and you run your presentation in a browser with `?print-pdf` at the end of the URL, you can then use the default print function to print the slide deck into a PDF document.
1030
-
1031
- TIP: To work properly, this plugin requires a Chrome-based browser.
1032
-
1033
1284
 
1034
1285
  === Additional plugins
1035
1286
 
@@ -1042,7 +1293,7 @@ Additional reveal.js plugins can be installed and activated using AsciiDoc attri
1042
1293
 
1043
1294
  Looking at the example provided in the repository will provide guidance: link:examples/revealjs-plugins.adoc[AsciiDoc source], link:examples/revealjs-plugins.js[Plugin Loader], link:examples/revealjs-plugins-conf.js[Plugin Configuration].
1044
1295
 
1045
- Read {uri-revealjs-gh}#dependencies[the relevant reveal.js documentation] to understand more about reveal.js plugins.
1296
+ Read {uri-revealjs-doc}#dependencies[the relevant reveal.js documentation] to understand more about reveal.js plugins.
1046
1297
  A {uri-revealjs-gh}/wiki/Plugins,-Tools-and-Hardware[list of existing reveal.js plugins] is also maintained upstream.
1047
1298
 
1048
1299
 
@@ -1059,6 +1310,28 @@ If you need more details about our dependencies check out Asciidoctor dependenci
1059
1310
  * With Ruby / Bundler: https://github.com/asciidoctor/asciidoctor/tree/v2.0.10#requirements[Asciidoctor] 2.0.10
1060
1311
  * With JavaScript (Node.js) / NPM: https://github.com/asciidoctor/asciidoctor.js/blob/v2.0.3/packages/core/package.json[Asciidoctor.js] 2.0.3
1061
1312
 
1313
+
1314
+ [[revealjs-compatibility-matrix]]
1315
+ == reveal.js Compatibility Matrix
1316
+
1317
+ We try as much as possible to be compatible with a broad range of reveal.js versions.
1318
+ However, changes made by that project sometimes forces us to drop compatibility with older reveal.js releases.
1319
+ This table tracks this compatibility.
1320
+
1321
+ |===
1322
+ |Asciidoctor reveal.js version |reveal.js version
1323
+
1324
+ |4.x
1325
+ |3.9 - 3.8
1326
+
1327
+ |3.x, 2.x, 1.x
1328
+ |3.7 - 3.0
1329
+
1330
+ |Unversioned releases
1331
+ |2.x
1332
+ |===
1333
+
1334
+
1062
1335
  [[asciidoctorjs-compatibility-matrix]]
1063
1336
  == Asciidoctor.js Compatibility Matrix
1064
1337