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

Support importing code snippets from files #369

Closed
orhun opened this issue Sep 14, 2024 · 5 comments
Closed

Support importing code snippets from files #369

orhun opened this issue Sep 14, 2024 · 5 comments

Comments

@orhun
Copy link
Contributor

orhun commented Sep 14, 2024

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
Copy link
Owner

Not on computer now but can you check if #328 does what you need? Another unreleased feature :)

@orhun
Copy link
Contributor Author

orhun commented Sep 15, 2024

Works like a charm! Thanks 💖

@orhun orhun closed this as completed Sep 15, 2024
@orhun
Copy link
Contributor Author

orhun commented Sep 15, 2024

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 🤔

@mfontanini
Copy link
Owner

Sorry, been quite busy. This is now fixed in #372

@orhun
Copy link
Contributor Author

orhun commented Sep 23, 2024

Can confirm that it works, thanks a lot!

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

No branches or pull requests

2 participants