Skip to content

Commit c062aba

Browse files
authored
Fix link to Sphinx code block directives (#23041)
Summary -- I noticed this while reviewing #22990. I'm not really sure why the current version doesn't work, but the new one definitely does. Test Plan -- [Before](https://docs.astral.sh/ruff/formatter/#docstring-formatting): <img width="457" height="77" alt="image" src="https://github.com/user-attachments/assets/3d4394b7-eadf-41ec-81c9-cea6190fa0bb" /> After: <img width="493" height="84" alt="image" src="https://github.com/user-attachments/assets/66f0700c-9312-40b9-b3ae-11edcaec7562" />
1 parent 4a32a96 commit c062aba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/formatter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ assumed to be Python code examples and also formatted.
147147
* reStructuredText [literal blocks]. While literal blocks may contain things
148148
other than Python, this is meant to reflect a long-standing convention in the
149149
Python ecosystem where literal blocks often contain Python code.
150-
* reStructuredText [`code-block` and `sourcecode` directives]. As with
150+
* reStructuredText [`code-block` and `sourcecode` directives][directives]. As with
151151
Markdown, the language names recognized for Python are `python`, `py`,
152152
`python3`, or `py3`.
153153

@@ -223,7 +223,7 @@ def f(x):
223223
[doctest]: https://docs.python.org/3/library/doctest.html
224224
[fenced code blocks]: https://spec.commonmark.org/0.30/#fenced-code-blocks
225225
[literal blocks]: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#literal-blocks
226-
[`code-block` and `sourcecode` directives]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block
226+
[directives]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block
227227

228228
## Format suppression
229229

0 commit comments

Comments
 (0)