Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reveal.js 3.8.0 to 3.9.2 support #301

Merged
merged 31 commits into from
Feb 8, 2020
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ea7a07a
Added new Reveal.js 3.8 options
obilodeau Dec 31, 2019
23e671d
New syntax-highlight example with reveal.js features
obilodeau Dec 31, 2019
ab9ffe4
Placeholder CHANGELOG update
obilodeau Dec 31, 2019
9669993
getting rid of head.js like upstream but there's more to do
obilodeau Dec 31, 2019
1c46401
Removed invalid comment since upstream fixed it
obilodeau Jan 29, 2020
3a0636f
Highlightjs changes for reveal.js 3.8.0
obilodeau Jan 29, 2020
9021dd5
Project name fixed
obilodeau Jan 29, 2020
e3538da
Aligned document template with latest reveal.js index.html
obilodeau Jan 29, 2020
407b531
Marked source example works with subs="none"
obilodeau Jan 30, 2020
7695ce3
Added all features from Asciidoctor syntax highlight manual to examples
obilodeau Jan 30, 2020
041f330
Initial support for reveal.js Line Numbers & Highlights feature
obilodeau Jan 30, 2020
ab6cd2d
Update examples/source-rouge.adoc
obilodeau Feb 3, 2020
9e0b011
Highlight.js highlighted lines CSS fix
obilodeau Feb 3, 2020
90d020b
Example source-rouge.adoc: updated what's broken
obilodeau Feb 3, 2020
dac7214
Added reveal.js 3.9.0 new configuration options
obilodeau Feb 4, 2020
fb3fb2a
Support for the previewLinks and data-preview-link reveal.js feature
obilodeau Feb 4, 2020
e15943a
Added upgrade notes to CHANGELOG and compatibility matrix to README
obilodeau Feb 4, 2020
864715a
minor changes
obilodeau Feb 4, 2020
28b25b4
doc: new options documented in README
obilodeau Feb 4, 2020
77beec7
Updated CHANGELOG
obilodeau Feb 4, 2020
b7882c0
Updated doctest
obilodeau Feb 4, 2020
e80e6a5
doctest update: the missing one
obilodeau Feb 4, 2020
25f2b76
tweaked .gitignore: dist/
obilodeau Feb 5, 2020
9533313
New examples for hash config with doctest
obilodeau Feb 5, 2020
44d6ef0
Support for Asciidoctor linenums in highlight.js
obilodeau Feb 5, 2020
472d4e2
Added a fragments example with fancy CSS changes in steps
obilodeau Feb 5, 2020
843bc4f
Updated CHANGELOG
obilodeau Feb 5, 2020
6e451c2
New example: various means to do source code emphasis
obilodeau Feb 5, 2020
529fec2
Fixed indentation problem in CHANGELOG
obilodeau Feb 5, 2020
e5b8b64
doctest trailing whitespace removal
obilodeau Feb 6, 2020
a839f53
Line highlights: use core resolve_lines_to_highlight instead of a sub…
obilodeau Feb 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
node_modules/
npm-debug.log
build/
/dist/main.js
/dist/
/asciidoctor-reveal.js-*.tgz

# ruby stuff
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
== <master> (<unreleased)

