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

More succint syntax for slide_end and pause #65

Closed
cbarrete opened this issue Nov 26, 2023 · 9 comments · Fixed by #87 or #89
Closed

More succint syntax for slide_end and pause #65

cbarrete opened this issue Nov 26, 2023 · 9 comments · Fixed by #87 or #89

Comments

@cbarrete
Copy link

Would you consider supporting an alternative syntax for the commands that currently use HTML comments?

I understand that they are "more correct", but I also miss the writability (mitigated by the use of snippets) and readability of https://github.com/maaslalani/slides/ documents a little bit.

@mfontanini
Copy link
Owner

Can you expand on what you mean by alternative syntax? Do you want an abbreviation? slides doesn't support pauses and I know they use thematic breaks (---) to end slides but I explicitly went another route because a) end_slide is much easier to spot than --- and b) --- is a real markdown element that you may want to use so I don't think we should "steal it" for other purposes.

@cbarrete
Copy link
Author

An abbreviation, or just something that is a little less busy. end_slide is easier to spot for sure, but it also (subjectively) makes the source document harder to read compared to --- (which I understand your reasons for not using as a slide delimiter, even though I don't know how useful horizontal lines are in presentations, but that's just me :) ).

I don't really have a good suggestion though, I don't know any syntax that would make sense and be compatible with Markdown, I just wanted to have your opinion on that. If you like the verbosity of the HTML comments because it makes them easier to spot, there's nothing to discuss!

@mfontanini
Copy link
Owner

One big difference between slides and presenterm in this area is that slides doesn't support setex headers (the ones that presenterm uses as slide titles). Because slide titles are so common in presenterm, using thematic breaks becomes genuinely annoying as the difference between a slide ending and a slide title is a newline. I actually initially had thematic breaks as slide terminators but removed it exactly because of this: even in my dummy test presentations I couldn't easily spot where slides ended.

I'd be okay with adding shorthands but I don't know if that simplifies things much as you still need to define the comment tags. I don't like the verbosity of HTML but given pauses and slide separators are not part of the markdown spec, we need something else and this fits.

@cbarrete
Copy link
Author

cbarrete commented Nov 26, 2023

How about having implicit slide endings before slide titles?

Right now

Slide one
---

Here is my presentation...

Slide two
---

... and now it's done!

results in a single slide with 2 titles. If you think that this isn't a valid use case, it could be made equivalent to

Slide one
---

Here is my presentation...

<!-- end_slide -->

Slide two
---

... and now it's done!

I'm thinking out loud here, I don't have a solid proposal, so feel free to close the issue :)

Also regarding the shorthands, I agree that they are not worth much if they still require the comment syntax.

@mfontanini
Copy link
Owner

Ohh interesting idea! I'm aware that you can currently have 2+ slide titles and it looks a bit weird so I don't see an issue adding this shorthand.

@mfontanini
Copy link
Owner

Alright this is merged. I made it an optional behavior just in case so if you do want it you need to enable it by editting ~/.config/presenterm/config.yaml and adding:

options:
  implicit_slide_ends: true

Let me know if there's any issues!

@cbarrete
Copy link
Author

cbarrete commented Dec 9, 2023

I was going to implement it myself an hour ago and just saw that it... was already done?
It seems to be working great, thanks! I think you should consider making it the default by the way: it's much more convenient than having the HTML comments in there.

@cbarrete
Copy link
Author

cbarrete commented Dec 9, 2023

Actually, it seems that an empty slide gets added if a front matter is present, regardless of whether there is a title or not.
Minimal repro:

---
theme:
  name: terminal-dark
---

Intro
---

Hello

Conclusion
---

Good bye

@mfontanini
Copy link
Owner

Dang, it should be fixed now. The code that deals with state between markdown elements is pretty fragile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants