squidfunk/mkdocs-material

Support MkDocs `1.4.0` `hooks:` config option in `mkdocs.yml`

HonkingGoose opened this issue ยท 4 comments

Edit: This "bug" was my own fault for not properly upgrading to MkDocs 1.4.0. Please ignore the bug report. ๐Ÿ˜‰


Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

I know that MkDocs 1.4.0 is really new, so I'm not expecting you to support this new feature right away. ๐Ÿ˜‰

MkDocs 1.4.0 1 has a new hooks: 2 config option. You can use the hooks: option in the mkdocs.yml file. This new feature is not compatible with Material for MkDocs right now.

When I run mkdocs serve it raises this error:

pipenv run mkdocs serve
INFO     -  Building documentation...
WARNING  -  Config value: 'hooks'. Warning: Unrecognised configuration name: hooks
Aborted with 1 Configuration Warnings in 'strict' mode!
make: *** [Makefile:27: serve] Error 1

From the error message it looks like hooks: is not supported yet by Material for MkDocs.

Use Cases

Getting support for hooks: in Material for MkDocs may allow us to drop the mkdocs-simple-hooks dependency.

Screenshots / Mockups

No response

Footnotes

  1. https://github.com/mkdocs/mkdocs/releases/tag/1.4.0 โ†ฉ

  2. https://www.mkdocs.org/user-guide/configuration/#hooks โ†ฉ

Thanks for reporting. Does the warning also appear with another theme than Material for MkDocs? Are you sure that you upgraded to 1.4.0? I'm not sure what the theme would need to support here, as the warnings comes from MkDocs itself.

Yes this doesn't make sense to me. How did you conclude from this error message that it's something about mkdocs-material?
How about pipenv run mkdocs --version - I'd expect it to show that you didn't actually upgrade MkDocs

I've tried reproducing it, to no avail. It's likely that the upgrade to 1.4.0 didn't work. Please make sure MkDocs 1.4.0 is installed. If the error persists and you can clearly pin it to Material for MkDocs, please reopen.

Thank you @oprypin and @squidfunk for looking at my "bug report". โค๏ธ

I messed up the upgrade to the MkDocs 1.4.0 package. That's why hooks: was "broken" for me. ๐Ÿ™ˆ I'm sorry about spending your time on my bad bug report! ๐Ÿ˜ž

I managed to get the new hooks: feature working on the Renovate docs repository now. ๐Ÿ˜‰