asciidoctor / asciidoctor-reveal.js

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

Support for table row fragments #493

Open johthor opened 1 year ago

johthor commented 1 year ago

Currently the step option on a table is translated into the class fragment on the resulting HTML table. This differs from the translation for ordered and unordered lists where the step option leads to the class fragment being applied to the list items instead of the list itself.

I would like to have a possibility to apply the the fragment class to the <tr> instead of the <table>. Which should be possible if I didn't miss any specifics.

For backwards compatibility reasons this most likely should be accomplished via a new option instead of changing the step option.

ggrossetie commented 1 year ago

Interesting idea... we might need to introduce an attribute to control if we want to step per line or not. Should we also support per column? and per row per column?

johthor commented 1 year ago

I did a small experiment where I took the implementation from lists and applied it to the table's rows via an option rowStep. While adding fragment on <tr> elements was simple I'm not sure how revealing per column would be supported by reveal.js.

I found this open issue https://github.com/hakimel/reveal.js/issues/2191. Otherwise the <td> would need to receive the class fragment and the data-fragment-index would need to be incremented by column and reset after each row to reveal all cells of a column at the same time (see https://revealjs.com/fragments/#fragment-order). The problem with that is, that I see a conflict between the automatic step order outside of the table and the forced step order inside the table.

I wouldn't want to support stepping per row per column. That would lead to some really busy slides. Although it would most likely be simpler than stepping only per column.