-
Notifications
You must be signed in to change notification settings - Fork 862
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
Support direct navigation to individual items in def_list #1123
Comments
Have you tried using the attr_list extension, which allows you to define your own IDs on elements? That said, autogenerated IDs would be a reasonable feature of the def_list extension, perhaps as an optional feature which is enabled by a config option. A PR adding such a feature would certainly be considered. |
Here is an example using the attr_list extension:
which generates the following HTML: <dl>
<dt id="foo">foo</dt>
<dd>bar</dd>
<dt id="key">key</dt>
<dd>value</dd>
</dl> |
True, that is an acceptable workaround. If def_list supported a configuration option to automatically create those, it would save a lot of fat-fingering. |
I do not think that this fully works correctly because I do not see the link acting when I hover of the the definitions lists. I checked and the anchors are created, so you could use them for referencing but users cannot copy a bookmark due to lack of hover option (like we have on headings). This impacts the UX, as nobody will know how to share a link to a specific definition list entry. Looking at the source of headers, I see
While the DL entries have the expected Did anyone managed to implement a full solution for this? |
@ssbarnea this issue is tagged as 'someday-maybe' which suggests that it is a low priority item which is not going to get any attention by the core developers. If someone would like a full solution, then they will need to do the work and submit a PR, which we will be happy to review. |
In a knowledge base with many terms, using the Definition list extension as-is requires use of text search or simply scrolling. This is because there is no way to easily navigate to a specific Definition List item. If an
id
attribute were generated as it is for headings, users would be able to create links to the specific item in the body of the page.I have posted a similar request as #2495 in the squidfunk/mkdocs-material repo.
The text was updated successfully, but these errors were encountered: