Re: [PATCH 4/4] getopt.1.adoc: render synopsis rules on separate lines

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

 



Hello Johannes,

Am Mo., 7. Feb. 2022 um 16:45 Uhr schrieb Johannes Altmanninger
<aclopte@xxxxxxxxx>:
>
> AsciiDoc ignores single line breaks, so the synopsis of
>
>         *getopt* _variant1_
>         *getopt* _variant2_
>
> will render as one line in the manpage.
>
> Fix this by adding a blank line in between two rules, like we do
> elsewhere.  This means that the manpage also has blank lines.
>
>         *getopt* _variant1_
>
>         *getopt* _variant2_
>
> Alternative solution: we could avoid the blank lines like below,
> but that'd be inconsistent with our other manpages.
>
>         *getopt* _variant1_ +
>         *getopt* _variant2_ +
>

This would be possible, but we need in any case a solution which can
be parsed by Po4a to generate a translation template and write the
gettext messages properly to the translated man page. With the
appended plus sign, Po4a generates the following gettext message:

#. type: Plain text
#: ../misc-utils/getopt.1.adoc:19
#, no-wrap
msgid ""
"*getopt* _optstring_ _parameters_ +\n"
"*getopt* [options] [*--*] _optstring_ _parameters_ +\n"
"*getopt* [options] *-o*|*--options* _optstring_ [options] [*--*]
_parameters_\n"
msgstr ""

Even in case translators recognize the plus sign correctly, Po4a
writes it indeed back to the translated *.adoc file, but in a way that
Asciidoctor parses it as an arbitrary plus sign within the text – and
concatenates the lines anyway, now with a few more plus signs …

> or, equivalently, use the verse[*] directive
>
>         [verse]
>         *getopt* _variant1_
>         *getopt* _variant2_
>

This is IMHO the best solution. It looks good in the translation
template, and it renders properly in the translated man page. If I
find some time next days, I will create a global patch for all
affected man pages – not only for the "SYNOPSIS" sections, this
"[verse]" thing seems to be also perfectly usable for multiline
"AUTHORS" sections.

Thanks for reviewing the man pages!

Best Regards,
Mario




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux