Open multimeric opened 6 months ago
I wonder if there is a mandatory --section-divs behaviour with revealjs,
Yes, because revealjs requires these sections.
I do understand that this behavior is problematic for some uses (e.g. applying tailwind css classes). However, other people rely on it; when I reverted it at one point, it caused problems. See https://github.com/jgm/pandoc/issues/5975 and especially https://github.com/jgm/pandoc/issues/5965
Thanks for the background.
Could we have a --copy-header-attribs false
type flag to make this opt out without breaking existing behaviour?
In principle this is possible, but it's an ugly solution. This would mean you wouldn't get any attributes on the section, not even an identifier. In revealjs many features of slides are controlled by attributes on the section element, so you'd lose the ability to use any of these.
Okay, how about a --manual-slides
flag which disables all the automatic slide splitting (by headings, and by ---
), and disables the --section-divs
behaviour, and instead requires the user to use a ::: Slide
class to distinguish each slide? Then they can add attributes to the heading using # Title {.my-title-class}
, and attributes to the slide using ::: {.slide .my-section-class}
.
As someone who wants control rather than convenience for this particular use case, I think this would be great.
Explain the problem. Consider the following markdown document. Here, we have an HTML class we want to apply to the title of the slide, but not to the content.
However, when running
pandoc -i test.md --to revealjs
on this document, we get the following. Note howmy-title-class
is attached to the<section>
as well as the<h1>
, which is not what we wanted:Compare this to the standard HTML behaviour.
pandoc -i test.md --to html
gives us the following, which is correct because only the<h1>
has the class:But now, if we add
--section-divs
, we get something suspiciously similar to therevealjs
result:Consequently, I wonder if there is a mandatory
--section-divs
behaviour with revealjs, which in my case is very irritating, because I don't want the class applied this way. It's possible that this is necessary because of howrevealjs
expects its HTML markup, and if that is the case, I would love to be able to have a flag that enables section-divs, but without copying the header classes onto the sections!Pandoc version?