diff mbox series

[v2,07/30] qapi/block-core.json: Use literal block for ascii art

Message ID 20200213175647.17628-8-peter.maydell@linaro.org
State Superseded
Headers show
Series Convert QAPI doc comments to generate rST instead of texinfo | expand

Commit Message

Peter Maydell Feb. 13, 2020, 5:56 p.m. UTC
The ascii-art graph in the BlockLatencyHistogramInfo documentation
doesn't render correctly, because the whitespace is collapsed.

Use the '|' format that emits a literal 'example' block so the graph
is displayed correctly.

Strictly the texinfo generated is still wrong because each line
goes into its own @example environment, but it renders better
than what we had before.

Fixing this rendering is a necessary prerequisite for the rST
generator, which otherwise complains about the inconsistent
indentation in the ascii-art graph.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
v1->v2: tweaked commit message, made graph still line up
with preceding paragraph text
---
 qapi/block-core.json | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

-- 
2.20.1

Comments

Aleksandar Markovic Feb. 13, 2020, 10:59 p.m. UTC | #1
6:59 PM Čet, 13.02.2020. Peter Maydell <peter.maydell@linaro.org> је
написао/ла:
>

> The ascii-art graph


Just out of couriousity, are unicode characters allowed in rst files?

The boxes could've been rendered in a much more beautifull way using "lines
and corners" group of unicode characters.

Aleksandar

> in the BlockLatencyHistogramInfo documentation

> doesn't render correctly, because the whitespace is collapsed.

>

> Use the '|' format that emits a literal 'example' block so the graph

> is displayed correctly.

>

> Strictly the texinfo generated is still wrong because each line

> goes into its own @example environment, but it renders better

> than what we had before.

>

> Fixing this rendering is a necessary prerequisite for the rST

> generator, which otherwise complains about the inconsistent

> indentation in the ascii-art graph.

>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---

> v1->v2: tweaked commit message, made graph still line up

> with preceding paragraph text

> ---

>  qapi/block-core.json | 14 +++++++-------

>  1 file changed, 7 insertions(+), 7 deletions(-)

>

> diff --git a/qapi/block-core.json b/qapi/block-core.json

> index ef94a296868..db9ca688d49 100644

> --- a/qapi/block-core.json

> +++ b/qapi/block-core.json

> @@ -550,13 +550,13 @@

>  #        For the example above, @bins may be something like [3, 1, 5, 2],

>  #        and corresponding histogram looks like:

>  #

> -#        5|           *

> -#        4|           *

> -#        3| *         *

> -#        2| *         *    *

> -#        1| *    *    *    *

> -#         +------------------

> -#             10   50   100

> +# |      5|           *

> +# |      4|           *

> +# |      3| *         *

> +# |      2| *         *    *

> +# |      1| *    *    *    *

> +# |       +------------------

> +# |           10   50   100

>  #

>  # Since: 4.0

>  ##

> --

> 2.20.1

>

