]> git.ipfire.org Git - thirdparty/qemu.git/commit
sphinx: add qmp_lexer
authorJohn Snow <jsnow@redhat.com>
Wed, 10 Jul 2019 19:08:06 +0000 (15:08 -0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 1 Oct 2019 21:58:28 +0000 (16:58 -0500)
commit22a03c48e7c84b39009dea584a2c67498f9573b7
tree0c7d72bd12124f82c039571131d6398e7da0e58e
parente653d5ed1863a5a5e4f8178d87c33d223f902bf3
sphinx: add qmp_lexer

Sphinx, through Pygments, does not like annotated json examples very
much. In some versions of Sphinx (1.7), it will render the non-json
portions of code blocks in red, but in newer versions (2.0) it will
throw an exception and not highlight the block at all. Though we can
suppress this warning, it doesn't bring back highlighting on non-strict
json blocks.

We can alleviate this by creating a custom lexer for QMP examples that
allows us to properly highlight these examples in a robust way, keeping
our directionality and elision notations.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Reported-by: Aarushi Mehta <mehta.aaru20@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20190603214653.29369-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
(cherry picked from commit cd231e13bdcb8d686b014bef940c7d19c6f1e769)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
docs/conf.py
docs/sphinx/qmp_lexer.py [new file with mode: 0644]