Upgrade considerations::
* Due to an upstream change in reveal.js 3.8.0, this back-end no longer supports earlier reveal.js versions.
We added a compatibility matrix with reveal.js at the end of the README.
See {uri-issue}301[#301] for details.
* Using the attribute `background-opacity` to alter the opacity of the title slide no longer works.
When the opacity feature was introduced we forgot to align with the other title slide attributes.
The feature was introduced in 3.0.0 and the bug stayed in 3.1.0.
Expand All @@ -19,12 +22,18 @@ Upgrade considerations::
We were previously injecting `docinfo-header.html` somewhere in the HTML `<head>`.
Now, `docinfo-revealjs.html` goes last into the HTML `<head>`, `docinfo-header-revealjs.html` goes right before the first slide `<section>` and `docinfo-footer-revealjs.html` goes right after the last slide `<section>`.
The new documentation is available https://github.com/asciidoctor/asciidoctor-reveal.js#supplemental-content-with-docinfo[here] and the related tickets are {uri-issue}198[#198] and {uri-issue}324[#324].
* Default highlight.js theme is monokai. This follows a reveal.js change.

Enhancements::
* Built-in slim templates can now be overridden with `--template-dir` or `-T` ({uri-issue}177[#177], {uri-issue}318[#318])
* Documentation improvements ({uri-issue}322[#322])

Compliance::
* New reveal.js 3.8.0 and 3.9.0 features supported
** Line numbers on source code blocks using Asciidoctor's `linenums` attribute
** Specific lines and step-by-step code highlights using Asciidoctor's `highlight` attribute
** reveal.js `data-preview` on links and images with link can be activated by using the `preview` and `link_preview` Asciidoctor attributes respectively
** New configuration options: `hash`, `navigationMode`, `shuffle`, `preloadIframes`, `totalTime`, `minimumTimePerSlide`, `hideInactiveCursor`, `hideCursorTime`, `previewLinks` (`data-preview-link`) and `mobileViewDistance` ({uri-issue}301[#301])
* Added support for the `sectnums` AsciiDoc attribute ({uri-issue}185[#185], {uri-issue}317[#317])
* Aligned our `docinfo` support to Asciidoctor Bespoke ({uri-issue}198[#198], {uri-issue}324[#324])
* `background-opacity` title slide attribute renamed to `title-slide-background-opacity` ({uri-issue}323[#323], {uri-issue}325[#325])
Expand Down
91 changes: 86 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ To override that behavior use the `width` and `height` named attributes.
=== Syntax highlighting

Reveal.js is well integrated with https://highlightjs.org/[highlight.js] for syntax highlighting.
Asciidoctor-reveal.js supports that.
Asciidoctor reveal.js supports that.
You can activate highlight.js syntax highlighting (disabled by default) by setting the `source-highlighter` document attribute as follows:

[source, asciidoc]
Expand Down Expand Up @@ -595,7 +595,7 @@ Here is {uri-revealjs-gh}#markup[the relevant reveal.js
documentation] on that topic.


=== Asciidoctor-reveal.js specific roles
=== Asciidoctor reveal.js specific roles

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:

Expand Down Expand Up @@ -630,6 +630,17 @@ Here is a list of supported roles:
right:: Will apply a `float: right` style to the affected block


=== Asciidoctor reveal.js specific attributes

==== iFrame Preview Overlay

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.

On links use the `preview=true` attribute, on images use the `link_preview=true` attribute and globally you can set `:revealjs_previewlinks:` attribute.

See <<examples/links.adoc#,links.adoc>> and <<examples/links-preview.adoc#,links-preview.adoc>> for examples.


=== Title slide customization

The title slide is customized via Asciidoc attributes.
Expand Down Expand Up @@ -873,9 +884,13 @@ all:: show on all views (default)
speaker:: only show slide numbers on speaker notes view
print:: only show slide numbers when printing to PDF

|:revealjs_hash:
|true, *false*
|Add the current slide number to the URL hash so that reloading the page/copying the URL will return you to the same slide

|:revealjs_history:
|true, *false*
|Push each slide change to the browser history.
|Push each slide change to the browser history. Implies `hash: true`

|:revealjs_keyboard:
|*true*, false
Expand All @@ -901,6 +916,14 @@ print:: only show slide numbers when printing to PDF
|true, *false*
|Change the presentation direction to be RTL.

|:revealjs_navigationMode:
|*default*, linear, grid
|See https://github.com/hakimel/reveal.js/#navigation-mode for details

|:revealjs_shuffle:
|true, *false*
|Randomizes the order of slides each time the presentation loads

|:revealjs_fragments:
|*true*, false
|Turns fragments on and off globally.
Expand Down Expand Up @@ -929,6 +952,14 @@ null:: Media will only autoplay if data-autoplay is present
true:: All media will autoplay, regardless of individual setting
false:: No media will autoplay, regardless of individual setting

|:revealjs_preloadIframes:
|*null*, true, false
a|Global override for preloading lazy-loaded iframes

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
true:: All iframes with `data-src` will be loaded when within the `viewDistance`
false:: All iframes with `data-src` will be loaded only when visible

|:revealjs_autoSlide:
|<integer>
|Delay in milliseconds between automatically proceeding to the next slide.
Expand All @@ -949,18 +980,39 @@ This value can be overwritten by using a `data-autoslide` attribute on your slid
This is used to show a pacing timer in the speaker view.
Defaults to *120*

|:revealjs_totalTime:
|<integer>
|Specify the total time in seconds that is available to present.
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.
Defaults to *0*

|:revealjs_minimumTimePerSlide:
|<integer>
|Specify the minimum amount of time you want to allot to each slide, if using the totalTime calculation method.
If the automated time allocation causes slide pacing to fall below this threshold, then you will see an alert in the speaker notes window.
Defaults to *0*.

|:revealjs_mouseWheel:
|true, *false*
|Enable slide navigation via mouse wheel.

|:revealjs_hideInactiveCursor:
|*true*, false
|Hide cursor if inactive

|:revealjs_hideCursorTime:
|<integer>
|Time before the cursor is hidden (in ms).
Defaults to *5000*.

|:revealjs_hideAddressBar:
|*true*, false
|Hides the address bar on mobile devices.

|:revealjs_previewLinks:
|true, *false*
|Opens links in an iframe preview overlay.
Add `data-preview-link` and `data-preview-link="false"` to customise each link individually
Add the `preview=true` attribute on links or `link_preview=true` attribute on images to customize each link individually.

|:revealjs_transition:
|none, fade, *slide*, convex, concave, zoom
Expand All @@ -976,7 +1028,14 @@ Add `data-preview-link` and `data-preview-link="false"` to customise each link i

|:revealjs_viewDistance:
|<integer>
|Number of slides away from the current that are visible. Default: 3
|Number of slides away from the current that are visible.
Default: *3*.

|:revealjs_mobileViewDistance:
|<integer>
|Number of slides away from the current that are visible on mobile devices.
It is advisable to set this to a lower number than viewDistance in order to save resources.
Default *3*.

|:revealjs_parallaxBackgroundImage:
|<file\|URL>
Expand Down Expand Up @@ -1096,6 +1155,28 @@ If you need more details about our dependencies check out Asciidoctor dependenci
* With Ruby / Bundler: https://github.com/asciidoctor/asciidoctor/tree/v2.0.10#requirements[Asciidoctor] 2.0.10
* With JavaScript (Node.js) / NPM: https://github.com/asciidoctor/asciidoctor.js/blob/v2.0.3/packages/core/package.json[Asciidoctor.js] 2.0.3


[[revealjs-compatibility-matrix]]
== reveal.js Compatibility Matrix

We try as much as possible to be compatible with a broad range of reveal.js versions.
However, changes made by that project sometimes forces us to drop compatibility with older reveal.js releases.
This table tracks this compatibility.

|===
|Asciidoctor reveal.js version |reveal.js version

|4.x
|3.9 - 3.8

|3.x, 2.x, 1.x
|3.7 - 3.0

|Unversioned releases
|2.x
|===


[[asciidoctorjs-compatibility-matrix]]
== Asciidoctor.js Compatibility Matrix

Expand Down
3 changes: 1 addition & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ end
namespace :build do
desc 'Compile Slim templates and generate converter.rb'
task :converter => 'clean' do
# NOTE: using mode :fast by default due to a bug in ruby-beautify under Ruby 2.5
# https://github.com/erniebrodeur/ruby-beautify/issues/45
# NOTE: use :pretty if you want to debug the generated code
build_converter :fast
end

Expand Down
32 changes: 32 additions & 0 deletions examples/fragments.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// .revealjs-features
// This example tests some of reveal.js' fragments features
// :include: //body/script | //div[@class="slides"]
// :header_footer:
= Fragments
:revealjs_history: true
:revealjs_fragmentInURL: true
:customcss: fragments.css

== Fragments

[%step]
* Fragments
* Are a reveal.js feature
* Very familiar to Powerpoint users

== Fragments in URL

[%step]
* With reveal.js 3.6
* Fragments
* Can now be displayed in URLs

== Using data-fragment

[%step]
* You can now
* Do
* Fancy
* CSS Things
* With Fragments
* See `fragments.css`
18 changes: 18 additions & 0 deletions examples/fragments.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import 'https://fonts.googleapis.com/css?family=Baloo+Bhai';

section[data-fragment="2"] p {
font-family: 'Baloo Bhai', cursive;
}

section[data-fragment="3"] p {
color: black;
flex: 1;
font-size: 2em;
line-height: 1.2;
text-decoration: none;
background-image: linear-gradient(to right, yellow 0, yellow 100%);
background-position: 0 -0.1em;
background-size: 100% 100%;
background-repeat: no-repeat;
transition: background .5s;
}
19 changes: 19 additions & 0 deletions examples/history-hash.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// .hash
// Enables reveal.js hash feature which is good to reload in-progress slides and doesn't push to browser history.
// :include: //body/script | //div[@class="slides"]
// :header_footer:
= No History
:backend: revealjs
:revealjs_hash: true

== First slide

This Deck

== Second slide

You can reload anytime

== Third slide

Yet browser history is not spammed
8 changes: 4 additions & 4 deletions examples/history.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// .history
// Enables Reveal.JS' browser history feature
// Enables reveal.js' browser history feature
// :include: //body/script | //div[@class="slides"]
// :header_footer:
= History
Expand All @@ -8,12 +8,12 @@

== First slide

Uno
This

== Second slide

Dos
Pushes

== Third slide

Tres
To Browser History Stack
32 changes: 32 additions & 0 deletions examples/links-preview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// .links-with-preview
// Demonstration of reveal.js global data-preview-link feature
// :include: //div[@class="slides"] | //body/*[last()]
// :header_footer:
= Links With Preview Tests
:revealjs_previewlinks: True
:imagesdir: images/

== Set Globally

https://en.wikipedia.org/wiki/February_4[Here's a link]

== Disabled Locally

https://en.wikipedia.org/wiki/February_4[Link One, preview=false]

https://en.wikipedia.org/wiki/February_4[Link Two, preview=0]

https://en.wikipedia.org/wiki/February_4[Link Three, preview=False]

== Image block with a Link

image::70s.jpg[link="https://montrehack.ca/"]

== Image block with a Link Disabled Locally

image::70s.jpg[link="https://montrehack.ca/", link_preview=false]

== Inlined Images

image:70s.jpg[link="https://montrehack.ca/", width=200px]
image:70s.jpg[link="https://montrehack.ca/", width=200px, link_preview=false]
39 changes: 39 additions & 0 deletions examples/links.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// .links
// Demonstration of reveal.js and AsciiDoc links
// :include: //div[@class="slides"]
// :header_footer:
= Links
:imagesdir: images/

== Regular

https://en.wikipedia.org/wiki/February_4[Link]

https://en.wikipedia.org/wiki/February_4[In new Window, window="_blank"]

https://en.wikipedia.org/wiki/February_4[In new Window (alternate syntax)^]


== With iFrame Preview Overlay

https://en.wikipedia.org/wiki/February_4[Link One, preview=true]

https://en.wikipedia.org/wiki/February_4[Link Two, preview=1]

https://en.wikipedia.org/wiki/February_4[Link Three, preview=True]


== Image Block with a Link

image::70s.jpg[link="https://montrehack.ca/", window="_blank"]


== Image Block with a Link With iFrame Preview

image::70s.jpg[link="https://montrehack.ca/", link_preview=true]


== Inlined Images

image:70s.jpg[link="https://montrehack.ca/", width=200px]
image:70s.jpg[link="https://montrehack.ca/", width=200px, link_preview=true]
Loading