>
<p dir="ltr"></p>
<p dir="ltr">6:59 PM Čet, 13.02.2020. Peter Maydell &lt;<a href="mailto:peter.maydell@linaro.org">peter.maydell@linaro.org</a>&gt; је написао/ла:<br>
&gt;<br>
&gt; The ascii-art graph</p>
<p dir="ltr">Just out of couriousity, are unicode characters allowed in rst files?</p>
<p dir="ltr">The boxes could&#39;ve been rendered in a much more beautifull way using &quot;lines and corners&quot; group of unicode characters.</p>
<p dir="ltr">Aleksandar</p>
<p dir="ltr">&gt; in the BlockLatencyHistogramInfo documentation<br>
&gt; doesn&#39;t render correctly, because the whitespace is collapsed.<br>
&gt;<br>
&gt; Use the &#39;|&#39; format that emits a literal &#39;example&#39; block so the graph<br>
&gt; is displayed correctly.<br>
&gt;<br>
&gt; Strictly the texinfo generated is still wrong because each line<br>
&gt; goes into its own @example environment, but it renders better<br>
&gt; than what we had before.<br>
&gt;<br>
&gt; Fixing this rendering is a necessary prerequisite for the rST<br>
&gt; generator, which otherwise complains about the inconsistent<br>
&gt; indentation in the ascii-art graph.<br>
&gt;<br>
&gt; Signed-off-by: Peter Maydell &lt;<a href="mailto:peter.maydell@linaro.org">peter.maydell@linaro.org</a>&gt;<br>
&gt; ---<br>
&gt; v1-&gt;v2: tweaked commit message, made graph still line up<br>
&gt; with preceding paragraph text<br>
&gt; ---<br>
&gt;  qapi/block-core.json | 14 +++++++-------<br>
&gt;  1 file changed, 7 insertions(+), 7 deletions(-)<br>
&gt;<br>
&gt; diff --git a/qapi/block-core.json b/qapi/block-core.json<br>
&gt; index ef94a296868..db9ca688d49 100644<br>
&gt; --- a/qapi/block-core.json<br>
&gt; +++ b/qapi/block-core.json<br>
&gt; @@ -550,13 +550,13 @@<br>
&gt;  #        For the example above, @bins may be something like [3, 1, 5, 2],<br>
&gt;  #        and corresponding histogram looks like:<br>
&gt;  #<br>
&gt; -#        5|           *<br>
&gt; -#        4|           *<br>
&gt; -#        3| *         *<br>
&gt; -#        2| *         *    *<br>
&gt; -#        1| *    *    *    *<br>
&gt; -#         +------------------<br>
&gt; -#             10   50   100<br>
&gt; +# |      5|           *<br>
&gt; +# |      4|           *<br>
&gt; +# |      3| *         *<br>
&gt; +# |      2| *         *    *<br>
&gt; +# |      1| *    *    *    *<br>
&gt; +# |       +------------------<br>
&gt; +# |           10   50   100<br>
&gt;  #<br>
&gt;  # Since: 4.0<br>
&gt;  ##<br>
&gt; -- <br>
&gt; 2.20.1<br>
&gt;<br>
&gt;<br>
</p>
Markus Armbruster Feb. 14, 2020, 12:53 p.m. UTC | #2
Peter Maydell <peter.maydell@linaro.org> writes:

> The ascii-art graph in the BlockLatencyHistogramInfo documentation

> doesn't render correctly, because the whitespace is collapsed.

>

> Use the '|' format that emits a literal 'example' block so the graph

> is displayed correctly.

>

> Strictly the texinfo generated is still wrong because each line

> goes into its own @example environment, but it renders better

> than what we had before.

>

> Fixing this rendering is a necessary prerequisite for the rST

> generator, which otherwise complains about the inconsistent

> indentation in the ascii-art graph.

>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---

> v1->v2: tweaked commit message, made graph still line up

> with preceding paragraph text

> ---

>  qapi/block-core.json | 14 +++++++-------

>  1 file changed, 7 insertions(+), 7 deletions(-)

>

> diff --git a/qapi/block-core.json b/qapi/block-core.json

> index ef94a296868..db9ca688d49 100644

> --- a/qapi/block-core.json

> +++ b/qapi/block-core.json

> @@ -550,13 +550,13 @@

>  #        For the example above, @bins may be something like [3, 1, 5, 2],

>  #        and corresponding histogram looks like:

>  #

> -#        5|           *

> -#        4|           *

> -#        3| *         *

> -#        2| *         *    *

> -#        1| *    *    *    *

> -#         +------------------

> -#             10   50   100

> +# |      5|           *

> +# |      4|           *

> +# |      3| *         *

> +# |      2| *         *    *

> +# |      1| *    *    *    *

> +# |       +------------------

> +# |           10   50   100

>  #

>  # Since: 4.0

>  ##


Reviewed-by: Markus Armbruster <armbru@redhat.com>
Philippe Mathieu-Daudé Feb. 15, 2020, 8:56 p.m. UTC | #3
Hi Aleksandar,

On Fri, Feb 14, 2020 at 12:04 AM Aleksandar Markovic
<aleksandar.m.mail@gmail.com> wrote:
>

> 6:59 PM Čet, 13.02.2020. Peter Maydell <peter.maydell@linaro.org> је написао/ла:

> >

> > The ascii-art graph

>

> Just out of couriousity, are unicode characters allowed in rst files?


