-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Handle Python code in docs (ReST, markdown etc) #294
Comments
hah, I had the same idea: #292 |
Heh.. What I had in mind would be that black could be just run on documentation files, and would handle all code blocks in there. Let's wait for some feedback from maintainer(s). |
Sounds interesting, it would require a lot more dependencies to be added to Black though to enable parsing Markdown, ReST, and so on. I'll leave this open as I am not opposed to the idea. However, there are more urgent things we need to implement/fix before we can think about this. |
I'm going to take a stab at implementing this in a separate project, maybe at some point it could be merged back into core |
It lives! https://github.com/asottile/blacken-docs Here's an example PR of what it can do: pytest-dev/pytest#3528 |
Hi friends, I made a terrific (terrible? terrifying?) thing. I needed one manual `,` addition to the `setup.py` example so it could be parsed -- otherwise this is fully automated! Using the new thing I made today: https://github.com/asottile/blacken-docs Heavily inspired by pytest-dev/pytest#3525. See also psf/black#292, psf/black#294.
Thank you! Given the existence of tools like https://github.com/adamchainz/blacken-docs and https://github.com/hukkin/mdformat-black, I don't think we should include this in Black proper. The long tail of formats is best dealt with by the ecosystem and we should do things like #779 to help support the ecosystem build on Black. |
It would be nice if black would also handle Python code blocks in documentation files (reStructuredText, markdown etc).
(via pytest-dev/pytest#3525 (comment))
The text was updated successfully, but these errors were encountered: