Skip to content

Commit ecaa0e8

Browse files
committed
docs(demo): add badge demo hub and sphinx_pytest_fixtures showcase page
why: Badge rendering varies across themes, zoom levels, and light/dark modes. A dedicated demo page provides a visual reference for all badge permutations to verify rendering correctness during development. what: - Add docs/demo/index.md as demo hub with description and toctree - Add docs/demo/sphinx-pytest-fixtures-badges.md with sections for every badge permutation: plain, scope (session/module/class), kind (factory/override_hook), state (autouse/deprecated), and combinations (session+factory, session+autouse)
1 parent 1c37446 commit ecaa0e8

2 files changed

Lines changed: 132 additions & 0 deletions

File tree

docs/demo/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Visual demo and test pages for libtmux documentation components"
5+
---
6+
7+
(demo-index)=
8+
9+
# Demo
10+
11+
Visual showcases and test pages for documentation components. Useful for
12+
verifying badge rendering, theme compatibility, and extension behaviour.
13+
14+
## Sphinx extensions
15+
16+
- [sphinx\_pytest\_fixtures badges](sphinx-pytest-fixtures-badges.md)
17+
All badge permutations (scope, kind, autouse, deprecated) in both the
18+
fixture index table and individual fixture cards.
19+
20+
```{toctree}
21+
:hidden:
22+
23+
sphinx-pytest-fixtures-badges
24+
```
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# sphinx\_pytest\_fixtures — Badge Demo
2+
3+
Visual reference for all badge permutations. Use this page to verify badge
4+
rendering across themes, zoom levels, and light/dark modes.
5+
6+
Each section documents one badge combination. The index table at the top
7+
gives a compact overview of all permutations at once.
8+
9+
```{py:module} spf_demo_fixtures
10+
```
11+
12+
## Fixture Summary
13+
14+
```{autofixture-index} spf_demo_fixtures
15+
```
16+
17+
---
18+
19+
## Plain (FIXTURE badge only)
20+
21+
Function scope, resource kind, not autouse. Shows only the green FIXTURE badge.
22+
23+
```{eval-rst}
24+
.. autofixture:: spf_demo_fixtures.demo_plain
25+
```
26+
27+
---
28+
29+
## Scope badges
30+
31+
### Session scope
32+
33+
```{eval-rst}
34+
.. autofixture:: spf_demo_fixtures.demo_session
35+
```
36+
37+
### Module scope
38+
39+
```{eval-rst}
40+
.. autofixture:: spf_demo_fixtures.demo_module
41+
```
42+
43+
### Class scope
44+
45+
```{eval-rst}
46+
.. autofixture:: spf_demo_fixtures.demo_class
47+
```
48+
49+
---
50+
51+
## Kind badges
52+
53+
### Factory kind
54+
55+
Return type `type[str]` is auto-detected as factory — no explicit `:kind:` needed.
56+
57+
```{eval-rst}
58+
.. autofixture:: spf_demo_fixtures.demo_factory
59+
```
60+
61+
### Override hook
62+
63+
Requires explicit `:kind: override_hook` since it cannot be inferred from type.
64+
65+
```{eval-rst}
66+
.. autofixture:: spf_demo_fixtures.demo_override_hook
67+
:kind: override_hook
68+
```
69+
70+
---
71+
72+
## State badges
73+
74+
### Autouse
75+
76+
```{eval-rst}
77+
.. autofixture:: spf_demo_fixtures.demo_autouse
78+
```
79+
80+
### Deprecated
81+
82+
The `deprecated` badge is set via the `:deprecated:` RST option on `py:fixture`.
83+
`autofixture` does not support `:deprecated:`; use `py:fixture` instead.
84+
85+
```{eval-rst}
86+
.. py:fixture:: demo_deprecated
87+
:deprecated: 1.0
88+
:replacement: demo_plain
89+
:return-type: str
90+
91+
Return a deprecated value. Use :fixture:`demo_plain` instead.
92+
```
93+
94+
---
95+
96+
## Combinations
97+
98+
### Session + Factory
99+
100+
```{eval-rst}
101+
.. autofixture:: spf_demo_fixtures.demo_session_factory
102+
```
103+
104+
### Session + Autouse
105+
106+
```{eval-rst}
107+
.. autofixture:: spf_demo_fixtures.demo_session_autouse
108+
```

0 commit comments

Comments
 (0)