Skip to content

Keep the prior behavior of overwriting File.page#3381

Merged
oprypin merged 1 commit intomasterfrom
page2
Sep 10, 2023
Merged

Keep the prior behavior of overwriting File.page#3381
oprypin merged 1 commit intomasterfrom
page2

Conversation

@oprypin
Copy link
Copy Markdown

@oprypin oprypin commented Sep 10, 2023

unless the page value is a strict subclass of Page

@squidfunk @ultrabug

unless the page value is a *strict* subclass of Page
@squidfunk
Copy link
Copy Markdown
Contributor

LGTM. So, the regressions that we've seen should be gone, but judging from the code, you decided to issue warnings if a plugin overwrites Page. Are we planning to switch to the behavior proposed in #3367 in MkDocs 1.6?

@oprypin

This comment was marked as abuse.

@squidfunk
Copy link
Copy Markdown
Contributor

squidfunk commented Sep 10, 2023

Thanks, yes, I was asking what the plans for 1.6 were, because the warning is not entirely clear to me:

warnings.warn(
  "A plugin has set File.page to an instance of Page and it got overwritten. "
  "The behavior of this will change in MkDocs 1.6.",
  DeprecationWarning,
)

Will this be an error that terminates the build in MkDocs 1.6?

@oprypin

This comment was marked as abuse.

@squidfunk
Copy link
Copy Markdown
Contributor

Perfect, thanks!

Copy link
Copy Markdown
Member

@ultrabug ultrabug left a comment

Choose a reason for hiding this comment

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

Awesome thanks!

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.

3 participants