You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set.
You can use this plugin to create simple hooks for mkdocs without having to create
a separate plugin package.
Just define a function and register it as a hook in the mkdocs.yml. The function shall
have the same API as the desired hook. To see available hooks and their API, see the
events chapter in the mkdocs documentation.
Example
Let's say you want to copy the README.md file to docs/index.md. To do that, create
a new file, e.g.: docs/hooks.py, and put the following function there:
That's all - the copy_readme() function will run every time, before building the documentation.
Disabling the plugin
You can use the enabled option to optionally disable this plugin. A possible use case is local development where you might want faster build times. It's recommended to use this option with an environment variable together with a default fallback (introduced in mkdocs v1.2.1, see docs). Example: