From 3043f8631aaa0514e361395bceca1eec5a0d2fa6 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 17 Mar 2012 12:55:14 +0100 Subject: [PATCH] texinfo documentation is similar to the printed manual. --- doc/Makefile.am | 10 +++++++++- doc/gnutls.texi | 28 +++++++++++++--------------- doc/scripts/split-texi.pl | 20 ++++++++++++++------ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 1f31d3d9e..7455c1b51 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -188,6 +188,14 @@ HEADER_FILES = $(top_srcdir)/lib/includes/gnutls/gnutls.h.in \ $(top_srcdir)/lib/includes/gnutls/dtls.h $(top_srcdir)/lib/includes/gnutls/crypto.h \ $(top_srcdir)/lib/includes/gnutls/ocsp.h +stamp_functions: gnutls-api.texi x509-api.texi pgp-api.texi pkcs12-api.texi pkcs11-api.texi abstract-api.texi compat-api.texi dtls-api.texi crypto-api.texi ocsp-api.texi + for i in $^; do \ + $(srcdir)/scripts/split-texi.pl functions < $$i; \ + done + sed -i 's/\@anchor{.*//g' functions/* + sed -i 's/\@subheading.*//g' functions/* + echo $@ > $@ + gnutls-api.texi: $(top_srcdir)/lib/includes/gnutls/gnutls.h.in echo "" > $@-tmp for i in `$(top_srcdir)/doc/scripts/getfuncs.pl <$(top_srcdir)/lib/includes/gnutls/gnutls.h.in|sort|uniq`; do \ @@ -387,7 +395,7 @@ ENUMS += enums/gnutls_x509_crt_fmt_t ENUMS += enums/gnutls_x509_subject_alt_name_t gnutls_TEXINFOS += $(ENUMS) -DISTCLEANFILES += $(ENUMS) stamp_enums +DISTCLEANFILES += $(ENUMS) stamp_enums stamp_functions stamp_enums: enums.texi $(MAKE) compare-makefile diff --git a/doc/gnutls.texi b/doc/gnutls.texi index 9d98de5e4..4d30e1d68 100644 --- a/doc/gnutls.texi +++ b/doc/gnutls.texi @@ -75,60 +75,58 @@ Documentation License''. @end macro @macro showfuncA{ref} -@itemize +@table @code @item @ref{\ref\} -@end itemize +@end table @end macro @macro showfuncB{ref1,ref2} -@itemize +@table @code @item @ref{\ref1\} @item @ref{\ref2\} -@end itemize +@end table @end macro @macro showfuncC{ref1,ref2,ref3} -@itemize +@table @code @item @ref{\ref1\} @item @ref{\ref2\} @item @ref{\ref3\} -@end itemize +@end table @end macro @macro showfuncD{ref1,ref2,ref3,ref4} -@itemize +@table @code @item @ref{\ref1\} @item @ref{\ref2\} @item @ref{\ref3\} @item @ref{\ref4\} -@end itemize +@end table @end macro @macro showfuncE{ref1,ref2,ref3,ref4,ref5} -@itemize +@table @code @item @ref{\ref1\} @item @ref{\ref2\} @item @ref{\ref3\} @item @ref{\ref4\} @item @ref{\ref5\} -@end itemize +@end table @end macro @macro showfuncF{ref1,ref2,ref3,ref4,ref5,ref6} -@itemize +@table @code @item @ref{\ref1\} @item @ref{\ref2\} @item @ref{\ref3\} @item @ref{\ref4\} @item @ref{\ref5\} @item @ref{\ref6\} -@end itemize +@end table @end macro @macro showfuncdesc{ref} -@itemize -@item @ref{\ref\} -@end itemize +@include functions/\ref\ @end macro @macro showenumdesc{ref,cap} diff --git a/doc/scripts/split-texi.pl b/doc/scripts/split-texi.pl index 63c2f765c..edb99fedc 100755 --- a/doc/scripts/split-texi.pl +++ b/doc/scripts/split-texi.pl @@ -23,7 +23,7 @@ eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' $dir = shift; $param2 = shift; -if ($param2 ne '') { +if (defined $param2 && $param2 ne '') { $enum = 1; } else { $enum = 0; @@ -36,21 +36,29 @@ sub key_of_record { my @lines = split /\n/, $record; my ($i) = 1; - my ($key) = $lines[$i]; + my ($key) = ''; + $key = $lines[$i] if (defined $lines[$i]); if ($enum == 1) { while( !($key =~ m/\@c\s(.*)\n/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; } } else { - while( !($key =~ m/^\\functionTitle\{(.*)\}/) && ($i < 5)) { $i=$i+1; $key = $lines[$i]; } + while( !($key =~ m/\@subheading\s(.*)/) && ($i < 5)) { + $i=$i+1; + if (defined $lines[$i]) { + $key = $lines[$i]; + } else { + $key = ''; + } + } } return $key; } if ($enum == 1) { - $/="\@end table"; # Records are separated by blank lines. + $/="\@end table"; } else { - $/="\n\\end{function}"; # Records are separated by blank lines. + $/="\@end deftypefun"; } @records = <>; # Read in whole file, one record per array element. @@ -68,7 +76,7 @@ foreach (@records) { $key =~ m/\@c\s(.*)\n/; $key = $1; } else { - $key =~ m/\\functionTitle\{(.*)\}/; + $key =~ m/\@subheading\s(.*)\n/; $key = $1; } -- 2.11.4.GIT