Skip to content

Commit eb1bf91

Browse files
authored
♻️ Migrate docs to Zensical (#1913)
1 parent e89d6d6 commit eb1bf91

9 files changed

Lines changed: 151 additions & 273 deletions

File tree

data/members.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
members:
22
- login: tiangolo
3+
- login: YuriiMotov
4+
- login: svlandeg
35
- login: alejsdev

docs/contributing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ Go into the docs directory at `docs/`:
100100
$ cd docs/
101101
```
102102

103-
Then run `mkdocs` in that directory:
103+
Then run `zensical` in that directory:
104104

105105
```console
106-
$ mkdocs serve --dev-addr 8008
106+
$ zensical serve --dev-addr 8008
107107
```
108108

109109
///
@@ -129,7 +129,7 @@ Completion will take effect once you restart the terminal.
129129

130130
### Docs Structure
131131

132-
The documentation uses <a href="https://www.mkdocs.org/" class="external-link" target="_blank">MkDocs</a>.
132+
The documentation uses <a href="https://zensical.org" class="external-link" target="_blank">Zensical</a>.
133133

134134
And there are extra tools/scripts in place in `./scripts/docs.py`.
135135

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
---
2+
include_yaml:
3+
sponsors: data/sponsors.yml
4+
---
5+
6+
#
7+
18
<style>
29
.md-content .md-typeset h1 { display: none; }
310
</style>

docs/management.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
include_yaml:
3+
- data/members.yml
4+
---
5+
16
# Repository Management
27

38
Here's a short description of how the SQLModel repository is managed and maintained.
@@ -29,7 +34,7 @@ Joining the team is by invitation only, and I could update or remove permissions
2934
This is the current list of team members. 😎
3035

3136
<div class="user-list user-list-center">
32-
{% for user in members["members"] %}
37+
{% for user in members %}
3338

3439
<div class="user"><a href="https://github.com/{{ user.login }}" target="_blank"><div class="avatar-wrapper"><img src="https://github.com/{{ user.login }}.png"/></div><div class="title">@{{ user.login }}</div></a></div>
3540
{% endfor %}

mkdocs.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_name: SQLModel
33
site_description: SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness.
44
site_url: https://sqlmodel.tiangolo.com/
55
theme:
6+
variant: classic
67
name: material
78
custom_dir: docs/overrides
89
palette:
@@ -48,34 +49,24 @@ theme:
4849
- toc.follow
4950

5051
icon:
51-
repo: fontawesome/brands/github-alt
52+
repo: octicons/mark-github-24
5253
logo: img/icon-white.svg
5354
favicon: img/favicon.png
5455
language: en
5556
repo_name: fastapi/sqlmodel
5657
repo_url: https://github.com/fastapi/sqlmodel
57-
plugins:
58-
# Material for MkDocs
59-
search:
60-
social:
61-
typeset:
62-
# Other plugins
63-
macros:
64-
include_yaml:
65-
- sponsors: data/sponsors.yml
66-
- members: data/members.yml
6758

6859
nav:
6960
- SQLModel: index.md
7061
- features.md
71-
- Learn:
62+
- "":
7263
- learn/index.md
7364
- databases.md
7465
- db-to-code.md
7566
- environment-variables.md
7667
- virtual-environments.md
7768
- install.md
78-
- Tutorial - User Guide:
69+
- "":
7970
- tutorial/index.md
8071
- tutorial/create-db-and-table-with-db-browser.md
8172
- tutorial/create-db-and-table.md
@@ -88,14 +79,14 @@ nav:
8879
- tutorial/limit-and-offset.md
8980
- tutorial/update.md
9081
- tutorial/delete.md
91-
- Connect Tables - JOIN:
82+
- "":
9283
- tutorial/connect/index.md
9384
- tutorial/connect/create-connected-tables.md
9485
- tutorial/connect/create-connected-rows.md
9586
- tutorial/connect/read-connected-data.md
9687
- tutorial/connect/update-data-connections.md
9788
- tutorial/connect/remove-data-connections.md
98-
- Relationship Attributes:
89+
- "":
9990
- tutorial/relationship-attributes/index.md
10091
- tutorial/relationship-attributes/define-relationships-attributes.md
10192
- tutorial/relationship-attributes/create-and-update-relationships.md
@@ -104,14 +95,14 @@ nav:
10495
- tutorial/relationship-attributes/back-populates.md
10596
- tutorial/relationship-attributes/cascade-delete-relationships.md
10697
- tutorial/relationship-attributes/type-annotation-strings.md
107-
- Many to Many:
98+
- "":
10899
- tutorial/many-to-many/index.md
109100
- tutorial/many-to-many/create-models-with-link.md
110101
- tutorial/many-to-many/create-data.md
111102
- tutorial/many-to-many/update-remove-relationships.md
112103
- tutorial/many-to-many/link-with-extra-fields.md
113104
- tutorial/code-structure.md
114-
- FastAPI and Pydantic:
105+
- "":
115106
- tutorial/fastapi/index.md
116107
- tutorial/fastapi/simple-hero-api.md
117108
- tutorial/fastapi/response-model.md
@@ -125,16 +116,16 @@ nav:
125116
- tutorial/fastapi/teams.md
126117
- tutorial/fastapi/relationships.md
127118
- tutorial/fastapi/tests.md
128-
- Advanced User Guide:
119+
- "":
129120
- advanced/index.md
130121
- advanced/decimal.md
131122
- advanced/uuid.md
132-
- Resources:
123+
- "":
133124
- resources/index.md
134125
- help.md
135126
- contributing.md
136127
- management-tasks.md
137-
- About:
128+
- "":
138129
- about/index.md
139130
- alternatives.md
140131
- management.md
@@ -146,6 +137,7 @@ markdown_extensions:
146137
targets:
147138
include:
148139
- "*"
140+
zensical.extensions.macros:
149141
# Python Markdown
150142
abbr:
151143
attr_list:
@@ -194,18 +186,14 @@ markdown_extensions:
194186

195187
extra:
196188
social:
197-
- icon: fontawesome/brands/github-alt
198-
link: https://github.com/fastapi/sqlmodel
199-
- icon: fontawesome/brands/twitter
200-
link: https://twitter.com/tiangolo
201-
- icon: fontawesome/brands/linkedin
202-
link: https://www.linkedin.com/in/tiangolo
203-
- icon: fontawesome/brands/dev
204-
link: https://dev.to/tiangolo
205-
- icon: fontawesome/brands/medium
206-
link: https://medium.com/@tiangolo
207-
- icon: fontawesome/solid/globe
208-
link: https://tiangolo.com
189+
- icon: octicons/mark-github-24
190+
link: https://github.com/fastapi/sqlmodel
191+
- icon: fontawesome/brands/x-twitter
192+
link: https://x.com/tiangolo
193+
- icon: fontawesome/brands/bluesky
194+
link: https://bsky.app/profile/tiangolo.com
195+
- icon: fontawesome/brands/linkedin
196+
link: https://www.linkedin.com/in/tiangolo
209197

210198
extra_css:
211199
- css/termynal.css
@@ -215,5 +203,5 @@ extra_javascript:
215203
- js/termynal.js
216204
- js/custom.js
217205

218-
hooks:
219-
- scripts/mkdocs_hooks.py
206+
validation:
207+
unresolved_references: false

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ docs = [
6161
"griffe-warnings-deprecated >=1.1.0",
6262
"markdown-include-variants >=0.0.8",
6363
"mdx-include >=1.4.1",
64-
"mkdocs-macros-plugin >=1.5.0",
65-
"mkdocs-material >=9.7.5",
66-
"mkdocs-redirects >=1.2.1",
6764
"mkdocstrings[python] >=1.0.3",
6865
"pillow >=12.1.1",
6966
"pyyaml >=5.3.1",
7067
"typer >=0.24.1",
68+
"zensical>=0.0.42",
7169
]
7270
github-actions = [
7371
"httpx >=0.28.1",

scripts/docs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from http.server import HTTPServer, SimpleHTTPRequestHandler
77
from pathlib import Path
88

9-
import mkdocs.utils
109
import typer
10+
import yaml
1111
from jinja2 import Template
1212
from ruff.__main__ import find_ruff_bin
1313

@@ -45,7 +45,7 @@ def generate_readme_content() -> str:
4545
match_start = re.search(r"<!-- sponsors -->", content)
4646
match_end = re.search(r"<!-- /sponsors -->", content)
4747
sponsors_data_path = en_docs_path / "data" / "sponsors.yml"
48-
sponsors = mkdocs.utils.yaml_load(sponsors_data_path.read_text(encoding="utf-8"))
48+
sponsors = yaml.safe_load(sponsors_data_path.read_text(encoding="utf-8"))
4949
if not (match_start and match_end):
5050
raise RuntimeError("Couldn't auto-generate sponsors section")
5151
if not match_pre:
@@ -108,7 +108,7 @@ def live(dirty: bool = False) -> None:
108108
en.
109109
"""
110110
# Enable line numbers during local development to make it easier to highlight
111-
args = ["mkdocs", "serve", "--dev-addr", "127.0.0.1:8008"]
111+
args = ["zensical", "serve", "--dev-addr", "127.0.0.1:8008"]
112112
if dirty:
113113
args.append("--dirty")
114114
subprocess.run(args, env={**os.environ, "LINENUMS": "true"}, check=True)
@@ -120,7 +120,7 @@ def build() -> None:
120120
Build the docs.
121121
"""
122122
print("Building docs")
123-
subprocess.run(["mkdocs", "build"], check=True)
123+
subprocess.run(["zensical", "build"], check=True)
124124
typer.secho("Successfully built docs", color=typer.colors.GREEN)
125125

126126

@@ -129,7 +129,7 @@ def serve() -> None:
129129
"""
130130
A quick server to preview a built site.
131131
132-
For development, prefer the command live (or just mkdocs serve).
132+
For development, prefer the command live (or just zensical serve).
133133
134134
This is here only to preview the documentation site.
135135

scripts/mkdocs_hooks.py

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

0 commit comments

Comments
 (0)