-
Notifications
You must be signed in to change notification settings - Fork 2
asset_files
is a class attribute
#6
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
Comments
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. 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 :). |
So, it took a bit more than a week 😁 ... But I finally made the changes. I had to remove a line in the
I am using poetry v1.8.4. While investigating this issue, I realized that there are quite some changes in the Feel free to provide feedback on this topic. |
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 the
Set
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 the
on_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
The text was updated successfully, but these errors were encountered: