From db7600052190b106935cd75909aeefa57fe89786 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 22 Sep 2024 22:44:45 -0400 Subject: [PATCH] Use anchorlinks rather than permalinks (#13471) ## Summary See: https://github.com/astral-sh/uv/pull/7626 --- docs/stylesheets/extra.css | 15 +++++++++++++-- mkdocs.template.yml | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index b3c35723d854e..0f5c7734a76fb 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -89,6 +89,7 @@ .md-typeset__table { min-width: 100%; } + .md-typeset table:not([class]) { display: table; } @@ -105,7 +106,17 @@ } /* See: https://mkdocstrings.github.io/recipes/#prevent-selection-of-prompts-and-output-in-python-code-blocks */ -.highlight .gp, .highlight .go { /* Generic.Prompt, Generic.Output */ - user-select: none; +.highlight .gp, +.highlight .go { + /* Generic.Prompt, Generic.Output */ + user-select: none; +} + +/* Styling for anchor link headers */ +.toclink { + color: unset !important; } +.toclink:hover { + color: var(--md-accent-fg-color) !important; +} diff --git a/mkdocs.template.yml b/mkdocs.template.yml index 9262bf046c8e1..a35085c4a34b4 100644 --- a/mkdocs.template.yml +++ b/mkdocs.template.yml @@ -42,7 +42,8 @@ markdown_extensions: - admonition - pymdownx.details - toc: - permalink: "#" + anchorlink: true + anchorlink_class: "toclink" - pymdownx.snippets: - pymdownx.magiclink: - attr_list: