Open thdhondt opened 4 weeks ago
Would you be open to a PR that fixes this issue?
Hey, thanks for poking me again and sorry for not responding earlier - the issue was buried in my todo-stack. Sounds like a good improvement and yeah, I would definitely be open to changing that @thdhondt
If you would write a PR yourself that would be wonderful, else I could look into it and code it myself sometime next week, just let me know
Greetings from Austria :)
Sure, I will propose something later this week :).
Hello Jonas,
Currently,
asset_files
is defined as a class attribute:I'm currently working on a use case where I need to build several mkdocs websites consecutively from a script. Each website uses your plugin to get rid of unused files.
Since
asset_files
is a class attribute, its value is common for all instances of theExcludeUnusedFilesPlugin
. In practice, this means that theSet
is not reset in between two consecutive builds. So, the next build complains because it tries to delete files that were already deleted during the previous build.Do you think it would be possible to make
asset_files
an instance attribute instead? According to the mkdocs documentation, the right place to instantiate this variable would be theon_config
callback or__init__
method: https://www.mkdocs.org/dev-guide/plugins/#on_startupFollowing this advise, I think some of the stuff that is currently in
on_startup
might be better suited foron_config
.Thanks for your help
Thomas