jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
534 stars 47 forks source link

Search plugin disabled as of 1.0 #58

Closed squidfunk closed 3 years ago

squidfunk commented 3 years ago

Congrats on the 1.0 release! A minor bug: a user reported that after upgrading to mike 1.0, the search needs to be re-enabled explicitly. That's a deviation from the default MkDocs behavior, which says that search is enabled by default.

This can be seen on the Material for MkDocs versioning example.

  1. 0.1 doesn't have the search plugin enabled
  2. 0.2 has the search plugin enabled again (see https://github.com/squidfunk/mkdocs-material-example-versioning/commit/42bf9dbc534d58c53e10d931349bf4be64d9de62)

Is this intended? I'd say that this is kind of unexpected behavior and might lead to confusion among users.

jimporter commented 3 years ago

Oh yeah. That's because MkDocs expects you to manually add the search plugin to your config if you have any other plugins defined. Strictly speaking, I think this is a bit of a design flaw in MkDocs, but it's something mike should accommodate. Patch forthcoming (once it passes tests).

squidfunk commented 3 years ago

I agree that MkDocs behavior may not appear to make sense, but my guess is that this behavior is in place because originally, the search was part of the core. It was refactored out into a plugin, and to minimize breaking when upgrading I think the idea was to add the plugin back by default. However, given the now rich plugin ecosystem, it's quite annoying to point out at every instance to "re-add the search plugin", so retrospectively, it wasn't a good decision.

Thanks for the quick fix!

jimporter commented 3 years ago

Yeah, I just wish MkDocs would always implicitly include the search plugin, and if you want to specifically exclude it, you pass something like !search to plugins. Given how long it's been this way, I'm not sure it's a good idea to go changing this in MkDocs though...