summaryrefslogtreecommitdiff
path: root/doc/scripts
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2006-06-27 15:20:12 +0000
committerSimon Josefsson <simon@josefsson.org>2006-06-27 15:20:12 +0000
commitc2d408e89a83eb03e4d633d57b4a1d480e548922 (patch)
tree3f9fc0d47dcab6a2699b3bf329761d4a33506600 /doc/scripts
parentca132ac6da472f460b48b9413e33b96dee5daaa3 (diff)
downloadgnutls-c2d408e89a83eb03e4d633d57b4a1d480e548922.tar.gz
Improve man output, from libtasn1.
Diffstat (limited to 'doc/scripts')
-rwxr-xr-xdoc/scripts/gdoc24
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/scripts/gdoc b/doc/scripts/gdoc
index 81d6eeb887..44515e2fc8 100755
--- a/doc/scripts/gdoc
+++ b/doc/scripts/gdoc
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-## Copyright (c) 2002, 2003, 2004, 2005 Simon Josefsson ##
+## Copyright (c) 2002, 2003, 2004, 2005, 2006 Simon Josefsson ##
## added -texinfo, -listfunc ##
## man page revamp ##
## various improvements ##
@@ -161,10 +161,10 @@ $blankline_tex = "\\\\";
$blankline_sgml = "</para><para>\n";
# these are pretty rough
-%highlights_man = ( "\\s*" .$type_constant . "\\s*", "\\n.I \\\"\$1\\\"\\n",
- $type_func . "\\s*", "\\n.B \\\"\$1\\\"\\n",
- $type_struct . "\\s*", "\\n.I \\\"\$1\\\"\\n",
- $type_param."([\.\, ]*)\n?", "\\n.I \\\"\$1\$2\\\"\\n" );
+%highlights_man = ( $type_constant, "\\\\fB\$1\\\\fP",
+ $type_func, "\\\\fB\$1\\\\fP",
+ $type_struct, "\\\\fB\$1\\\\fP",
+ $type_param, "\\\\fI\$1\\\\fP" );
$blankline_man = "";
# text-mode
@@ -596,11 +596,17 @@ sub output_man {
my ($parameter, $section);
my $count;
+ print ".\\\" DO NOT MODIFY THIS FILE! It was generated by gdoc.\n";
print ".TH \"$args{'function'}\" 3 \"$args{'sourceversion'}\" \"". $args{'module'} . "\" \"". $args{'module'} . "\"\n";
print ".SH NAME\n";
- print $args{'function'}."\n";
+ print $args{'function'};
+ if ($args{'purpose'}) {
+ print " \\- " . $args{'purpose'} . "\n";
+ } else {
+ print " \\- API function\n";
+ }
print ".SH SYNOPSIS\n";
print ".B #include <". $args{'include'} . ">\n"
@@ -626,7 +632,9 @@ sub output_man {
}
foreach $section (@{$args{'sectionlist'}}) {
print ".SH \"" . uc($section) . "\"\n";
- output_highlight($args{'sections'}{$section});
+ $sec = $args{'sections'}{$section};
+ $sec =~ s/-/\\-/g;
+ output_highlight($sec);
}
if ($args{'bugsto'}) {
@@ -814,7 +822,7 @@ foreach $file (@ARGV) {
if (/$doc_func/o) {
$function = $1;
$state = 2;
- if (/-(.*)/) {
+ if (/-\s*(.*)/) {
$function_purpose = $1;
} else {
$function_purpose = "";