Commit cdd9cd6
committed
sphinx-autodoc-fastmcp(fix[badges]): suppress dotted underline on safety/tool badges
why: The live-demo badges on
<https://gp-sphinx.git-pull.com/packages/sphinx-autodoc-fastmcp/#live-demos>
(and the Gallery page) carried a dotted underline under the label
text that was visually noisy and read as a link affordance. The
decoration is a deliberate default of the `sab-dense` badge variant
in `sphinx-ux-badges`, where `.sab-badge.sab-dense .sab-badge-label`
sets `text-decoration: underline dotted` — explicitly designed to be
overridable via the shipped modifier classes (`sab-no-underline`,
`sab-underline`, `sab-underline-solid`, `sab-underline-dotted`)
which the `SAB` enum already exposes at
`sphinx-ux-badges/_css.py:87-91`. Using the designed escape hatch
lets us keep every other visual property of the dense variant
(compact metrics, 1 px bordered pill, tooltip, icon) while dropping
only the text decoration, and keeps the change local to fastmcp —
pytest-fixtures and api-style don't even use `sab-dense`, so they're
unaffected.
what:
- Compose `SAB.NO_UNDERLINE` alongside `SAB.DENSE` in the four
badge-builder call sites in
`sphinx-autodoc-fastmcp/_badges.py`:
- `build_safety_badge` — `[SAB.DENSE, SAB.NO_UNDERLINE, …]`
- `build_type_tool_badge` — `[SAB.DENSE, SAB.NO_UNDERLINE, …]`
- `build_tool_badge_group` (safety spec) — `(SAB.DENSE, SAB.NO_UNDERLINE, …)`
- `build_tool_badge_group` (type spec) — `(SAB.DENSE, SAB.NO_UNDERLINE, …)`
- Update `test_fastmcp_tool_prototype_snapshot` (the one snapshot
covering the assembled tool-card doctree) to reflect the new class
list — existing `in` assertions in `test_fastmcp.py` still pass
since they don't check class-set equality
- No changes to `sphinx-ux-badges`, no new CSS, no new API — the
override mechanism (`classes` on `build_badge`/`BadgeSpec` + the
`SAB.NO_UNDERLINE` constant) was already public surface
Verified via `just build-docs`: rendered fastmcp badges now carry
`sab-badge sab-dense sab-no-underline …`; pytest-fixtures and
api-style badges remain untouched.1 parent 837532c commit cdd9cd6
2 files changed
Lines changed: 16 additions & 6 deletions
File tree
- packages/sphinx-autodoc-fastmcp/src/sphinx_autodoc_fastmcp
- tests/ext/layout/__snapshots__
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | | - | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
115 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
120 | | - | |
| 130 | + | |
121 | 131 | | |
122 | 132 | | |
123 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
0 commit comments