Hello John,

according to the reveal.js "docs" the HTML should look like this:

<pre><code data-line-numbers="|1-3|2|3-5|4|2,4">
if (a > b) {
    return c;
} else {
    return -1;
}
</code></pre>

reveal.js uses highlightjs to take care of the syntax highlighting itself, I think.
The code snippet above should generate 6 slides, where at first the entire code is highlighted, then only the first three lines, then only the second, and so on (the last slide has lines 2 and 4 highlighted separately).

I was hoping to achieve this with the following markdown:

~~~java [|1-3|2|3-5|4|2,4]
  if (a > b) {
    return c;
} else {
    return -1;
~~~

There is a lua filter [1] out there, which would make this possible - however it's not compatible with my template file and the rest of my workflow. (which is kind of my own problem :/  ) 

Best regards
  Christian

[1] https://github.com/pandoc/lua-filters/tree/master/revealjs-codeblock 


Am Di., 29. Sept. 2020 um 20:20 Uhr schrieb John MacFarlane <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org>:

We do target v4.  However, pandoc uses its own syntax
highlighting, unless you disable this with `--no-highlight`.

I doubt this would be sufficient, though, to get this to
work.  Can you tell us what HTML (not markdown) reveal.js
expects to see for this syntax?

Christian Braune <christian.braune79-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello,
>
> I am trying to generate reveal.js slides from markdown that contain code.
>
> Since v4.0.0 reveal.js supports fragmented (step by step highlighting) of
> code lines.
> The syntax should be something like this:
>
> ~~~java [1-3|4-6]
> ...
> ~~~
>
> The above example should generate something that shows the entire code, but
> on the first slide lines 1-3 are highlighted, on the seconf lines 4-6. [1]
>
> When compiling the markdown to revealjs (specifying explicitly that I want
> to use revealjs@4.0) the result contains no code highlighting. In fact the
> code block is completely messed up. When removing the square brackets,
> everything is fine.
> I am using pandoc v2.10.1 .
>
> Is there a way to achieve this or is the reveal.js version not yet
> completely incorporated into pandoc?
>
> Thanks and regards
>   Christian
>
> [1] https://github.com/hakimel/reveal.js/issues/2371#issuecomment-619835972
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2b03582e-4cb0-452d-a138-571658329605n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CABfx9%3DeqNNRXZu_oNbG2gM1-XGG9QeOS03CXF89w0TwzzjfsWg%40mail.gmail.com.