Skip to content

Commit a0977e2

Browse files
committed
docs(fix[gallery]): resolve 9 directive errors and 3 duplicate-module warnings
why: Someone sprinkled `:noindex:` across `docs/gallery.md` hoping to silence `duplicate object description of gp_demo_api | spf_demo_fixtures | api_demo_layout` warnings, but the duplicates actually originate in three `{py:module}` MyST blocks — while the `:noindex:` option was being applied to seven custom `SphinxDirective` subclasses that either do not register any domain object (six of them) or only accept the modern dashed form `:no-index:` (one of them, `autoconfigvalues`, which already declares it in `option_spec`). The result: 9 "maximum 1 argument supplied" / "unknown option" / "no content permitted" errors per build, plus the original 3 dup warnings untouched. Sphinx 5+ canonicalized the dashed spelling; only `ObjectDescription` subclasses honour the legacy alias (`sphinx/directives/__init__.py:226–237`). what: - Add `:no-index:` to the three `{py:module}` MyST blocks (gp_demo_api, api_demo_layout, spf_demo_fixtures) — these are the real source of the duplicate warnings; the per-package detail pages remain the canonical registration - Drop meaningless `:noindex:` from six pure-render directives (`fastmcp-tool` ×3, `fastmcp-tool-input`, `fastmcp-tool-summary`, `autoconfigvalue-index`, `autodirective-index`, `autorole-index`) — each emits only sections/tables with no domain registration, so the flag was a no-op that currently errors out - Fix the one spelling mistake: `autoconfigvalues :noindex:` → `:no-index:` (the directive already declares `option_spec = {"no-index": directives.flag}` and registers `py:data` objects, so the dashed form is what it expects) - No source changes to any custom directive: six of the seven register no domain objects, so adding an empty `option_spec` solely to swallow `:no-index:` would silently mask user mistakes instead of surfacing them - Build now `build succeeded.` with zero warnings (was `build succeeded, 12 warnings`)
1 parent 0235780 commit a0977e2

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

docs/gallery.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Badges, type hints, and card layout working together on standard Python domain
1414
directives.
1515

1616
```{py:module} gp_demo_api
17+
:no-index:
1718
```
1819

1920
### Functions
@@ -73,6 +74,7 @@ Large parameter lists fold automatically. The class below has 13 parameters
7374
disclosure widget.
7475

7576
```{py:module} api_demo_layout
77+
:no-index:
7678
```
7779

7880
### Class with members (regions + fold)
@@ -108,34 +110,30 @@ Tool documentation with safety badges and parameter tables.
108110

109111
```{eval-rst}
110112
.. fastmcp-tool:: fastmcp_demo_tools.list_sessions
111-
:noindex:
112113
113114
.. fastmcp-tool:: fastmcp_demo_tools.create_session
114-
:noindex:
115115
116116
.. fastmcp-tool:: fastmcp_demo_tools.delete_session
117-
:noindex:
118117
```
119118

120119
### Parameter table
121120

122121
```{eval-rst}
123122
.. fastmcp-tool-input:: fastmcp_demo_tools.create_session
124-
:noindex:
125123
```
126124

127125
### Tool summary
128126

129127
```{eval-rst}
130128
.. fastmcp-tool-summary::
131-
:noindex:
132129
```
133130

134131
---
135132

136133
## pytest fixtures
137134

138135
```{py:module} spf_demo_fixtures
136+
:no-index:
139137
```
140138

141139
### Fixture index
@@ -156,12 +154,11 @@ Tool documentation with safety badges and parameter tables.
156154

157155
```{eval-rst}
158156
.. autoconfigvalue-index:: sphinx_config_demo
159-
:noindex:
160157
```
161158

162159
```{eval-rst}
163160
.. autoconfigvalues:: sphinx_config_demo
164-
:noindex:
161+
:no-index:
165162
```
166163

167164
---
@@ -172,7 +169,6 @@ Tool documentation with safety badges and parameter tables.
172169

173170
```{eval-rst}
174171
.. autodirective-index:: docutils_demo
175-
:noindex:
176172
```
177173

178174
```{eval-rst}
@@ -184,7 +180,6 @@ Tool documentation with safety badges and parameter tables.
184180

185181
```{eval-rst}
186182
.. autorole-index:: docutils_demo
187-
:noindex:
188183
```
189184

190185
```{eval-rst}

0 commit comments

Comments
 (0)