-
Notifications
You must be signed in to change notification settings - Fork 21
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
Search bar missing on notebook pages #519
Comments
It seems other MkDocs plugins using JS code are disabled when used on notebook pages. |
It seems that requirejs (including its latest version) for an unknown reason interferes with A possible and an extremely ugly workaround would be to move also the bundle to load before require (so to the page header). |
Good find, hope we can fix this :) |
I may have found a workaround: instead of including Here is one of the examples of this repo working after using the fix (no more JS errors, search bar is working again): |
I'll close the issue for now as a fix has been merged on master branch. Feel free to reopen the issue if needed. |
Description
When using
mknotebooks
combined with thesearch
plugin, the search bar is either disabled (default theme) or completely missing (mkdocs-material
theme) but only for notebook pages.This behavior can be observed with any of the examples by activating the
search
plugin:Observations
The search bar is enabled at runtime by some JavaScript code provided by the theme: when doing so, the
.no-js
class should be dynamically removed from the top-level HTML tag:For notebook pages, this class is not dynamically removed from the DOM. Trying to remove it by hand (to simulate the behavior) makes the search bar appear but without any JavaScript interaction.
It seems some JS code specific to notebooks is inhibiting the JS code of the theme.
This can be observe in two places:
mkdocs-material
:Digging a bit further, only deactivating this JavaScript include makes the whole search bar system appear and work:
Hypothesis
The inclusion of the
require.js
library seems definitely involved in the culprit.I do not know the root cause of all this but some a report has been make and fixed in
mkdocs-material
: squidfunk/mkdocs-material#2339I will be happy to do some more testing and/or provided some feedback!
The text was updated successfully, but these errors were encountered: