summaryrefslogtreecommitdiff
path: root/doc/scripts
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2001-07-28 14:51:55 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2001-07-28 14:51:55 +0000
commit2e0ec1f697f710c3edc1c1d618e5d7e44262323f (patch)
tree579a8078b377fb5be576144026a056d2d6578e5b /doc/scripts
parent8ccd1ffe7ffed9e6fe251e89da618c7903bda71b (diff)
downloadgnutls-2e0ec1f697f710c3edc1c1d618e5d7e44262323f.tar.gz
Added documentation in TEX
Diffstat (limited to 'doc/scripts')
-rwxr-xr-xdoc/scripts/gdoc49
1 files changed, 48 insertions, 1 deletions
diff --git a/doc/scripts/gdoc b/doc/scripts/gdoc
index a83cfb7637..261c00706d 100755
--- a/doc/scripts/gdoc
+++ b/doc/scripts/gdoc
@@ -91,6 +91,12 @@ $type_env = "(\\\$\\w+)";
$type_param, "<tt><b>\$1</b></tt>" );
$blankline_html = "<p>";
+%highlights_tex = ( $type_constant, "{\\it \$1}",
+ $type_func, "{\\bf \$1}",
+ $type_struct, "{\\it \$1}",
+ $type_param, "{\\bf \$1}" );
+$blankline_tex = "\\par";
+
# sgml, docbook format
%highlights_sgml = ( $type_constant, "<replaceable class=\"option\">\$1</replaceable>",
$type_func, "<function>\$1</function>",
@@ -115,7 +121,7 @@ $blankline_text = "";
sub usage {
- print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n";
+ print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man | -tex ]\n";
print " [ -function funcname [ -function funcname ...] ]\n";
print " c source file(s) > outputfile\n";
exit 1;
@@ -142,6 +148,10 @@ while ($ARGV[0] =~ m/^-(.*)/) {
$output_mode = "man";
%highlights = %highlights_man;
$blankline = $blankline_man;
+ } elsif ($cmd eq "-tex") {
+ $output_mode = "tex";
+ %highlights = %highlights_tex;
+ $blankline = $blankline_tex;
} elsif ($cmd eq "-text") {
$output_mode = "text";
%highlights = %highlights_text;
@@ -258,6 +268,43 @@ sub output_html {
print "<hr>\n";
}
+# output in tex
+sub output_tex {
+ my %args = %{$_[0]};
+ my ($parameter, $section);
+ my $count;
+ print "\n\n\\subsection{". $args{'function'} . "}\n";
+
+ print "{\\it ".$args{'functiontype'}."}\n";
+ print "{\\bf ".$args{'function'}."}\n";
+ print "(\n";
+ $count = 0;
+ foreach $parameter (@{$args{'parameterlist'}}) {
+ print "{\\it ".$args{'parametertypes'}{$parameter}."} {\\bf ".$parameter."}\n";
+ if ($count != $#{$args{'parameterlist'}}) {
+ $count++;
+ print ", ";
+ }
+ }
+ print ")\n";
+
+ print "\n\\large{Arguments}\n";
+ print "\\begin{itemize}\n";
+ foreach $parameter (@{$args{'parameterlist'}}) {
+ print "\\item {\\it ".$args{'parametertypes'}{$parameter}."} {\\bf ".$parameter."}\n";
+ print "\n";
+ output_highlight($args{'parameters'}{$parameter});
+ }
+ print "\\end{itemize}\n";
+ foreach $section (@{$args{'sectionlist'}}) {
+ print "\\large{$section}\n";
+ print "\\begin{rmfamily}\n";
+ output_highlight($args{'sections'}{$section});
+ print "\\end{rmfamily}\n";
+ }
+ print "\n";
+}
+
# output in sgml DocBook
sub output_sgml {