Skip to content

Commit 4b13682

Browse files
committed
docs: correct stale comments and the nav type alias
The social plugin is not handled by the scripts under scripts/docs/ — it was dropped (Zensical has no social-card support; the cards were gated on an env var no workflow set). The NavItem alias excluded the {title: url} page shape it mostly holds.
1 parent bb164d1 commit 4b13682

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ venv.bak/
144144
# documentation
145145
/site
146146
/.worktrees/
147-
# Generated at build time by docs/hooks/ (the API reference tree and the
147+
# Generated at build time by scripts/docs/ (the API reference tree and the
148148
# concrete Zensical config spliced from mkdocs.yml).
149149
/docs/api/
150150
/mkdocs.gen.yml

mkdocs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ site_url: https://py.sdk.modelcontextprotocol.io/v2/
1111

1212
# The "API Reference" entry is a placeholder: `scripts/docs/gen_ref_pages.py`
1313
# generates the `docs/api/` tree and `scripts/docs/build_config.py` splices the
14-
# real nested nav in before the build. See `scripts/build-docs.sh`.
14+
# real nested nav in before the build. See `scripts/docs/build.sh`.
1515
nav:
1616
- MCP Python SDK: index.md
1717
- "What's new in v2": whats-new.md
@@ -165,9 +165,11 @@ markdown_extensions:
165165
- sane_lists # this means you can start a list from any number
166166

167167
# Zensical natively re-implements `search`, `glightbox` and `mkdocstrings`; it
168-
# does not run arbitrary MkDocs plugins or hooks, so the former `gen-files`,
169-
# `literate-nav`, `social` and `llms_txt` hook are handled by the standalone
170-
# scripts under `scripts/docs/` invoked around the build (see build-docs.sh).
168+
# does not run arbitrary MkDocs plugins or hooks. The former `gen-files`,
169+
# `literate-nav` and `llms_txt` hook are handled by the standalone scripts
170+
# under `scripts/docs/` (see scripts/docs/build.sh). The `social` plugin was
171+
# dropped: Zensical has no social-card support, and the cards were gated on
172+
# ENABLE_SOCIAL_CARDS, which no workflow ever set.
171173
plugins:
172174
- search
173175
- glightbox

scripts/docs/gen_ref_pages.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
# A MkDocs/Zensical nav is a list of entries, each either ``{title: url}`` for a
1919
# page or ``{title: [children]}`` for a section (a bare ``url`` string attaches
2020
# a section index page, courtesy of the ``navigation.indexes`` feature).
21-
NavItem = "str | dict[str, NavList]"
22-
NavList = "list[NavItem]"
21+
NavItem = "str | dict[str, str | list[NavItem]]"
2322

2423
ROOT = Path(__file__).parent.parent.parent
2524
API_DIR = ROOT / "docs" / "api"
@@ -39,15 +38,15 @@ def to_nav(self, title: str) -> NavItem:
3938
if not self.children:
4039
assert self.url is not None
4140
return {title: self.url}
42-
items: NavList = []
41+
items: list[NavItem] = []
4342
if self.url is not None:
4443
items.append(self.url)
4544
for name in sorted(self.children):
4645
items.append(self.children[name].to_nav(name))
4746
return {title: items}
4847

4948

50-
def generate() -> NavList:
49+
def generate() -> list[NavItem]:
5150
"""Write ``docs/api/**.md`` stubs and return the API-section navigation."""
5251
if API_DIR.exists():
5352
shutil.rmtree(API_DIR)

0 commit comments

Comments
 (0)