mfontanini / presenterm

A markdown terminal slideshow tool
https://mfontanini.github.io/presenterm/
BSD 2-Clause "Simplified" License
1.33k stars 32 forks source link

[Feature Request] A way to spread sub-titles or bullet points in the vertical direction #165

Closed Davidyz closed 9 months ago

Davidyz commented 9 months ago

In the current implementation, all content in a slide is crammed at the top of the page.

In the attached example, the three lines are seperated in the source markdown file. I wonder whether there's a way so that they are somewhat evenly distributed in the vertical direction so that there won't be such a huge blank space at the bottom. It'll be better if markdown sections and subsections (lead by hashtag symbols "#") can be respected. image

mfontanini commented 9 months ago

I'll start by saying I doubt you'll ever get a good looking slide with that combination of a gigantic terminal and 3 lines of content :P. I do acknowledge this problem though, I'm just not sure what would be the ideal way to display this. e.g. where would you add the padding? Pad the first "in fact" line down by how much, then how much padding until the title? Then how much padding after that? I don't think you can just evenly distribute them as that'll look bad in a different way IMO.

Davidyz commented 9 months ago

This is just a toy presentation to familiarise myself with this tool. I reckon that it might be difficult to implement an automatic mechanism to place the contents but would it be possible to add a parameterized command to allow manually adding blank lines, like

<!-- new_line 2 -->

for two blank lines, so that users can somehow control the spacing above a certain paragraph? At the moment there isn't even a way to "center" a paragraph in the vertical axis, which I find quite necessary when making slides.

mfontanini commented 9 months ago

<!-- new_line 2 -->

Yeah I've been thinking of this, it seems very useful.

At the moment there isn't even a way to "center" a paragraph

I think I haven't documented it (and need to do that!) but there's a

<!-- jump_to_middle -->

That jumps to the vertical center. Do note that if you already wrote something there, it will look like crap. My favorite (and really the only) use for this is to do something like

blablabla

<!-- end_slide -->

<!-- jump_to_middle -->

Farming potatoes
===

<!-- end_slide -->

In order to create a nice "separator" slide that changes topics.

mfontanini commented 9 months ago

I created #167 to introduce the new_lines command. Does that work for you as a workaround?

Davidyz commented 9 months ago

Yes, this works for my issue. It would be nice if I could simply do <!-- new_lines --> (without an argument) for one single new line but the current implementation is totally good enough for me. Thanks for the lightning-fast reply & implementation.

mfontanini commented 9 months ago

Alright I merged the PR. There's 2 new commands: