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

Request: Syntax sugar for fragments #470

Open
robmunger opened this issue Nov 10, 2023 · 3 comments
Open

Request: Syntax sugar for fragments #470

robmunger opened this issue Nov 10, 2023 · 3 comments

Comments

@robmunger
Copy link

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!

@robmunger robmunger changed the title Syntax sugar for fragments Request: Syntax sugar for fragments Nov 10, 2023
@MartenBE
Copy link
Contributor

MartenBE commented Nov 10, 2023

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

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

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.

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

No branches or pull requests

3 participants