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

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

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

ibethus
Copy link
Contributor

@ibethus ibethus commented Apr 13, 2024

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
Copy link
Member

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:

FileUtils.cp 'examples/release-5.1.html', "#{PUBLIC_DIR}/release-5.1.html"

And add a link in:

<li><a href="./release-5.1.html">Asciidoctor reveal.js 5.1</a></li>

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

@ggrossetie
Copy link
Member

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
Copy link
Contributor Author

ibethus commented Apr 15, 2024

Thanks for the feedback!

Documentation and test case updated, hope this matches your expectations 👍

@ggrossetie
Copy link
Member

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

@ggrossetie ggrossetie merged commit 8484b01 into asciidoctor:master Apr 15, 2024
14 checks passed
@mojavelinux
Copy link
Member

That's really nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants