-
Notifications
You must be signed in to change notification settings - Fork 32
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
Merge in upstream changes from mkdocs-material #338
base: main
Are you sure you want to change the base?
Conversation
7b53c8b
to
593856d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
0550769
to
076acb1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I hope you don't mind if I push some commits to your branch. I won't force push anything, so you keep squashing the history as you see fit. |
Yes please go ahead! |
I lied. I screwed up the typing on a commit I didn't run through mypy first... |
This comment was marked as resolved.
This comment was marked as resolved.
I noticed you fixed some lint issues in the search plugin (which I copied unmodified from upstream except for replacing mkdocs with mkdocs_compat) --- unless they are necessary bug fixes it would be better to revert those to make it easier to merge changes in the future. Similarly we can just check for the HTML builder in our own search extension |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Locally, I've been playing with nav_adapt.py to experiment with page icons in the global ToC. It works if I hard-code the icon like so: def get_result(self) -> MkdocsNavEntry:
return MkdocsNavEntry(
title_text=cast(str, self._rendered_title_text),
url=self._url,
children=self._children,
active=False,
current=False,
caption_only=False,
meta={"icon": "material/emoticon-happy"},
is_page=True,
) Where the sphinx-immaterial/src/templates/partials/nav-item.html Lines 44 to 45 in e439e1c
sphinx-immaterial/src/templates/partials/nav-item.html Lines 59 to 60 in e439e1c
But I'm having trouble catching the metadata (field or directive) during the |
The The mkdocs-material theme embeds each svg inline. Potentially we could instead leverage our inline_icon mechanism to avoid duplicating them. Then we could insert them via the |
It would be nice if we could support both, but I understand the bloated HTML concern with upstream's approach. Maybe we should just continue tracking this feature in #56 and table it for now. IIRC, I had a branch that attempted to do the |
To be clear we could support specifying the icon in the metadata, and still use our inline icon implementation for it. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
ab3e22a
to
3748ea9
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
==========================================
+ Coverage 81.46% 81.56% +0.10%
==========================================
Files 68 74 +6
Lines 8675 8892 +217
==========================================
+ Hits 7067 7253 +186
- Misses 1608 1639 +31 ☔ View full report in Codecov by Sentry. |
This replaces the modified Sphinx search implementation with the lunr.js-based search implementation from the upstream mkdocs-material theme.
Maybe there's a more elegant way to approach this, but I'm just hacking this into something passable for CI
and add link to upstream docs
add info to doc and mention the `hide-edit-link` metadata for overriding per page
also resolves #337 by updating the link to upstream's source folder
revert lint fixes to plugins/search/plugin.py Fix spurious exception when another error has occurred.
probably a relic from the merge script rebase
also ran `npm audit fix` which bumped `node_modules/tar` and `tar` in package-lock
add `search-exclude` and `search-boost` metadata fields add test for search metadata
ac71770
to
1f2a86a
Compare
This replaces the modified Sphinx search implementation with the lunr.js-based search implementation from the upstream mkdocs-material theme.
Maintaining the existing custom search was proving to be untenable. Using the upstream search implementation greatly reduces the size of the diff and should make it much easier to incorporate future changes.
The downsides are:
Remaining work before merging this: