keewis / blackdoc

run black on documentation code snippets
https://blackdoc.readthedocs.io
MIT License
47 stars 4 forks source link

format for restructured text (rst) #10

Closed keewis closed 4 years ago

keewis commented 4 years ago

This introduces formatting support for code in rst blocks.

There are still some issues:

keewis commented 4 years ago

this looks good enough for a merge to me, but I'll wait a few days to re-evaluate. Also, I'm skipping cell decorators (since that's kind of difficult to parse) and the indentation level issue (but maybe we could make the depth configurable).

Some experiments for free time: replace the code for extracting ipython prompt code with the ipython module (or whatever the ipython sphinx extension uses).

keewis commented 4 years ago

the cell decorator works, so I guess everything else can be left for new PRs