You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ options:
29
29
Following additional parameters can be used:
30
30
31
31
-`-E` / `--skip-errors`
32
+
-`--rst-literal-blocks`
32
33
33
34
`blacken-docs` will format code in the following block types:
34
35
@@ -59,6 +60,8 @@ Following additional parameters can be used:
59
60
print("hello world")
60
61
```
61
62
63
+
This style is enabled with the `--use-sphinx-default` option.
64
+
62
65
(rst `pycon`)
63
66
```rst
64
67
.. code-block:: pycon
@@ -68,6 +71,19 @@ Following additional parameters can be used:
68
71
...
69
72
```
70
73
74
+
(rst literal blocks - activated with ``--rst-literal-blocks``)
75
+
76
+
reStructuredText [literal blocks](https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#literal-blocks) are marked with `::` and can be any monospaced text by default.
77
+
However Sphinx interprets them as Python code [by default](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rst-literal-blocks).
78
+
If your project uses Sphinx and such a configuration, add `--rst-literal-blocks` to also format such blocks.
0 commit comments