-
It would be really useful to have a simple directive available to instruct Marp NOT to print out a specific slide when exporting to PDF. Inserting a slide-specific directive to skip/ignore these "transition" slides when exporting to PDF would be great : ---
# Slide 1 (to be ignored in PDF)
This is an example.
<!-- _skip: pdf -->
---
# Slide 2
This is an **example**.
--- or another version of this ( Would that be possible and easy to implement? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The Marp team does not plan to adopt this proposal at this time because:
An existing feature of Marp/Marpit that exhibits the behavior you've described is Fragments (particularly in the context of PDF output). By using fragments with some CSS tricks, you can achieve the same behavior as your proposal. <style scoped>
@media screen {
/* Viewing on HTML (Marp CLI's bespoke template): Hide not current fragments */
[data-marpit-fragment][data-bespoke-marp-fragment]:not([data-bespoke-marp-current-fragment="current"]) {
display: none;
}
}
@media print {
/* Printing to PDF: Hide not last fragments */
[data-marpit-fragment]:not([data-marpit-fragment]:last-of-type) {
display: none;
}
}
</style>
<div data-marpit-fragment>
# 1st fragment
</div>
<div data-marpit-fragment>
# 2nd fragment
</div>
<div data-marpit-fragment>
# 3rd fragment
</div>
---
... This example is defining fragments explicitly by using And using fragments is better habits for maintaining semantic Markdown and HTML rather than using multiple slides. Fragmented contents are not separated into multiple slides. It's just a single slide with multiple fragments. It will not be wrongly recognized as multiple slide pages even if parsed by Markdown processors other than Marp. Lastly, you also can create Marp plugin to achieve your proposal based on this example, just like |
Beta Was this translation helpful? Give feedback.
The Marp team does not plan to adopt this proposal at this time because:
An existing feature of Marp/Marpit that exhibits the behavior you've described is Fragments (particularly in the context of PDF output). By using fragments with some CSS tricks, you can achieve the same behavior as your proposal.