diff options
| author | Sam Ravnborg <sam@mars.ravnborg.org> | 2003-06-21 13:42:23 +0200 |
|---|---|---|
| committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2003-06-21 13:42:23 +0200 |
| commit | cc79cb641b86d9002528b3403a6db820049ddc22 (patch) | |
| tree | de8b201ec9d4f6642b8cea3c15fe65d26b13e5d6 /scripts/makeman | |
| parent | ee598aceb228acf07019c3706a76c016279f6317 (diff) | |
docbook: Added support for generating man files
Originally by Michael Still <mikal@stillhq.com>
This patch adds two new targets to the docbook makefile -- mandocs, and
installmandocs. The targets require two new perl scripts in the scripts/
directory, but in return we get a series of man pages for kernel
functions, which are installed in man section 9. This is a good thing, as
many programmers expect documentation to be available with man, and
hunting through various PS or PDF documents to find the documentation for
the function you want can be quite frustrating.
The man pages are just extracted from the various existing DocBook SGML
documents, which are generated by kernel-doc. You also need to have
docbook2man installed on your machine.
Please note the formatting is not perfect, but I will tweak
other stuff later with further patches -- this is just an initial
implementation.
Sample output (HTMLised) can be found at
http://www.stillhq.com/linux/mandocs/2.5.68/ and
http://www.stillhq.com/linux/mandocs/2.5.70/
Diffstat (limited to 'scripts/makeman')
| -rw-r--r-- | scripts/makeman | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/makeman b/scripts/makeman new file mode 100644 index 000000000000..3c6dc5b89f21 --- /dev/null +++ b/scripts/makeman @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +use strict; + +## Copyright (C) Michael Still (mikal@stillhq.com) +## Released under the terms of the GNU GPL +## +## A script to make or install the manpages extracted by split-man +## +## Arguements: $1 -- the word "convert" or "install" +## $2 -- the directory containing the SGML files for the manpages +## $3 -- the filename which contained the sgmldoc output +## (I need this so I know which manpages to convert) + +my($LISTING); + +if($ARGV[0] eq ""){ + die "Usage: makeman [convert | install] <dir> <file>\n"; +} + +if( ! -d "$ARGV[1]" ){ + die "Output directory \"$ARGV[1]\" does not exist\n"; +} + +if($ARGV[0] eq "convert"){ + open LISTING, "grep \"<refentrytitle>\" $ARGV[2] |"; + while(<LISTING>){ + s/<\/.*$//; + s/^.*>//; + s/\.sgml//; + s/struct //; + s/typedef //; + + chomp; + print "Processing $_\n"; + system("cd $ARGV[1]; docbook2man $_.sgml; gzip -f $_.9\n"); + } +} +elsif($ARGV[0] eq "install"){ + system("mkdir -p /usr/local/man/man9/; install $ARGV[1]/*.9.gz /usr/local/man/man9/"); +} +else{ + die "Usage: makeman [convert | install] <dir> <file>\n"; +} + +print "Done\n"; |
