Skip to content

Add support for notebook style code #240

@znicholls

Description

@znicholls

Description

Firstly thanks for such an awesome tool.

In my repository, I wrote jupyter notebooks, which I then save to markdown files using jupytext. I would like to run black over these files. blacken-docs is almost perfect for this, but it just needs support for this style of code block.

I've put an implementation here #239, I needed to do two things:

  1. add a parser for this style of code block
  2. handle the fact the code blocks come out of jupyter notebooks (which fortunately is simple because black can already handle these)

As part of #239, I also added a 'check' functionality.

It would be great to get feedback on:

  1. whether adding this new parser is something you would support (I'm happy to maintain it)
  2. whether the 'check' functionality is of interest

Assuming that the answer to either or both of the above is yes, I will make a new PR for them (also separating them so that the two changes don't end up being coupled).

This is sort of related to #127 I think

Thanks again for your efforts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions