[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/18] texi2pod: parse @include directives outside "@c man" b
From: |
Peter Maydell |
Subject: |
Re: [PATCH 03/18] texi2pod: parse @include directives outside "@c man" blocks |
Date: |
Thu, 27 Feb 2020 11:13:13 +0000 |
On Wed, 26 Feb 2020 at 11:30, Paolo Bonzini <address@hidden> wrote:
>
> This enables splitting the huge qemu-doc.texi file and keeping parallel
> Texinfo and rST versions of the documentation. texi2pod is not going to
> live much longer and hardly anyone cares about its upstream status,
> so the temporary fork should be acceptable.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> scripts/texi2pod.pl | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/scripts/texi2pod.pl b/scripts/texi2pod.pl
> index 839b7917cf..8bfc6f6f4c 100755
> --- a/scripts/texi2pod.pl
> +++ b/scripts/texi2pod.pl
> @@ -143,6 +143,24 @@ while(<$inf>) {
> next;
> };
>
> + # Single line command handlers.
> +
> + /^\@include\s+(.+)$/ and do {
> + push @instack, $inf;
> + $inf = gensym();
> + $file = postprocess($1);
> +
> + # Try cwd and $ibase, then explicit -I paths.
> + $done = 0;
> + foreach $path ("", $ibase, @ipath) {
> + $mypath = $file;
> + $mypath = $path . "/" . $mypath if ($path ne "");
> + open($inf, "<" . $mypath) and ($done = 1, last);
> + }
> + die "cannot find $file" if !$done;
> + next;
> + };
> +
> next unless $output;
>
> # Discard comments. (Can't do it above, because then we'd never see
> @@ -242,24 +260,6 @@ while(<$inf>) {
> s/>/>/g;
> }
>
> - # Single line command handlers.
> -
> - /^\@include\s+(.+)$/ and do {
> - push @instack, $inf;
> - $inf = gensym();
> - $file = postprocess($1);
> -
> - # Try cwd and $ibase, then explicit -I paths.
> - $done = 0;
> - foreach $path ("", $ibase, @ipath) {
> - $mypath = $file;
> - $mypath = $path . "/" . $mypath if ($path ne "");
> - open($inf, "<" . $mypath) and ($done = 1, last);
> - }
> - die "cannot find $file" if !$done;
> - next;
> - };
> -
> /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/
> and $_ = "\n=head2 $1\n";
> /^\@subsection\s+(.+)$/
This changes the semantics subtly -- we now honour @include
even if it's found inside an @ignore..@end ignore comment
block, for instance. But as you say this script isn't going
to be around much longer, so we can just avoid doing that
sort of thing.
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
- [PATCH v2 00/18] qemu-doc reorganization and Sphinx version, Paolo Bonzini, 2020/02/26
- [PATCH 03/18] texi2pod: parse @include directives outside "@c man" blocks, Paolo Bonzini, 2020/02/26
- Re: [PATCH 03/18] texi2pod: parse @include directives outside "@c man" blocks,
Peter Maydell <=
- [PATCH 02/18] qemu-doc: remove target OS documentation, Paolo Bonzini, 2020/02/26
- [PATCH 07/18] qemu-doc: move system requirements chapter inside PC section, Paolo Bonzini, 2020/02/26
- [PATCH 04/18] qemu-doc: split CPU models doc between MIPS and x86 parts, Paolo Bonzini, 2020/02/26
- [PATCH 06/18] qemu-doc: extract common system emulator documentation from the PC section, Paolo Bonzini, 2020/02/26
- [PATCH 11/18] qemu-doc: move included files to docs/system, Paolo Bonzini, 2020/02/26
- [PATCH 01/18] qemu-doc: convert user-mode emulation to a separate Sphinx manual, Paolo Bonzini, 2020/02/26