-
Notifications
You must be signed in to change notification settings - Fork 111
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
get_filename4code should have an accompanying function to get rid of the temporary directories #87
Comments
I agree with all of this. However, this project is in a 'barely maintained' state right now. I'm not a Python programmer. If you want to submit a PR, I'd definitely consider this change. |
Most if not all of the pandocfilters examples are ported to panflute. You can give it a try: https://github.com/sergiocorreia/panflute I'm not aware of such a helper function in panflute to create temp-dir. (but you should check first.) But you can submit PR there and I can help merging it. |
HAHA... :-) "Barely maintained", but two answers within less than 24h. Thanks for your swift feedback. |
I created a PR to correct the behaviour. #88 |
As far as I understand the code the function
get_filename4code
is supposed to create a temporary directory to work with files while doing the filtering. Unfortunately there is no suggested function that cleans up the temporary files after filtering. This leads to a lot of pandoc filters to leave directories in the current running pwd that are not really necessary anymore (e.g. mermaid_images, plantuml_images etc.). These files get generated in whatever directory the filter was executed.On top of the clean-function the code should maybe be impemented by using real tempdir-functionality, thereby creating the files in a
temp
-directory of the server. Because based on where you start pandoc and what permissions you have in the current directory the current approach can lead to errors, when the directory can't be created, or worse, dirtying of directories that by chance have the same name.The text was updated successfully, but these errors were encountered: