]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✨ Set up and enable Material for MkDocs Insiders for the docs (#2325)
authorSebastián Ramírez <tiangolo@gmail.com>
Sun, 8 Nov 2020 11:42:55 +0000 (12:42 +0100)
committerGitHub <noreply@github.com>
Sun, 8 Nov 2020 11:42:55 +0000 (12:42 +0100)
* ⬆️ Upgrade Material for MkDocs

* ⬆️ Install Material for MkDocs Insiders on CI

* 🔧 Update MkDocs configs to use Material for MkDocs Insiders

* ✨ Use the lightbulb because it looks nice 💡

* 💚 Fix GitHub Action workflow syntax for building docs

* 🐛 Fix GitHub Actions workflow syntax, strike one ⚾

13 files changed:
.github/workflows/build-docs.yml
docs/en/mkdocs.yml
docs/es/mkdocs.yml
docs/fr/mkdocs.yml
docs/it/mkdocs.yml
docs/ja/mkdocs.yml
docs/ko/mkdocs.yml
docs/pt/mkdocs.yml
docs/ru/mkdocs.yml
docs/tr/mkdocs.yml
docs/uk/mkdocs.yml
docs/zh/mkdocs.yml
pyproject.toml

index 0afcd5d8b1ee0917009cd12edbe3fe08c64588a4..658686f8b53e9dc88fd1d7388fd99dec526a5935 100644 (file)
@@ -20,6 +20,9 @@ jobs:
         run: python3.7 -m pip install flit
       - name: Install docs extras
         run: python3.7 -m flit install --extras doc
+      - name: Install Material for MkDocs Insiders
+        if: github.repository == 'tiangolo/fastapi'
+        run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
       - name: Build Docs
         run: python3.7 ./scripts/docs.py build-all
       - name: Zip docs
index c3d8ea2b6272ae833e53f5fa3684485cf13a7fd8..2ab06113b0a45e679948719dfd4cc46a61817cf3 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: img/icon-white.svg
index 0f02540b64b0769405dcf60b3625d912149d1c14..11927ded7a0e1ce37ee5447ff35f00ce39300f9d 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/es/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index e76c1b9cee867f04dfadff9cb933821d280e0d22..61ac9dc7c32d86a6c27bad29d75c55c4468e88b2 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/fr/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 5b040ec8063f12f2d4d8ad8703a7b62730aa8734..5a60e6b5030286f8779d35efbf22026f12a7bf01 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/it/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index aa06ed5c9d52af4b3d97f668b75691f7ca56449f..0b66989ec78c05a26db7f8122f93b4cfd4aea694 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/ja/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index ca3d49a7a462cde21e9b7a595714aa78efc96562..3cd1fbee15b90135e56827c2493eb4ef760f3393 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/ko/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 59aeee1d5e885e2d511898c0b70ad65b55a380bb..a1ec90d4b21cdc3447d4d4d19a4943449752f5fe 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/pt/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 49d91c2501ee3f8a10684c8a98c0cd08a9120b67..8572645c661a32eda365cb7fe8f81ce2be90a0c8 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/ru/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 8cca6d6d156a2fc2630508e8155f5713c898b042..72ed61f9907d0e4beaa634d3d50a4a2bea3e30d8 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/tr/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 4d320587a44cc81a511ecf95da634d03e4075d95..355e42826616a4a0c5087f1bea220df162ea38e9 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/uk/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index fa4b13d293aed045d82bd274b234055edf365580..42f6310c765700a59e1fb523cdf1b0bbdabedb66 100644 (file)
@@ -4,9 +4,21 @@ site_url: https://fastapi.tiangolo.com/zh/
 theme:
   name: material
   palette:
-    scheme: preference
+  - scheme: default
     primary: teal
     accent: amber
+    toggle:
+      icon: material/lightbulb-outline
+      name: Switch to light mode
+  - scheme: slate
+    primary: teal
+    accent: amber
+    toggle:
+      icon: material/lightbulb
+      name: Switch to dark mode
+  features:
+  - search.suggest
+  - search.highlight
   icon:
     repo: fontawesome/brands/github-alt
   logo: https://fastapi.tiangolo.com/img/icon-white.svg
index 516b3e855b740bcb5678c6771d0b6d554f4d5533..9315d7e381081bee077748f8336e969a90da5089 100644 (file)
@@ -65,7 +65,7 @@ test = [
 ]
 doc = [
     "mkdocs >=1.1.2,<2.0.0",
-    "mkdocs-material >=5.5.0,<6.0.0",
+    "mkdocs-material >=6.1.4,<7.0.0",
     "markdown-include >=0.5.1,<0.6.0",
     "mkdocs-markdownextradata-plugin >=0.1.7,<0.2.0",
     "typer >=0.3.0,<0.4.0",