qemu-devel
[Top][All Lists]
Advanced

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

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


From: John Snow
Subject: Re: [Qemu-devel] [PATCH 1/2] sphinx: add qmp_lexer
Date: Wed, 22 May 2019 15:01:50 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


On 5/22/19 4:49 AM, Peter Maydell wrote:
> 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
> 

Copy-paste pulled from another Python script. 2 or later is fine by me;
I can resend if desired (or, I'd be fine with anyone touching it up in
post.)




reply via email to

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