Skip to content
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

files structure: move src_paths as a dynamic property, add remove #2305

Merged
merged 3 commits into from Feb 16, 2021

Conversation

ultrabug
Copy link
Member

Plugins wishing to manipulate the Files structure have an append
method but can't dynamically work on src_paths since it's computed
once on Files instanciation

This commits allows plugins to manipulate Files trough append and
remove of file objects while not having to care about the src_paths
since it's now a dynamically computed property

Copy link
Member

@waylan waylan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. However, we should have some tests added. That fact that we are not getting any failing tests with the below noted issue suggest that we need to add some.

Also, a note should be added to the release notes to alert plugin devs to the change in behavior.

mkdocs/structure/files.py Outdated Show resolved Hide resolved
Plugins wishing to manipulate the Files structure have an append
method but can't dynamically work on src_paths since it's computed
once on Files instanciation

This commits allows plugins to manipulate Files trough append and
remove of file objects while not having to care about the src_paths
since it's now a dynamically computed property
@ultrabug
Copy link
Member Author

Thanks @waylan ; tests added

@ultrabug
Copy link
Member Author

Added mention to release notes; hopefully to the right place

Cheers

@waylan waylan merged commit b1f5dae into mkdocs:master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants