You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The programming language would be deducted from the file-extension.
It would be nice if mdbook had all kinds of extension like this using the liquid-like format, but for quicker solution it might be a preprocessors. Maybe it could be added to embedify.
What do you think @MR-Addict ?
The text was updated successfully, but these errors were encountered:
szabgab
changed the title
Easily include a file
Easily include a file setting the syntax highlighting and also showing the name of the file
Apr 13, 2025
Hi! Thanks for the suggestion — I’d love to help with this, but I’m not sure I fully understand the problem you're trying to solve. Could you clarify what the current workflow looks like for you, and what exactly you’d like embedify to do differently?
From what I gather, it seems you're trying to simplify how you include source files in your markdown, and also automatically generate a filename (optionally as a link) above the code block. Is that correct?
Any extra detail or an example of the input and expected output would be super helpful! 😊
I've just updated embedify to support the {% include file="..." %} macro! You can find the documentation for it here.
From the preprocessor’s perspective, I decided not to add automatic links to the included file. Since raw Markdown works perfectly for that, it's more flexible to let the user add the link manually if needed — that way you're not locked into a specific format.
This update is still in pre-release, as I’ve done some internal refactoring. So please test it well before using it in production, and feel free to report any issues you run into!
Let me know what you think, and if you have any feedback or ideas for further improvements!
Uh oh!
There was an error while loading. Please reload this page.
Problem
Right now if I would like to include a source file I need to use something like this:
{{#include file.rs}}
I also need to wrap it withI would also like to add the name of the file above the included file
And maybe even make it a link to the file in my github repository.
Proposed Solution
It would be nice to be able to write something like:
That would be expanded to something like this:
The programming language would be deducted from the file-extension.
It would be nice if mdbook had all kinds of extension like this using the liquid-like format, but for quicker solution it might be a preprocessors. Maybe it could be added to embedify.
What do you think @MR-Addict ?
The text was updated successfully, but these errors were encountered: