[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 12/14] texi2pod: learn quotation, deftp and defty
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v3 12/14] texi2pod: learn quotation, deftp and deftypefn |
Date: |
Mon, 7 Nov 2016 11:30:31 +0400 |
Learn a few more markups used for API documentation.
Signed-off-by: Marc-André Lureau <address@hidden>
---
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 = "";
$ibase = "";
@ipath = ();
$encoding = undef;
address@hidden = ();
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/address@hidden//;
+ @args = split (/ /, $arg);
+ $_ = "";
+ };
+
+ /^\@(deftypefn)\s*(.+)?$/ and do {
+ push @endwstack, $endw;
+ $endw = $1;
+ $arg = $2;
+ $arg =~ s/{([^}]*)}/$1/g;
+ $arg =~ s/address@hidden//;
+ @args = split (/ /, $arg);
+ $_ = "";
+ };
+
/address@hidden(.+)?$/ and do {
if (defined $1) {
# Entity escapes prevent munging by the <> processing below.
--
2.10.0
- [Qemu-devel] [PATCH v3 06/14] qapi: fix various symbols mismatch in documentation, (continued)
- [Qemu-devel] [PATCH v3 06/14] qapi: fix various symbols mismatch in documentation, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 07/14] qapi: use one symbol per line, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 09/14] qapi: add some sections in docs, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 10/14] docs: add master qapi texi files, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 08/14] qapi: add missing colon-ending for section name, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 12/14] texi2pod: learn quotation, deftp and deftypefn,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v3 11/14] qapi: add qapi2texi script, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 14/14] build-sys: add qapi doc generation targets, Marc-André Lureau, 2016/11/07
- [Qemu-devel] [PATCH v3 13/14] qmp-commands: (SQUASHED) move doc to schema, Marc-André Lureau, 2016/11/07