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

fragment feature of reveal: Check and document #120

Open
cderv opened this issue Sep 16, 2021 · 3 comments
Open

fragment feature of reveal: Check and document #120

cderv opened this issue Sep 16, 2021 · 3 comments
Projects

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 16, 2021

Looking into #73 got me tested several syntax like fenced div or span attributes.

I think this should be documented better to see what works with Pandoc compared to what is document in the JS lib

Resources

Example

Tests of different syntax. @apreshill you could have some thoughts about them.

---
title: Fading / incremental / fragment
output:
  revealjs::revealjs_presentation: default
---

# About fragment / incremental slide

Look at the vertical slide after each slide to see the markdown syntax

# Pausing using pandoc syntax

content before the pause

. . .

content after the pause

. . .

Content after another pause

## See code

```markdown
content before the pause

. . .

content after the pause

. . .

Content after another pause
```

# Equivalent to using fenced div

Content before fade

::: fragment
content after the pause
:::

::: fragment
content after the pause
:::

## See code

```markdown
Content before fade

::: fragment
content after the pause
:::

::: fragment
content after the pause
:::
```

# Using HTML directly

<p class="fragment">Fade in</p>
<p class="fragment fade-out">Fade out</p>
<p class="fragment highlight-red">Highlight red</p>
<p class="fragment current-visible">Fade in, then out</p>
<p class="fragment fade-up">Slide up while fading in</p>

## See code 

````markdown
<p class="fragment">Fade in</p>
<p class="fragment fade-out">Fade out</p>
<p class="fragment highlight-red">Highlight red</p>
<p class="fragment current-visible">Fade in, then out</p>
<p class="fragment fade-up">Slide up while fading in</p>
````

# attributes can be added on divs

::: fragment
Fade in
:::

::: {.fragment .fade-out}
Fade out
:::

::: {.fragment .highlight-red}
Highlight red
:::

::: {.fragment .current-visible}
Fade in, then out
:::

::: {.fragment .fade-up}
Slide up while fading in
:::

## See code

````markdown
::: fragment
Fade in
:::

::: {.fragment .fade-out}
Fade out
:::

::: {.fragment .highlight-red}
Highlight red
:::

::: {.fragment .current-visible}
Fade in, then out
:::

::: {.fragment .fade-up}
Slide up while fading in
:::
````

## See output

it create unnecessary divs

````html
<div class="fragment visible" data-fragment-index="0">
<p>Fade in</p>
</div>
<div class="fragment fade-out visible" data-fragment-index="1">
<p>Fade out</p>
</div>
<div class="fragment highlight-red visible" data-fragment-index="2">
<p>Highlight red</p>
</div>
<div class="fragment current-visible visible" data-fragment-index="3">
Fade in, then out
<p></p>
</div>
<div class="fragment fade-up visible" data-fragment-index="4">
<p>Slide up while fading in</p>
</div>
````

# But it works on span too 

[Fade in]{.fragment}

[Fade out]{.fragment .fade-out}

[Highlight red]{.fragment .highlight-red}

[Fade in, then out]{.fragment .current-visible}

[Slide up while fading in]{.fragment .fade-right}


## See code

````markdown
[Fade in]{.fragment}

[Fade out]{.fragment .fade-out}

[Highlight red]{.fragment .highlight-red}

[Fade in, then out]{.fragment .current-visible}

[Slide up while fading in]{.fragment .fade-up}
````

### See output

````html
<h1>Does it works on span ?</h1>
<p><span class="fragment" data-fragment-index="0">Fade in</span></p>
<p><span class="fragment fade-out" data-fragment-index="1">Fade out</span></p>
<p><span class="fragment highlight-red" data-fragment-index="2">Highlight red</span></p>
<p><span class="fragment current-visible" data-fragment-index="3">Fade in, then out</span></p>
<p><span class="fragment fade-up" data-fragment-index="4">Slide up while fading in</span></p>
````

# You just can't add attributes on any Markdown element

Not yet at least: https://github.com/jgm/pandoc/issues/684
````
@cderv cderv added this to Backlog in v1.0 via automation Sep 16, 2021
@cderv
Copy link
Collaborator Author

cderv commented Sep 16, 2021

Using incremental list with revealjs also use the fragment feature on <li> node. So it will apply the fragment class only on the list items

::: incremental

- Eat spaghetti
- Drink wine

:::
<ul>
<li class="fragment visible current-fragment" data-fragment-index="0">Eat spaghetti</li>
<li class="fragment" data-fragment-index="1">Drink wine</li>
</ul>

It does not seem possible to use markdown syntax within Pandoc to customize the attributes on each bullet though. But that is easier than using attributes on spans

@rleyvasal
Copy link

This looks promising, hopefully it can be implemented in v1.0.

@cderv
Copy link
Collaborator Author

cderv commented May 5, 2022

If you are interested in newest feature for HTML side with revealjs, you could be interested in Quarto HTML slide format: https://quarto.org/docs/presentations/revealjs/

Quarto is a next-generation publishing tools, inspired by R Markdown experience, made for broader usage (R, Python, Julia, ...). See about R Markdown and Quarto context also: https://quarto.org/docs/faq/rmarkdown.html (and https://yihui.org/en/2022/04/quarto-r-markdown/)

We will not make any big new feature in the revealjs package, but I probably try to add this one in v1 documentation. Note that this should be working with current dev version of revealjs R package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v1.0
To do
Development

No branches or pull requests

2 participants