- docs/**
- docs_src/**
- requirements-docs.txt
- - requirements-docs-insiders.txt
- pyproject.toml
- mkdocs.yml
- - mkdocs.insiders.yml
- - mkdocs.maybe-insiders.yml
- - mkdocs.no-insiders.yml
+ - mkdocs.env.yml
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
- data/**
pyproject.toml
- name: Install docs extras
run: uv pip install -r requirements-docs.txt
- - name: Install Material for MkDocs Insiders
- if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' )
- run: uv pip install -r requirements-docs-insiders.txt
- env:
- TOKEN: ${{ secrets.SQLMODEL_MKDOCS_MATERIAL_INSIDERS }}
- uses: actions/cache@v4
with:
key: mkdocs-cards-${{ github.ref }}
# Define this here and not in the main mkdocs.yml file because that one could be auto
# updated and written, and the script would remove the env var
-INHERIT: !ENV [INSIDERS_FILE, './mkdocs.no-insiders.yml']
markdown_extensions:
pymdownx.highlight:
linenums: !ENV [LINENUMS, false]
+++ /dev/null
-plugins:
- typeset:
-markdown_extensions:
- material.extensions.preview:
- targets:
- include:
- - "*"
-INHERIT: ./mkdocs.maybe-insiders.yml
+INHERIT: ./mkdocs.env.yml
site_name: SQLModel
site_description: SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
site_url: https://sqlmodel.tiangolo.com/
# Material for MkDocs
search:
social:
+ typeset:
# Other plugins
macros:
include_yaml:
- release-notes.md
markdown_extensions:
+ # Material for MkDocs
+ material.extensions.preview:
+ targets:
+ include:
+ - "*"
# Python Markdown
abbr:
attr_list:
+++ /dev/null
-git+https://${TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git@9.5.30-insiders-4.53.11
-git+https://${TOKEN}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
-git+https://${TOKEN}@github.com/pawamoy-insiders/mkdocstrings-python.git
pillow==11.3.0
# For image processing by Material for MkDocs
cairosvg==2.8.2
-# mkdocstrings[python]==0.25.1
+mkdocstrings[python]==0.30.1
griffe-typingdoc==0.3.0
+griffe-warnings-deprecated==1.1.0
# For griffe, it formats with black
typer == 0.20.0
mkdocs-macros-plugin==1.5.0
import os
import re
import subprocess
-from functools import lru_cache
from http.server import HTTPServer, SimpleHTTPRequestHandler
-from importlib import metadata
from pathlib import Path
import mkdocs.utils
app = typer.Typer()
-@lru_cache
-def is_mkdocs_insiders() -> bool:
- version = metadata.version("mkdocs-material")
- return "insiders" in version
-
-
@app.callback()
def callback() -> None:
- if is_mkdocs_insiders():
- os.environ["INSIDERS_FILE"] = "./mkdocs.insiders.yml"
- # For MacOS with insiders and Cairo
+ # For MacOS with Cairo
os.environ["DYLD_FALLBACK_LIBRARY_PATH"] = "/opt/homebrew/lib"
"""
Build the docs.
"""
- insiders_env_file = os.environ.get("INSIDERS_FILE")
- print(f"Insiders file {insiders_env_file}")
- if is_mkdocs_insiders():
- print("Using insiders")
print("Building docs")
subprocess.run(["mkdocs", "build"], check=True)
typer.secho("Successfully built docs", color=typer.colors.GREEN)