blacken-docs icon indicating copy to clipboard operation
blacken-docs copied to clipboard

Run `black` on python code blocks in documentation files

Results 24 blacken-docs issues
Sort by recently updated
recently updated
newest added

Hi, thx for this nice package :rabbit: recently we crossed difficulty, hard to decode where the code issue is (I think that we have some problem in our code sample...

Thanks for this really nice package @asottile . Would you consider accepting added support for snippets of the following form: ```markdown ~~~ def python(): pass ~~~ {: .language-python} ``` It's...

Org mode (via org babel) allows to include python source blocks. The python code can be edited right away in org mode, but it's a bit of pain to call...

I tend to use IPython shell examples rather than the plain Python console, and I'd like blacken-docs to format them, e.g. ```diff .. code-block:: ipython - In [1]: print('Hello World')...

e.g. https://github.com/peterjc/biopython/blob/biopython-175/Doc/Tutorial/chapter_phenotype.tex Reduced to a smaller test case, note the inconsistent indentation of lines 4 and 6 (which LaTeX does not care about): ```latex \begin{description} \item[Well identifier] If you know...

It would be great if blacken-docs would also allow using the `--experimental-string-processing` to split lines in the docstring if they reach the line length limit.

I've not used them much, but LaTeX minted blocks can have optional arguments. My original regex did not consider this. Test and proposed fix attached.

✨ New argument: --check As the name indicates this will merely _check_ if the code would have been re-written. A further change is that the return value of blacken-docs is...

### Python Version 3.11.2 ### Package Version 1.16 ### Description When trying to use blacken-docs with the documentation for one of my packages, blacken-docs is encountering a parsing error. A...