I remember 2 years ago a blind developer thanked the QEMU community to
still restrict commits to 80 characters, because while 4K display are
available, he and other visually impaired developers cloud still
browse the QEMU codebase with their refreshable Braille display (which
was 80 cels). I don't know how many visually impaired developers are
following this project. A quick google returns " There is no concept
of Unicode in Braille. In that sense Braille is similar to old 8-bit
code pages which represented different symbols in different languages
for the same symbol code."
(https://superuser.com/questions/629443/represent-unicode-characters-in-braille).

(I'm Cc'ing Samuel who cares about Braille displays.)

>

> The boxes could've been rendered in a much more beautifull way using "lines and corners" group of unicode characters.

>

> Aleksandar
Aleksandar Markovic Feb. 15, 2020, 9:01 p.m. UTC | #4
9:56 PM Sub, 15.02.2020. Philippe Mathieu-Daudé <philippe@mathieu-daude.net>
је написао/ла:
>

> Hi Aleksandar,

>

> On Fri, Feb 14, 2020 at 12:04 AM Aleksandar Markovic

> <aleksandar.m.mail@gmail.com> wrote:

> >

> > 6:59 PM Čet, 13.02.2020. Peter Maydell <peter.maydell@linaro.org> је

написао/ла:
> > >

> > > The ascii-art graph

> >

> > Just out of couriousity, are unicode characters allowed in rst files?

>

> I remember 2 years ago a blind developer thanked the QEMU community to

> still restrict commits to 80 characters, because while 4K display are

> available, he and other visually impaired developers cloud still

> browse the QEMU codebase with their refreshable Braille display (which

> was 80 cels). I don't know how many visually impaired developers are

> following this project. A quick google returns " There is no concept

> of Unicode in Braille. In that sense Braille is similar to old 8-bit

> code pages which represented different symbols in different languages

> for the same symbol code."

> (

https://superuser.com/questions/629443/represent-unicode-characters-in-braille
).
>

> (I'm Cc'ing Samuel who cares about Braille displays.)

>


Got it.
> >

> > The boxes could've been rendered in a much more beautifull way using

"lines and corners" group of unicode characters.
> >

> > Aleksandar
<p dir="ltr"></p>
<p dir="ltr">9:56 PM Sub, 15.02.2020. Philippe Mathieu-Daudé &lt;<a href="mailto:philippe@mathieu-daude.net">philippe@mathieu-daude.net</a>&gt; је написао/ла:<br>
&gt;<br>
&gt; Hi Aleksandar,<br>
&gt;<br>
&gt; On Fri, Feb 14, 2020 at 12:04 AM Aleksandar Markovic<br>
&gt; &lt;<a href="mailto:aleksandar.m.mail@gmail.com">aleksandar.m.mail@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; 6:59 PM Čet, 13.02.2020. Peter Maydell &lt;<a href="mailto:peter.maydell@linaro.org">peter.maydell@linaro.org</a>&gt; је написао/ла:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The ascii-art graph<br>
&gt; &gt;<br>
&gt; &gt; Just out of couriousity, are unicode characters allowed in rst files?<br>
&gt;<br>
&gt; I remember 2 years ago a blind developer thanked the QEMU community to<br>
&gt; still restrict commits to 80 characters, because while 4K display are<br>
&gt; available, he and other visually impaired developers cloud still<br>
&gt; browse the QEMU codebase with their refreshable Braille display (which<br>
&gt; was 80 cels). I don&#39;t know how many visually impaired developers are<br>
&gt; following this project. A quick google returns &quot; There is no concept<br>
&gt; of Unicode in Braille. In that sense Braille is similar to old 8-bit<br>
&gt; code pages which represented different symbols in different languages<br>
&gt; for the same symbol code.&quot;<br>
&gt; (<a href="https://superuser.com/questions/629443/represent-unicode-characters-in-braille">https://superuser.com/questions/629443/represent-unicode-characters-in-braille</a>).<br>
&gt;<br>
&gt; (I&#39;m Cc&#39;ing Samuel who cares about Braille displays.)<br>
&gt;</p>
<p dir="ltr">Got it. <br>
&gt; &gt;<br>
&gt; &gt; The boxes could&#39;ve been rendered in a much more beautifull way using &quot;lines and corners&quot; group of unicode characters.<br>
&gt; &gt;<br>
&gt; &gt; Aleksandar<br>
</p>
Philippe Mathieu-Daudé Feb. 17, 2020, 12:44 a.m. UTC | #5
On Sat, Feb 15, 2020 at 10:01 PM Aleksandar Markovic
<aleksandar.m.mail@gmail.com> wrote:
> 9:56 PM Sub, 15.02.2020. Philippe Mathieu-Daudé <philippe@mathieu-daude.net> је написао/ла:

> > On Fri, Feb 14, 2020 at 12:04 AM Aleksandar Markovic

> > <aleksandar.m.mail@gmail.com> wrote:

> > >

> > > 6:59 PM Čet, 13.02.2020. Peter Maydell <peter.maydell@linaro.org> је написао/ла:

> > > >

> > > > The ascii-art graph

> > >

> > > Just out of couriousity, are unicode characters allowed in rst files?

> >

> > I remember 2 years ago a blind developer thanked the QEMU community to

> > still restrict commits to 80 characters, because while 4K display are

> > available, he and other visually impaired developers cloud still

> > browse the QEMU codebase with their refreshable Braille display (which

> > was 80 cels). I don't know how many visually impaired developers are

> > following this project. A quick google returns " There is no concept

> > of Unicode in Braille. In that sense Braille is similar to old 8-bit

> > code pages which represented different symbols in different languages

> > for the same symbol code."

> > (https://superuser.com/questions/629443/represent-unicode-characters-in-braille).

> >

> > (I'm Cc'ing Samuel who cares about Braille displays.)

> >

>

> Got it.


AFAIK there are no particular care in the project regarding visually
impaired developers, maybe we are already using things that exclude
them.
IOW without a project policy to include visually impaired developers,
my comment is irrelevant and it shouldn't restrict the use of unicode
to improve documentation.
Personally I'd rather we keep the project open to all possible contributors.

> > >

> > > The boxes could've been rendered in a much more beautifull way using "lines and corners" group of unicode characters.

> > >

> > > Aleksandar
Samuel Thibault Feb. 17, 2020, 5:53 a.m. UTC | #6
Hello,

Philippe Mathieu-Daudé, le lun. 17 févr. 2020 01:44:35 +0100, a ecrit:
> On Sat, Feb 15, 2020 at 10:01 PM Aleksandar Markovic

> <aleksandar.m.mail@gmail.com> wrote:

> > 9:56 PM Sub, 15.02.2020. Philippe Mathieu-Daudé <philippe@mathieu-daude.net> је написао/ла:

> > > On Fri, Feb 14, 2020 at 12:04 AM Aleksandar Markovic

> > > <aleksandar.m.mail@gmail.com> wrote:

> > > >

> > > > 6:59 PM Čet, 13.02.2020. Peter Maydell <peter.maydell@linaro.org> је написао/ла:

> > > > >

> > > > > The ascii-art graph

> > > >

> > > > Just out of couriousity, are unicode characters allowed in rst files?

> > >

> > > I remember 2 years ago a blind developer thanked the QEMU community to

> > > still restrict commits to 80 characters, because while 4K display are

> > > available, he and other visually impaired developers cloud still

> > > browse the QEMU codebase with their refreshable Braille display (which

> > > was 80 cels). I don't know how many visually impaired developers are

> > > following this project. A quick google returns " There is no concept

> > > of Unicode in Braille. In that sense Braille is similar to old 8-bit

> > > code pages which represented different symbols in different languages

> > > for the same symbol code."

> > > (https://superuser.com/questions/629443/represent-unicode-characters-in-braille).

> > >

> > > (I'm Cc'ing Samuel who cares about Braille displays.)


Nowadays' screen reader do provide some translations for some unicode
fancies. But the analogy with codepage remains true: since there are
only 256 braille pattern, there will be ambiguity between representation
of plain text and representation of unicode fancies. Using plain ascii
avoids this issue, i.e. blind developers will know that '|' and '-' are
commonly used for drawing, and their Braille representations are not
ambiguous. So that's indeed better to keep them ascii.

More generally, ascii art is however hard to catch with a Braille device
anyway...

Samuel
diff mbox series

Patch

diff --git a/qapi/block-core.json b/qapi/block-core.json
index ef94a296868..db9ca688d49 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -550,13 +550,13 @@ 
 #        For the example above, @bins may be something like [3, 1, 5, 2],
 #        and corresponding histogram looks like:
 #
-#        5|           *
-#        4|           *
-#        3| *         *
-#        2| *         *    *
-#        1| *    *    *    *
-#         +------------------
-#             10   50   100
+# |      5|           *
+# |      4|           *
+# |      3| *         *
+# |      2| *         *    *
+# |      1| *    *    *    *
+# |       +------------------
+# |           10   50   100
 #
 # Since: 4.0
 ##