qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 1/2] sphinx: add qmp_lexer


From: Peter Maydell
Subject: Re: [Qemu-block] [PATCH 1/2] sphinx: add qmp_lexer
Date: Wed, 22 May 2019 09:49:27 +0100

On Tue, 21 May 2019 at 21:07, John Snow <address@hidden> wrote:
>
> 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 notations.

> diff --git a/docs/sphinx/qmp_lexer.py b/docs/sphinx/qmp_lexer.py
> new file mode 100644
> index 0000000000..f619f11139
> --- /dev/null
> +++ b/docs/sphinx/qmp_lexer.py
> @@ -0,0 +1,34 @@
> +# QEMU Monitor Protocol Lexer Extension
> +#
> +# Copyright (C) 2019, Red Hat Inc.
> +#
> +# Authors:
> +#  Eduardo Habkost <address@hidden>
> +#  John Snow <address@hidden>
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2.  See
> +# the COPYING file in the top-level directory.

Did you definitely mean 2-only and not 2-or-later ?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]