From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAxd1-0000Zi-Oz for qemu-devel@nongnu.org; Fri, 03 Jul 2015 05:51:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAxd0-0005S2-V2 for qemu-devel@nongnu.org; Fri, 03 Jul 2015 05:51:27 -0400 Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:35326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAxd0-0005Ry-RL for qemu-devel@nongnu.org; Fri, 03 Jul 2015 05:51:26 -0400 Received: by qkbp125 with SMTP id p125so69426875qkb.2 for ; Fri, 03 Jul 2015 02:51:26 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 3 Jul 2015 11:51:03 +0200 Message-Id: <1435917064-17827-5-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1435917064-17827-1-git-send-email-marcandre.lureau@redhat.com> References: <1435917064-17827-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 4/5] texi2pod: learn quotation, deftp and deftypefn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com, mdroth@linux.vnet.ibm.com From: Marc-André Lureau Learn a few more markups used for API documentation. Signed-off-by: Marc-André Lureau --- scripts/texi2pod.pl | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/scripts/texi2pod.pl b/scripts/texi2pod.pl index 94097fb..3590a2d 100755 --- a/scripts/texi2pod.pl +++ b/scripts/texi2pod.pl @@ -37,6 +37,7 @@ $inf = ""; $ibase = ""; @ipath = (); $encoding = undef; +@args = (); while ($_ = shift) { if (/^-D(.*)$/) { @@ -162,7 +163,8 @@ while(<$inf>) { if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex)$/) { $skipping = pop @skstack; next; - } elsif ($ended =~ /^(?:example|smallexample|display)$/) { + } elsif ($ended =~ /^(?:example|smallexample|display + |quotation|deftp|deftypefn)$/x) { $shift = ""; $_ = ""; # need a paragraph break } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { @@ -323,6 +325,46 @@ while(<$inf>) { $_ = "\n=item ".join (" : ", @columns)."\n"; }; + /^\@(quotation)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $_ = "\n$2:" + }; + + /^{(.*)}$|^(.*)$/ and $#args > 0 and do { + $kind = $args[0]; + $arguments = $1 // ""; + if ($endw eq "deftypefn") { + $ret = $args[1]; + $fname = "B<$args[2]>"; + $_ = $ret ? "$ret " : ""; + $_ .= "$fname $arguments ($kind)"; + } else { + $_ = "B<$args[1]> ($kind)\n\n$arguments"; + } + @args = (); + }; + + /^\@(deftp)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $arg = $2; + $arg =~ s/{([^}]*)}/$1/g; + $arg =~ s/\@$//; + @args = split (/ /, $arg); + $_ = ""; + }; + + /^\@(deftypefn)\s*(.+)?$/ and do { + push @endwstack, $endw; + $endw = $1; + $arg = $2; + $arg =~ s/{([^}]*)}/$1/g; + $arg =~ s/\@$//; + @args = split (/ /, $arg); + $_ = ""; + }; + /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { # Entity escapes prevent munging by the <> processing below. -- 2.4.3