-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for reStructuredText literal blocks #196
Add support for reStructuredText literal blocks #196
Conversation
cc6ed57
to
b94ac57
Compare
Okay picking this up, let’s do it. I’ve rebased the PR on top of recent CI changes. I renamed the flag to I then tried runnign the updated version against Django by adding my local repo to pre-commit: - repo: /Users/chainz/Documents/Projects/blacken-docs
rev: baebf4ad8463b71ad8a2781486858ee24d665c3b
hooks:
- id: blacken-docs
files: '\.txt$'
args: [--rst-literal-blocks] I noticed many failures from directives like Would you like to review this and also try it out again on Django before we merge? or @jvzammit? |
I just fixed a crash case seen on Django docs, for empty literal blocks, like in
There are a whole bunch of code parse errors to fix up, even on the branch of django/django#16261 . But from a random sampling none seem to be problems with the regex now. |
9c1674f
to
f0bc021
Compare
We have another failing test case - literal blocks inside code blocks:
Since this is probably rare enough in practice, I'm gonna make that a separate issue. I'm doing some other work to “standardize” this repo so I'll merge this now and release in a bit. We can refine it later if needed, it is at least behind a flag. |
This is initial sketch to fix #195. It adds processing for Sphinx' default language blocks, marked with paragraphs ending
::
, which is common to all Sphinx projects using the defaults there (i.e.sphinx-quickstart
generated).Opening early for input, and to let us experiment on the Django docs.