Replies: 1 comment
-
Not possible. MkDocs will only include the text of sections in the search results, filtering any non-text elements (which emojis and icons are). In theory, we could try to patch the search index to allow for HTML embedded into search, but this may yield a lot of new problems. I'll think about it and may try to prototype something in the future, but even if it works, it will probably be experimental for a very long time. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm following a similar approach to the official docs of Material for MkDocs when it comes to "tagging" or "adding attributes" to features by using icon integration (here's an example of what I mean).
In my case, I'm doing something like this:
(the
<div>
is just for styling purposes)I would like to know if there's a way to display the icons in the search results, maybe right-aligned at the same level as the heading, so that those attributes can be distinguished from within the search bar.
A possible implementation could look for icons or
<div>
elements right after a heading, and include those icons in the search result. Maybe even exclude the text of those attributes from the search result itself, so that only the text after the attributes would show (in my case, the feature description).Beta Was this translation helpful? Give feedback.
All reactions