asciidoctor / asciidoctor-reveal.js

:crystal_ball: A reveal.js converter for Asciidoctor and Asciidoctor.js. Write your slides in AsciiDoc!
http://asciidoctor.org
Other
287 stars 189 forks source link

Using [%step] on colist works the same as on ulist #529

Closed ibethus closed 2 months ago

ibethus commented 2 months ago

Hi,

This PR aims to modify the behavior of the step attribute on a callout block. I believe callouts should behave consistently with traditional lists when prefixed with this attribute. This adjustment can enhance the presentation of code fragments, offering a more interactive experience.

Example :

[source, javascript]
----
let hello = "hello world"; <1>
console.log(hello); <2>
----
[%step]
<1> First line
<2> Second line

In the current implementation, only one fragment would be created. With this modification, individual fragments will be generated for each callout line, aligning with the intended behavior.

Code : On the code side, I've only repositioned the fragment class definition in the colist template and included an example in the step.adoc file to illustrate this modification.

Cheers!

ggrossetie commented 2 months ago

Thanks! It would be great if you could create a release-5.2.adoc in https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/examples (similar to https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/examples/release-5.1.adoc).

Then, copy the HTML file in the public directory:

https://github.com/asciidoctor/asciidoctor-reveal.js/blob/cbe2ac7f72877050ce15ee4a38fd54ca91590a78/Rakefile#L154

And add a link in:

https://github.com/asciidoctor/asciidoctor-reveal.js/blob/cbe2ac7f72877050ce15ee4a38fd54ca91590a78/src/index.html#L24

That way, we can see the result using Netlify preview: https://deploy-preview-529--asciidoctor-revealjs-examples.netlify.app/

ggrossetie commented 2 months ago

One test is failing because you've enabled :icons: font and update the template. You will need to update the expected result test/doctest/steps.html

ibethus commented 2 months ago

Thanks for the feedback!

Documentation and test case updated, hope this matches your expectations :+1:

ggrossetie commented 2 months ago

Yes that's awesome, thanks 🎉 If anyone is curious, you can see the result at: https://deploy-preview-529--asciidoctor-revealjs-examples.netlify.app/release-5.2#/_iterating_through_callouts

mojavelinux commented 2 months ago

That's really nice!