From 3f5399b2b4f6f3fb9625d1713a813044ec7deb9b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Tue, 9 Dec 2025 14:23:55 +0000 Subject: [PATCH] Switch to mkdocs material theme --- docs/theme/img/favicon.ico | Bin 0 -> 2238 bytes docs/theme/stylesheets/extra.css | 48 ++++++++++++++++++++ mkdocs.yml | 13 +++++- requirements/requirements-documentation.txt | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 docs/theme/img/favicon.ico create mode 100644 docs/theme/stylesheets/extra.css diff --git a/docs/theme/img/favicon.ico b/docs/theme/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..917892ad576c782eee7ea81d56ef571717046d63 GIT binary patch literal 2238 zcmeH|F%H5o3`HG4f{l%}8My@Oy2O>!u&%R~94h!*QK$bC>7ee?=r7@l#fcx+>i4k$A*se2uP_XRm*FWN62(-5wI0H*6@MgRZ+ literal 0 HcmV?d00001 diff --git a/docs/theme/stylesheets/extra.css b/docs/theme/stylesheets/extra.css new file mode 100644 index 000000000..826828e6b --- /dev/null +++ b/docs/theme/stylesheets/extra.css @@ -0,0 +1,48 @@ +:root > * { + /* primary */ + --md-primary-fg-color: #2c2c2c; + --md-primary-fg-color--light: #a8a8a8; + --md-primary-fg-color--dark: #181818; + /* accent */ + --md-accent-fg-color: #c50d0d; + --md-accent-fg-color--light: #ff8f8f; + --md-accent-fg-color--dark: #A30000; +} + +.md-header { + border-top: 5px solid var(--md-accent-fg-color--dark); +} + +body hr { + border-top: 1px dotted var(--md-accent-fg-color--dark); +} + +/* Cutesy quote styling */ +[dir="ltr"] .md-typeset blockquote { + font-family: Georgia, serif; + font-size: 18px; + font-style: italic; + margin: 0.25em 0; + padding: 0.25em 40px; + line-height: 1.45; + position: relative; + color: #383838; + border-left: none; +} + +[dir="ltr"] .md-typeset blockquote:before { + display: block; + content: "\201C"; + font-size: 80px; + position: absolute; + left: -10px; + top: -20px; + color: #7a7a7a; +} + +[dir="ltr"] .md-typeset blockquote p:last-child { + color: #999999; + font-size: 14px; + display: block; + margin-top: 5px; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index a544be8f4..27cb727ee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,8 +5,17 @@ site_description: Django REST framework - Web APIs for Django repo_url: https://github.com/encode/django-rest-framework theme: - name: mkdocs - custom_dir: docs_theme + name: material + favicon: theme/img/favicon.ico + logo: "" + palette: + primary: custom + accent: custom + features: + - content.code.copy + +extra_css: + - theme/stylesheets/extra.css markdown_extensions: - admonition diff --git a/requirements/requirements-documentation.txt b/requirements/requirements-documentation.txt index 2cf936ef3..c7e07acb3 100644 --- a/requirements/requirements-documentation.txt +++ b/requirements/requirements-documentation.txt @@ -1,5 +1,5 @@ # MkDocs to build our documentation. mkdocs==1.6.0 - +mkdocs-material[imaging]==9.7.0 # pylinkvalidator to check for broken links in documentation. pylinkvalidator==0.3