Skip to content

Reveal JS autoslide problem #367

Closed
@lucki1000

Description

@lucki1000

I want to use Reveal JS autoslide for a presentation, and would overwrite this function with :data-autoslide: integer like it is descript in this document but it won't change his first value.

asciidoctor-revealjs -v 
Asciidoctor reveal.js 4.0.1 using Asciidoctor 2.0.10 [https://asciidoctor.org]
Runtime Environment (ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

Activity

ggrossetie

ggrossetie commented on May 24, 2020

@ggrossetie
Member

For reference: asciidoctor/asciidoctor#3673 (comment)

To answer your question, I think this feature is not implemented despite the fact that the documentation mentions it. Maybe it was forgotten sweat_smile
I believe that the syntax would be:

[autoslide=15000]
== Slide

Thanks but unfortunately does not work either, i will create the issue there asciidoctor/asciidoctor-reveal.js

I was only suggesting what the syntax should be but since it's not implemented it won't work.
Are you familiar with Ruby? I think it would be relatively simple to implement if you want to give it a try.
Basically, what we need to do is add the following line:

data-autoslide=(attr "autoslide")

in here:

data-background-opacity=(attr "background-opacity")
data-state=(attr 'state'))

Then test add an example in the examples directory to make sure it's actually working.

lucki1000

lucki1000 commented on May 25, 2020

@lucki1000
Author

I'm not familiar with Ruby,
I have added this data-autoslide=(attr "autoslide") in /var/lib/gems/2.5.0/gems/asciidoctor-revealjs-4.0.1/templates/section.html.slim and tried again asciidoctor-revealjs ./document.adoc -o index.html but still no changes.

ggrossetie

ggrossetie commented on May 25, 2020

@ggrossetie
Member

The templates are "compiled" so it won't work if you update locally the template file section.html.slim. You will need to clone this project and build it: https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/HACKING.adoc

lucki1000

lucki1000 commented on May 26, 2020

@lucki1000
Author

I've cloned this repo and added data-autoslide=(attr "autoslide") to the template section.html.slim then i executed:

bundle exec rake build
bundle --path=.bundle/gems --binstubs=.bundle/.bin

after this i run again asciidoctor-revealjs ./document.adoc -o index.html but nothing changed.

ggrossetie

ggrossetie commented on May 26, 2020

@ggrossetie
Member

can you run bundle exec asciidoctor-revealjs ./document.adoc -o index.html from the repository?

lucki1000

lucki1000 commented on May 26, 2020

@lucki1000
Author

Changed sadly nothing.

ggrossetie

ggrossetie commented on May 26, 2020

@ggrossetie
Member

Damn! I will give it a try 😉

ggrossetie

ggrossetie commented on May 26, 2020

@ggrossetie
Member

I just did and it's working:

$ rvm use 2.6.3@asciidoctor-reveal.js --create
$ bundle install

Edit the file:

$ grep -n5 autoslide templates/section.html.slim
52-    data-background-iframe=(attr "background-iframe")
53-    data-background-video=data_background_video
54-    data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
55-    data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
56-    data-background-opacity=(attr "background-opacity")
57:    data-autoslide=(attr "autoslide")
58-    data-state=(attr 'state'))
59-    - unless hide_title
60-      h2=section_title
61-    - if parent_section_with_vertical_slides
62-      - unless (_blocks = blocks - vertical_slides).empty?

Create a presentation:

$ cat presentation.adoc -p
= Presentation


[autoslide=15000]
== Slide

Build and run:

$ bundle exec rake build
$ bundle exec asciidoctor-revealjs ./presentation.adoc -o presentation.html
$ grep "data-autoslide=" presentation.html
document.getElementsByTagName( 'head' )[0].appendChild( link );</script></head><body><div class="reveal"><div class="slides"><section class="title" data-state="title"><h1>Presentation</h1></section><section id="_slide" data-autoslide="15000"><h2>Slide</h2></section></div></div><script src="reveal.js/js/reveal.js"></script><script>Array.prototype.slice.call(document.querySelectorAll('.slides section')).forEach(function(slide) {
added a commit that references this issue on May 26, 2020

resolves asciidoctor#367 allow to configure autoslide timer per slide

4f4f1cf
added a commit that references this issue on May 27, 2020

Merge pull request #368 from Mogztter/issue-367-configure-autoslide

960ce32
lucki1000

lucki1000 commented on May 27, 2020

@lucki1000
Author

I'm Sorry by me it worked too :), had a typo in the -o argument.
Thanks

ggrossetie

ggrossetie commented on May 27, 2020

@ggrossetie
Member

No worries 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ggrossetie@obilodeau@lucki1000

      Issue actions

        Reveal JS autoslide problem · Issue #367 · asciidoctor/asciidoctor-reveal.js