-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
include-files: add support for inclusion of source code block from input files #126
Conversation
Thanks for opening this! I'm of two minds here. On one hand, this would be a nice and simple method to extend the filter's functionality. On the other hand, code inclusion is quite different from transclusion, with complex filters dedicated just to code inclusion. This would mean that the filter will grow considerably more complex over time. Not sure if a separate filter would be better? Also, maybe we should rename this filter to |
I have no definitive nor sensible ideas on the subject. I introduced the change because the first time I used the filter to include source code I misused the I agree with you that the filter could grow considerably if features are added specifically for code inclusion, in that case a dedicated filter could have sense ( Finally I am not sure that the |
I added a |
The I lean towards the two-filters solution, but would love to hear what others think. If anyone else has an opinion on this, please chime in! |
I created distincts PR (and closed this one) in order to ease the inclusion of code, if such a choice would be taken at one point:
Hope I did not make too much noise and did not introduce to much mistake. |
Excellent, thanks |
I have just added the use of inclusion for classical code block from source files. I tried to let it be as simple as possible to use.
I took ideas from different sources such as https://groups.google.com/d/msg/pandoc-discuss/mj3G_DRloCs/ncZVJaeGAwAJ.
Even if it seems to work correctly, the code is not that pretty. Some redundancy could be avoided (the loop which parses files name), I do, however, not master lua enough for now to avoid it.