-
Notifications
You must be signed in to change notification settings - Fork 188
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
resolves #370 add support for reveal.js 4.x #427
Conversation
Thanks @edl7878 Since you've made some changes on the templates, you will need to update the tests as well. |
Could you please also update asciidoctor-reveal.js/package.json Line 52 in e89b5af
|
How can I update the test? |
@edl7878 you can run tests locally using:
You will need to update the HTML files in https://github.com/asciidoctor/asciidoctor-reveal.js/tree/master/test/doctest For instance, in
It should be
It should be And here's the relevant test failure (taken from GitHub Action log):
|
There are 15 file issues, are these files in the test manually edited? If I modify them directly, could it be substituted by another pass of code generation? |
test files modified. Still has 2 errors, but I think the modifications are correct:
|
So the expectation is that the specified version of reveal.js will be used. The same goes for Please note that reveal.js 4.1.3 was just released. |
Does npm has no reveal.js 4.1.1? And I will roll back several modifications? Or, 4.0.2 is preferred? |
Latest version available on npmjs is 4.1.3: https://www.npmjs.com/package/reveal.js Basically, we want to check that when |
OK, if needed, I will target to 4.1.3. |
We are almost good (according to CI), last error is:
Could you please run |
One more issue catch by the tests suite: asciidoctor-reveal.js/test/smoke.js Line 21 in ba16105
You need to update the assertion: expect(result).to.contain('<script src="node_modules/reveal.js/dist/reveal.js">') |
how would i actually go about using this pr's build locally to render my own asciidoc reveal.js documents ? (i got the build working - just not sure how to refer to the local built for use with asciidcotor revealjs ? |
I figured it out. curl -L -o m.zip https://github.com/hakimel/reveal.js/archive/master.zip unzip it so its named reveal.js then run reason im trying this is I really like the auto-animate feature in reveal.js 4. I kinda got it working by adding:
|
You can use asciidoctor-reveal.js/templates/helpers.rb Lines 35 to 42 in ba16105
data-auto-animate=(bool_data_attr 'auto-animate')
You can already define data attributes on virtually any blocks/elements: https://asciidoctor-revealjs-examples.netlify.app/release-4.1.html#/_data_attributes
Not sure about this one... Apparently, it's possible to override animation settings: https://revealjs.com/auto-animate/#animation-settings |
cool - unfortunately seems it won't honor it on sections ? otherwise I should be able to just do: [data-auto-animate=0]
== Test
[source,java,data-id=code]
----
System.out.println('What upo!');
---- but here only the data-id gets through. |
I tried this but it doesn't do what I tried to ask for :) - let me try again: With my previous fix and your suggestion above I need to write like this: [auto-animate=true]
== Some section
[source,java,data-id="mycode"]
----
System.out.println('What upo!');
---- What I really want is: [auto-animate]
== Some section
[source,java,data-id="mycode"]
----
System.out.println('What upo!');
---- i.e. not having to add |
In this case we should use an option and not an attribute. In the following example
The reason is that we cannot disambiguate a block name from an attribute without a value. I believe that this is one of the reason why we have option:
Indeed, on asciidoctor-reveal.js/templates/section.html.slim Lines 50 to 66 in ba16105
I would recommend the following: data-auto-animate=((attr? 'auto-animate') || (option? 'auto-animate')) I haven't tested it but in theory the following should work:
|
won't work. data-auto-animate can't map to section tag:
while common block is ok, likes this:
reveal.js require map to section tag:
|
How to reopen this pull request? It seems I closed it accidentally. |
I think the translating layer, makes things harder for users, such as:
why not just use reveal.js original keywords, which is easier for users. except when use options, they have to use %, if they want cleaner output. |
For now, data-auto-animate is workable. test file:
All settings are added to section element, except Not fully test all settings, for now. |
I think the idea behind this abstraction is to make your content "portable" (or at least not tightly coupled to a specific backend).
In this case we are using the same name (without the
|
Yes, I agree with you that after getting rid of I just think that from the user's point of view, when they check the documentation of reveal.js, and find out there is a class could introduce a style, they can This solution is easier for documentation in asciidoctor-reveal.js, if not, each keyword map between reveal.js to asciidoctor-reveal.js, should be demonstrated explicitly in asciidoctor-reveal.js doc. Since this repo is asciidoctor-reveal.js, so, probably a little bit tight couple is acceptable, : ) |
For now, the current modified code may not very optimized, any suggestions? section.html.slim
|
If it helps reducing code duplication, you can add an helper method in https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/templates/helpers.rb |
May I ask, how to export an windows standlone exe converter? |
The conversation about attribute and option mapping strikes me as very off topic for this issue. I think it should be moved to a separate issue so it doesn't distract from the work being done here. |
I agree we should focus on supporting reveal.js 4.x. We can create follow-up issues/pull requests to improve attributes and options mapping.
You need to execute I just noticed that one test is failing due to one of my change, I will fix it. |
@edl7878 I will also rebase, squash commits and force push. For the next time, please create a dedicated branch using the following convention: |
data-auto-animate-easing=((attr? 'auto-animate-easing') || (option? 'auto-animate-easing')) | ||
data-auto-animate-unmatched=((attr? 'auto-animate-unmatched') || (option? 'auto-animate-unmatched')) | ||
data-auto-animate-duration=((attr? 'auto-animate-duration') || (option? 'auto-animate-duration')) | ||
data-auto-animate-id=(attr 'auto-animate-duration') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data-auto-animate-id=(attr 'auto-animate-duration') | |
data-auto-animate-id=(attr 'auto-animate-id') |
@@ -63,7 +63,13 @@ | |||
data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted')) | |||
data-background-opacity=(attr "background-opacity") | |||
data-autoslide=(attr "autoslide") | |||
data-state=(attr 'state')) | |||
data-state=(attr 'state') | |||
data-auto-animate=((attr? 'auto-animate') || (option? 'auto-animate')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add a sample presentation in the examples
directory to demonstrate how to use these attributes/options.
It serves multiple purposes:
- we can manually test that everything is working fine by opening the generated presentation in a browser
- we can write tests (using the existing test infrastructure)
- we are "self-documenting" new features
I think we should also add a new page in the documentation named auto-animate.adoc
to describe this new feature in the context of an AsciiDoc presentation.
OK. Got it. |
Awesome! |
Reveal.js 4.x assets path is varied from 3.9.x, in this pull request, asciidoctor-reveal.js code is modified: