webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.74k stars 416 forks source link

Request: Syntax sugar for fragments #470

Open robmunger opened 11 months ago

robmunger commented 11 months ago

Hi, and thank you for an amazing project! The contributing guidelines said that feature requests and questions were allowed, so here goes...

Would you ever consider adding the following feature? https://marpit.marp.app/fragmented-list

I am an economics teacher and love using fragments in my slides. I use Marp and find that feature tremendously helpful! I like markdown because it is pleasant to read and edit, but having to put HTML comments after each fragment makes it less so.

Perhaps the functionality to could be enabled in the YAML frontmatter.

Alternatively, would you consider adding an example, either here or in the Readme, of how to use the preprocessor to implement this?

I appreciate any response!

MartenBE commented 11 months ago

Although very handy, I think it fits more to request this at the Reveal.js repository at https://github.com/hakimel/reveal.js/ as we use their code to interpret markdown into a slideshow. If they implement it, the functionality will be automatically added to reveal-md.

unphased commented 6 months ago

I can set something like <!-- .element: class="fragment" --> and it does work, however there is no way to target a <ul> for instance. It will just make the last <li> in a ul into a fragment. But what I want is to make the whole <ul> a fragment!

With that said: under reveal-md, since markdown allows for inline HTML, the plain approach WORKS:

Things like:

<ul class='fragment'>
    <li>Inserting sanity checks</li>
    <li>Revealing the execution sequence of a program</li>
    <li>Revealing the state of a program</li>
</ul>

shows just like I would want in the presentation, one fragment reveals the entire unordered list.

MartenBE commented 6 months ago

Thanks for the tip! This is however also totally up to reveal.js (https://revealjs.com/markdown/#element-attributes) as reveal-md doesn't parse this, but just gives it as is to reveal.js.