From patchwork Fri Sep 25 14:03:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 522817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E628814090B for ; Sat, 26 Sep 2015 00:09:31 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=x56f0BLb; dkim-atps=neutral Received: from localhost ([::1]:41986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTgm-0006yW-8P for incoming@patchwork.ozlabs.org; Fri, 25 Sep 2015 10:09:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTbu-0006ZZ-53 for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfTbp-0003Pf-4T for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:26 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:37751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfTbo-0003PO-US for qemu-devel@nongnu.org; Fri, 25 Sep 2015 10:04:21 -0400 Received: by wicfx3 with SMTP id fx3so21021607wic.0 for ; Fri, 25 Sep 2015 07:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ASbecYvK+AS7jTcvKgdNQqfaYsHyNeCTqqATno0Fqcw=; b=x56f0BLbQbUNvksI2m/ssd/qxex5jbOoDmKTyP/+F1cfsb1VxCOD+4soEYXxPRvYaR tTuBsbb69B12qbCL+adxg9H+sl5RqdK4DEVrkO2vBY7PzNYOCocWo0qZUx2XsJHh0fFh jn3Fy3anfiVngLVRljolhlpipN1s3o/S4ipX1e/LTnMTqrpFxi+IT7OMsHnioxnjK4Di eyW2RYw928bMp6GZarKnf6TMY5zgSKQDzl33WhAEuI5kh2iryBqDJQSPNm40AJxDYThw ap5PV5jnFtim/C7cSqKDiQLw4EgL8eD+yS7ZtcN41DMlvNhUZ+ZZTqIJy5BRZREOhaWo 4kBg== X-Received: by 10.194.184.136 with SMTP id eu8mr7220261wjc.151.1443189860379; Fri, 25 Sep 2015 07:04:20 -0700 (PDT) Received: from localhost ([149.6.167.210]) by smtp.gmail.com with ESMTPSA id x7sm3447216wia.5.2015.09.25.07.04.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2015 07:04:19 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Fri, 25 Sep 2015 16:03:38 +0200 Message-Id: <1443189844-20341-11-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> References: <1443189844-20341-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , armbru@redhat.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 10/36] texi2pod: learn quotation, deftp and deftypefn X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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.