Repository navigation
Commit 8369197
authored
docs: add sphinx-copybutton and sphinx-codeautolink (#223)
## Summary
Brings SMTB's docs config in line with RTB and MVTB, which both already
have these two extensions:
- `sphinx-copybutton`: adds a copy button to code blocks, stripping
interactive `>>> `/`... `/`$ ` prompts so copied code actually runs.
- `sphinx-codeautolink`: turns code identifiers in examples into links
to their API docs.
Config (extensions list, `suppress_warnings` for codeautolink's own
match warnings, `copybutton_prompt_text`/etc.,
`codeautolink_custom_blocks`/`codeautolink_search_css_classes`) mirrors
RTB's `conf.py` exactly.
Also fixes a small pre-existing formatting wart in `intro.rst`: two `..
code-block:: python` blocks had `:linenos:` indented 3 spaces against
4-space code content. Plain docutils tolerated this silently, but
`sphinx-codeautolink`'s own parsing pass over code blocks is stricter
and surfaced it as a new "unexpected indent" warning -- fixed rather
than left as a regression.
## Test plan
- [x] Real `sphinx-build -b html`, isolated venv, against both master
and this branch
- [x] Warning count identical before/after: 14 warnings both times, same
content1 parent a77c7f0 commit 8369197
3 files changed
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| |||
184 | 193 | | |
185 | 194 | | |
186 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
187 | 214 | | |
188 | 215 | | |
189 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
0 commit comments