Received: from eggs.gnu.org ([2001:4830:134:3::10]:48586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3eOo-0000nF-Pu for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:31:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3eOn-0001ax-VZ for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:31:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33320) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c3eOn-0001aL-Pg for qemu-devel@nongnu.org; Mon, 07 Nov 2016 02:31:21 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 19AD43D95E for ; Mon, 7 Nov 2016 07:31:21 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 7 Nov 2016 11:30:31 +0400 Message-Id: <20161107073033.21025-13-marcandre.lureau@redhat.com> In-Reply-To: <20161107073033.21025-1-marcandre.lureau@redhat.com> References: <20161107073033.21025-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 12/14] texi2pod: learn quotation, deftp and deftypefn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: eblake@redhat.com, armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Learn a few more markups used for API documentation. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/texi2pod.pl | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/scripts/texi2pod.pl b/scripts/texi2pod.pl index 8767662..5df4b5f 100755 --- a/scripts/texi2pod.pl +++ b/scripts/texi2pod.pl @@ -37,6 +37,7 @@ $inf =3D ""; $ibase =3D ""; @ipath =3D (); $encoding =3D undef; +@args =3D (); =20 while ($_ =3D shift) { if (/^-D(.*)$/) { @@ -162,7 +163,8 @@ while(<$inf>) { if ($ended =3D~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) { $skipping =3D pop @skstack; next; - } elsif ($ended =3D~ /^(?:example|smallexample|display)$/) { + } elsif ($ended =3D~ /^(?:example|smallexample|display + |quotation|deftp|deftypefn)$/x) { $shift =3D ""; $_ =3D ""; # need a paragraph break } elsif ($ended =3D~ /^(?:itemize|enumerate|[fv]?table)$/) { @@ -323,6 +325,46 @@ while(<$inf>) { $_ =3D "\n=3Ditem ".join (" : ", @columns)."\n"; }; =20 + /^\@(quotation)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw =3D $1; + $_ =3D "\n$2:" + }; + + /^{(.*)}$|^(.*)$/ and $#args > 0 and do { + $kind =3D $args[0]; + $arguments =3D $1 // ""; + if ($endw eq "deftypefn") { + $ret =3D $args[1]; + $fname =3D "B<$args[2]>"; + $_ =3D $ret ? "$ret " : ""; + $_ .=3D "$fname $arguments ($kind)"; + } else { + $_ =3D "B<$args[1]> ($kind)\n\n$arguments"; + } + @args =3D (); + }; + + /^\@(deftp)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw =3D $1; + $arg =3D $2; + $arg =3D~ s/{([^}]*)}/$1/g; + $arg =3D~ s/\@$//; + @args =3D split (/ /, $arg); + $_ =3D ""; + }; + + /^\@(deftypefn)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw =3D $1; + $arg =3D $2; + $arg =3D~ s/{([^}]*)}/$1/g; + $arg =3D~ s/\@$//; + @args =3D split (/ /, $arg); + $_ =3D ""; + }; + /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below. --=20 2.10.0