maaslalani / slides

Terminal based presentation tool
http://maaslalani.com/slides/
MIT License
9.58k stars 263 forks source link

Add new option --ShowBulletsIndividually #276

Open StefanSchroeder opened 8 months ago

StefanSchroeder commented 8 months ago

Changes Introduced

It's easy to mix and match items to be shown or not shown by adding an individual space in front of the asterisk.

If there is trailing text behind the list, it will be shown together with the last item of the list.

maaslalani commented 8 months ago

Hey @StefanSchroeder, this is a really awesome contribution. Thank you for these changes!

I think to get this feature merged I would likely want something more declarative / within the markdown document itself (at least I think) so that:

  1. Live-editing works
  2. People can mix individual bullets with grouped bullets

What do you think about the following proposal (I'm happy to also consider other alternatives and suggestions as well)

Essentially, currently each slide is delimited with ---, what if we added a partial slide delimiter (***) to incrementally append content to a slide without changing the page number.

# Slide 1

This is the first slide.

---

# Slide 2

This is the second slide.

***

This content will be appended to the second slide (when the next button is clicked).

***

This content will be appended to the second slide (when the next button is clicked).

---

# Slide 3

This is the third slide.

I think this solution:

  1. Keeps markdown compatibility with the *** instead of ---.
  2. Declares how the presentation is revealed
  3. Makes it more flexible (can be used for revealing code blocks or any content instead of just bullet points)
# Slide 1

* First bullet

***

* Second bullet

***

* Third bullet

---

# Slide 2

* Grouped bullets
* Grouped bullets
* Grouped bullets
StefanSchroeder commented 8 months ago

Ok, I'll provide an update. The common-mark specifications calls this a 'thematic block'.

https://spec.commonmark.org/0.30/#thematic-break

This spec is pretty intricate and allows several deviations from a simple three-character block, e.g. there can be spaces in between. Is there any particular Markdown dialect that you prefer? I'll try to come up with a single regexp that matches the specification. But that seems to be about it what needs to be changed.

There is one caveat though. Since we are just exploding the slides to be one new slide per section, the page counter will not reflect the number of pages any more, but the number of sections. There is more than one way to fix that. This would need a design decision.

StefanSchroeder commented 8 months ago

Hmm, I pushed my update to my fork, but when I open a new PR I get redirected to this one. I am not sure how to proceed. Is there anything I overlooked?

oysandvik94 commented 6 months ago

If the incremental points are enabled by the *** seperator, should the --ShowBulletsIndividually flag be needed?

maaslalani commented 6 months ago

If the incremental points are enabled by the *** seperator, should the --ShowBulletsIndividually flag be needed?

No, the flag would not be needed anymore.

StefanSchroeder commented 6 months ago

the point of the flag originally was to not change the default behavior. the option would give users control to only use that feature if specifically requested.

xukai92 commented 4 months ago

it would be nice to support ***. i'd like to contribute with some help