From b5c33b7a092835ea3343750cbec3bf09d421a045 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Wed, 4 Jun 2025 22:20:54 +0000 Subject: [PATCH] Docs fixes (#2446) --- docs/options.md | 1 + docs/theme_overrides/js/theme.js | 15 +++++++++++++++ mkdocs.yml | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/options.md b/docs/options.md index 67439176..bf239856 100644 --- a/docs/options.md +++ b/docs/options.md @@ -1791,6 +1791,7 @@ Some options support placeholders, like `{project}`, `{package}` or `{wheel}`, t padding-left: 10px; padding-right: 10px; line-height: normal; + overflow: visible; } .rst-content h3 .badges code.cmd-line:before, .rst-content h3 .badges code.toml:before, .rst-content h3 .badges code.env-var:before { content: ' '; diff --git a/docs/theme_overrides/js/theme.js b/docs/theme_overrides/js/theme.js index 4ccbe61d..f87c9f26 100644 --- a/docs/theme_overrides/js/theme.js +++ b/docs/theme_overrides/js/theme.js @@ -126,6 +126,21 @@ function ThemeNav () { }); link.prepend(expand); }); + + // EDIT by joerick + // + // workaround a bug with the site in safari. safari navigates to the + // anchor before the above code has run, specifically wrap with + // .wy-table-responsive activates css rules that change the size of + // tables, making anchor points move around. + console.log('Document ready, checking for anchor in URL'); + const anchorEl = document.querySelector(window.location.hash); + anchorEl.getBoundingClientRect(); // Force layout to ensure scrollIntoView works correctly + if (anchorEl) { + console.log('Anchor element:', anchorEl); + anchorEl.scrollIntoView({ behavior: 'instant', block: 'start' }); + } + // end edit by joerick }; nav.reset = function () { diff --git a/mkdocs.yml b/mkdocs.yml index b434ca1a..2f38025b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -27,9 +27,9 @@ nav: - faq.md - cpp_standards.md - Reference: - - platforms.md - - configuration.md - options.md + - configuration.md + - platforms.md - working-examples.md - About: - contributing.md