Commit 75136b9
authored
feat(pytest-plugin): Add doc-pytest-plugin directive (#8)
Adds a higher-level `doc-pytest-plugin` directive to
`sphinx-autodoc-pytest-fixtures` for building standard pytest plugin
documentation pages. The directive generates a consistent frame —
install block, `pytest11` autodiscovery note, fixture summary and
reference — owned in one place so the prose propagates to every
downstream build automatically.
- **New directive** `doc-pytest-plugin`: required `:package:`,
optional `:project:`, `:summary:`, `:tests-url:`, and
`:install-command:`. Body content is free-form (sections,
prose, code blocks); the frame is opinionated. Use the manual
`autofixture-index` + `autofixtures` recipe when custom layout
or section ordering is needed ("power path").
- **Removed** `:mode:` — `reference` mode duplicated the manual
recipe, undermining the abstraction.
- **Relaxed** `:summary:` and `:project:` to optional. Missing
`:summary:` suppresses the intro paragraph (no empty `<p>`).
Missing `:project:` falls back to generic "test suite" link
text; the package-slug default was a deliberate non-option.
- **Fixed** `NameError` crash in `_build_fixture_section_nodes`:
`_build_doc_pytest_plugin_index_node` had been removed but its
call site was not updated, crashing every docs build.
- **Fixed** `sphinx-build -W` docs warnings: replaced
`_is_markdown_source` (file-extension check) with
`_is_native_myst` (`isinstance(state, MockState)`) so directives
inside `{eval-rst}` blocks are not wrapped in a backtick fence
before being passed to RST's `nested_parse`.
- **Added** `:no-index:` flag to `autofixtures::` for pages that
describe the same module in multiple sections.
- **Tests**: coverage for generic `:project:` link text, optional
`:summary:`, and hard failure on missing `:package:`.
- **Docs**: "When to use" and "Manual recipe" sections added.File tree
6 files changed
+641
-78
lines changed- docs/packages
- packages/sphinx-autodoc-pytest-fixtures
- src/sphinx_autodoc_pytest_fixtures
- tests/ext/pytest_fixtures
6 files changed
+641
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
52 | 86 | | |
| 87 | + | |
53 | 88 | | |
54 | 89 | | |
55 | 90 | | |
56 | 91 | | |
57 | 92 | | |
58 | 93 | | |
59 | 94 | | |
| 95 | + | |
60 | 96 | | |
61 | 97 | | |
62 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| |||
0 commit comments