Skip to content

Commit 5dcc39c

Browse files
committed
🔧 Upgrade Material for MkDocs and remove insiders
1 parent e4763e3 commit 5dcc39c

File tree

8 files changed

+11
-37
lines changed

8 files changed

+11
-37
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,9 @@ jobs:
3333
- docs/**
3434
- docs_src/**
3535
- requirements-docs.txt
36-
- requirements-docs-insiders.txt
3736
- pyproject.toml
3837
- mkdocs.yml
39-
- mkdocs.insiders.yml
40-
- mkdocs.maybe-insiders.yml
41-
- mkdocs.no-insiders.yml
38+
- mkdocs.env.yml
4239
- .github/workflows/build-docs.yml
4340
- .github/workflows/deploy-docs.yml
4441
- data/**
@@ -68,11 +65,6 @@ jobs:
6865
pyproject.toml
6966
- name: Install docs extras
7067
run: uv pip install -r requirements-docs.txt
71-
- name: Install Material for MkDocs Insiders
72-
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
73-
run: uv pip install -r requirements-docs-insiders.txt
74-
env:
75-
TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
7668
- uses: actions/cache@v4
7769
with:
7870
key: mkdocs-cards-${{ github.ref }}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Define this here and not in the main mkdocs.yml file because that one could be auto
22
# updated and written, and the script would remove the env var
3-
INHERIT: !ENV [INSIDERS_FILE, './mkdocs.no-insiders.yml']
43
markdown_extensions:
54
pymdownx.highlight:
65
linenums: !ENV [LINENUMS, false]

mkdocs.insiders.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

mkdocs.no-insiders.yml

Whitespace-only changes.

mkdocs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
INHERIT: ./mkdocs.maybe-insiders.yml
1+
INHERIT: ./mkdocs.env.yml
22
site_name: SQLModel
33
site_description: SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
44
site_url: https://sqlmodel.tiangolo.com/
@@ -58,6 +58,7 @@ plugins:
5858
# Material for MkDocs
5959
search:
6060
social:
61+
typeset:
6162
# Other plugins
6263
macros:
6364
include_yaml:
@@ -140,6 +141,11 @@ nav:
140141
- release-notes.md
141142

142143
markdown_extensions:
144+
# Material for MkDocs
145+
material.extensions.preview:
146+
targets:
147+
include:
148+
- "*"
143149
# Python Markdown
144150
abbr:
145151
attr_list:

requirements-docs-insiders.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-docs.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ pyyaml >=5.3.1,<7.0.0
1010
pillow==11.3.0
1111
# For image processing by Material for MkDocs
1212
cairosvg==2.8.2
13-
# mkdocstrings[python]==0.25.1
13+
mkdocstrings[python]==0.30.1
1414
griffe-typingdoc==0.3.0
15+
griffe-warnings-deprecated==1.1.0
1516
# For griffe, it formats with black
1617
typer == 0.20.0
1718
mkdocs-macros-plugin==1.5.0

scripts/docs.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import os
33
import re
44
import subprocess
5-
from functools import lru_cache
65
from http.server import HTTPServer, SimpleHTTPRequestHandler
7-
from importlib import metadata
86
from pathlib import Path
97

108
import mkdocs.utils
@@ -19,17 +17,9 @@
1917
app = typer.Typer()
2018

2119

22-
@lru_cache
23-
def is_mkdocs_insiders() -> bool:
24-
version = metadata.version("mkdocs-material")
25-
return "insiders" in version
26-
27-
2820
@app.callback()
2921
def callback() -> None:
30-
if is_mkdocs_insiders():
31-
os.environ["INSIDERS_FILE"] = "./mkdocs.insiders.yml"
32-
# For MacOS with insiders and Cairo
22+
# For MacOS with Cairo
3323
os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib"
3424

3525

@@ -126,10 +116,6 @@ def build() -> None:
126116
"""
127117
Build the docs.
128118
"""
129-
insiders_env_file = os.environ.get("INSIDERS_FILE")
130-
print(f"Insiders file {insiders_env_file}")
131-
if is_mkdocs_insiders():
132-
print("Using insiders")
133119
print("Building docs")
134120
subprocess.run(["mkdocs", "build"], check=True)
135121
typer.secho("Successfully built docs", color=typer.colors.GREEN)

0 commit comments

Comments
 (0)