mfontanini / presenterm

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

Support importing code snippets from files #369

Closed orhun closed 3 days ago

orhun commented 3 days ago

Using +exec for code blocks is not always suitable since the amount of code in my presentation varies from 10 lines to sometimes 50 lines. And hiding the code (e.g. using e.g. # . for Rust) is too much manual work.

But I still want to verify that the code in my presentation builds fine so I created a separate folder called code which contains all the code used along with unit tests and so on.

I would like to request a feature that works very similar to remark-code-import so that I can simply import snippets from a file into the presentation. We can use anchors and so on to name/designate the start/end of sections. See ratatui-website repository to see how we use this.

What do you think? 🐻

mfontanini commented 3 days ago

Not on computer now but can you check if https://github.com/mfontanini/presenterm/pull/328 does what you need? Another unreleased feature :)

orhun commented 3 days ago

Works like a charm! Thanks 💖

orhun commented 3 days ago

One thing that I realized is that the presentation is not updated when I update the file so I need to restart the app. I think it needs a file watcher for auto reloading 🤔