From d27bdda769ce9ba9bf00385af5614d501faf083e Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 20 Dec 2023 09:59:03 -0500 Subject: [PATCH] fix(docs): fixed external link rendering --- .gitignore | 1 + docs/css/external.css | 13 +++++++++++++ docs/css/material.css | 27 --------------------------- mkdocs.yml | 2 +- 4 files changed, 15 insertions(+), 28 deletions(-) create mode 100644 docs/css/external.css delete mode 100644 docs/css/material.css diff --git a/.gitignore b/.gitignore index bee8a64..b322e0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +.cache diff --git a/docs/css/external.css b/docs/css/external.css new file mode 100644 index 0000000..84299b3 --- /dev/null +++ b/docs/css/external.css @@ -0,0 +1,13 @@ +:root { + --external-link-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Clink xmlns='' type='text/css' rel='stylesheet' id='dark-mode-custom-link'/%3E%3Clink xmlns='' type='text/css' rel='stylesheet' id='dark-mode-general-link'/%3E%3Cstyle xmlns='' lang='en' type='text/css' id='dark-mode-custom-style'/%3E%3Cstyle xmlns='' lang='en' type='text/css' id='dark-mode-native-style'/%3E%3Cpath d='M432 320h-32a16 16 0 0 0-16 16v112H64V128h144a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16H48a48 48 0 0 0-48 48v352a48 48 0 0 0 48 48h352a48 48 0 0 0 48-48V336a16 16 0 0 0-16-16zM488 0H360c-21.37 0-32.05 25.91-17 41l35.73 35.73L135 320.37a24 24 0 0 0 0 34L157.67 377a24 24 0 0 0 34 0l243.61-243.68L471 169c15 15 41 4.5 41-17V24a24 24 0 0 0-24-24z'/%3E%3C/svg%3E"); +} + +a[href^="http" ]:not(.md-button, [data-sub-html], .md-footer-social__link, .md-source, .md-search-result__link, .md-logo, .md-version__link, [href*="config.discordsrv.com"], [href*="squidfunk.github.io"], [href*="Documentation/edit"]):after { + background: transparent var(--external-link-icon) 0 0 no-repeat; + content: ""; + display: inline-block; + height: 12px; + margin-left: 3px; + width: 12px; + filter: invert(1); +} diff --git a/docs/css/material.css b/docs/css/material.css deleted file mode 100644 index 8ed38ad..0000000 --- a/docs/css/material.css +++ /dev/null @@ -1,27 +0,0 @@ -/* Indentation. */ -div.doc-contents:not(.first) { - padding-left: 25px; - border-left: .05rem solid var(--md-typeset-table-color); - } - - /* Mark external links as such. */ - a.external::after, - a.autorefs-external::after { - /* https://primer.style/octicons/arrow-up-right-24 */ - mask-image: url('data:image/svg+xml,'); - -webkit-mask-image: url('data:image/svg+xml,'); - content: ' '; - - display: inline-block; - vertical-align: middle; - position: relative; - - height: 1em; - width: 1em; - background-color: var(--md-typeset-a-color); - } - - a.external:hover::after, - a.autorefs-external:hover::after { - background-color: var(--md-accent-fg-color); - } diff --git a/mkdocs.yml b/mkdocs.yml index 1b6fd14..57254c8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,7 +25,7 @@ plugins: # paths: [pyzipline] extra_css: - - css/material.css + - css/external.css theme: name: material