From 8b2d4a881eed064cc2d9b83682547420381d51c5 Mon Sep 17 00:00:00 2001 From: mostafaei2002 Date: Sat, 18 May 2024 12:32:27 +0330 Subject: [PATCH] fix: fix scroll to headings & remove unnecessary scripts --- docs_theme/main.html | 28 ---------------------------- docs_theme/src/js/main.js | 5 +---- docs_theme/src/scss/styles.scss | 5 +++-- mkdocs.yml | 3 ++- 4 files changed, 6 insertions(+), 35 deletions(-) diff --git a/docs_theme/main.html b/docs_theme/main.html index e1075bb06..a0f4d4067 100644 --- a/docs_theme/main.html +++ b/docs_theme/main.html @@ -198,33 +198,5 @@ {% for path in config.extra_javascript %} {% endfor %} - - diff --git a/docs_theme/src/js/main.js b/docs_theme/src/js/main.js index 855bddd65..fa74d1a15 100644 --- a/docs_theme/src/js/main.js +++ b/docs_theme/src/js/main.js @@ -13,7 +13,4 @@ import "../../node_modules/bootstrap/js/dist/tooltip"; import "../scss/styles.scss"; -const codeBlocks = document.querySelectorAll("pre code"); -codeBlocks.forEach((block) => { - block.parentElement.classList.add(["prettyprint", "well"]); -}); +setupPrettify(); diff --git a/docs_theme/src/scss/styles.scss b/docs_theme/src/scss/styles.scss index 9501d9c15..098eb9ff2 100644 --- a/docs_theme/src/scss/styles.scss +++ b/docs_theme/src/scss/styles.scss @@ -105,7 +105,7 @@ pre code { } .body-content { - padding-top: 120px; + padding-top: 70px; padding-bottom: 70px; } @@ -113,6 +113,7 @@ pre code { display: flex; align-items: center; justify-content: end; + gap: 8px; } .toclink { @@ -153,7 +154,7 @@ pre code { } .prettyprint { - padding: 8px; + padding: 20px; background-color: #f7f7f9; border: 1px solid #e1e1e8; } diff --git a/mkdocs.yml b/mkdocs.yml index 4c8bd67c7..b223b0e87 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,7 +14,8 @@ watch: markdown_extensions: - admonition - toc: - anchorlink: True + # anchorlink: True + permalink: True nav: - Home: 'index.md'