cssr-markdownpandocquartoreveal.js

Add incremental option to markdown tables in Rmarkdown with reveal.js


I have a table like that that I render on a slide with Rmarkdown into a reveal.js html presentation:

|variable           |class     |description        |
|:------------------|:---------|:------------------|
|character_1_gender |character |The gender of the older character, as identified by the person who submitted the data for this couple| 
|character_2_gender |character |The gender of the younger character, as identified by the person who submitted the data for this couple|

In other parts, I use the incremental option to let list items appear after each other as fragments:

:::incremental
- The two (or more) actors play actual love interests (not just friends, coworkers, or some other non-romantic type of relationship)

- The youngest of the two actors is at least 17 years old

- Not animated characters
:::

How can I create a new class incremental_table that treats each table row as a fragment and can otherwise be used just as in the list example?


Solution

  • Maybe it is a starting point for you. You can solve this manually using raw HTML code, e.g.

    ---
    format: revealjs
    ---
    
    ## Incremental
    
    <table>
      <thead>
        <tr>
          <th>variable</th>
          <th>class</th>
          <th>description</th>
        </tr>
      </thead>
      <tbody>
        <tr class="fragment" data-fragment-index="1">
          <td>character_1_gender</td>
          <td>character</td>
          <td>The gender of the older character, as identified by the person who submitted the data for this couple</td>
        </tr>
        <tr class="fragment" data-fragment-index="2">
          <td>character_2_gender</td>
          <td>character</td>
          <td>The gender of the younger character, as identified by the person who submitted the data for this couple</td>
        </tr>
      </tbody>
    </table>