0

I'm one of the maintainers of sqlfluff, and I'd like to replicate similar pattern and anti-pattern examples to the flake8 documentation here: https://www.flake8rules.com/rules/E101.html

At the moment the default styling for code-block sections in rst files doesn't show whitespace as explicit characters, which is normally great - but not very useful if the mixture of whitespace is what you want to show.

Is there a way in rst code-block sections to render whitespace similar to the render whitespace settings in common code editors (similar to this SO question)?

An ideal answer would be to do this natively, but I'm also open to potential options in extending sphinx (although it would be useful to have some pointers on how to do that), or other creative workarounds.

Slipstream
  • 385
  • 3
  • 10
  • _Sphinx_ uses _Pygments_ for syntax highlighting, and it has so-called _filters_ one of them being [VisibleWhitespaceFilter](https://pygments.org/docs/filters/#VisibleWhitespaceFilter) that would most likely do what is needed here. But as far as I know, it's not possible to instruct Sphinx to activate such filters. – sinoroc May 27 '20 at 08:28
  • Maybe this can help with the filter: https://stackoverflow.com/q/11413203/407651 – mzjn May 30 '20 at 16:00

0 Answers0