I've not found any useful information how to do it quickly. So here is my way:
- I've found custom pygments lexer which support JSON: pygments-json . I will be part of pygments soon
- It wasn't clear to me how to add custom pygments lexer to sphinx, my google-fu isn't good today
- A bit more googling gave me Sphinx Extensions API , especially add_lexer method of Sphinx instance
Also here is how to add support of ext folder as folder with custom extensions So,
pip install pygments-json
and use
.. code-block:: json
Nice and smooth: