pycodestyle_magic icon indicating copy to clipboard operation
pycodestyle_magic copied to clipboard

Running flake8 against code in markdown cells

Open psychemedia opened this issue 6 years ago • 1 comments

The flake8-markdown appears to offer support for linting code blocks in markdown files.

It would be useful if this could be applied to code blocks in notebook markdown cells, although I'm not sure how the reports could be displayed given the notebook structure (markdown cells don't have an output?), or how the code could be invoked. (The python-markdown extension might provide a useful crib in this respect?)

One possibility for the report display would be to put it into a dismissible HTML block inserted into the markdown cell just after each code block:

<div class="alert alert-danger alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert">x</button>
Report here...
</div>

psychemedia avatar Sep 24 '19 09:09 psychemedia

This needs a bit more thought before I can implement this. Open for ideas/suggestions/PRs!

mattijn avatar Sep 25 '19 20:09 mattijn