aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-10-23 13:35:01 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-10-23 13:35:01 +0000
commit13b3191f6d774341df664222adc5f85cad0a00cb (patch)
tree29d5ae33681cc1eea8e2bcb9d8cea419446e1cbb
parent9e569139583178c7e1c35147cef3fd17493a11da (diff)
downloadmailfromd-13b3191f6d774341df664222adc5f85cad0a00cb.tar.gz
mailfromd-13b3191f6d774341df664222adc5f85cad0a00cb.tar.bz2
Generate html docs using texi2html
git-svn-id: file:///svnroot/mailfromd/trunk@1521 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r--ChangeLog6
-rw-r--r--doc/Makefile.am2
-rwxr-xr-xdoc/gendocs.sh310
-rwxr-xr-xdoc/gendocs_template10
-rw-r--r--doc/mailfromd.texi59
5 files changed, 364 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index c47d8ed7..0f5a8c39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
12007-10-23 Sergey Poznyakoff <gray@gnu.org.ua> 12007-10-23 Sergey Poznyakoff <gray@gnu.org.ua>
2 2
3 * doc/mailfromd.texi: Do not use subheading commands inside of
4 deffn.
5 * doc/Makefile.am
6 * doc/gendocs.sh: New file. A customized version.
7 * doc/gendocs_template: Update
8
3 * configure.ac, src/syslog_async.c, src/syslog_async.h, 9 * configure.ac, src/syslog_async.c, src/syslog_async.h,
4 src/main.c, src/Makefile.am: Reimplement syslog-async. Thanks 10 src/main.c, src/Makefile.am: Reimplement syslog-async. Thanks
5 Simon Kelley for relicensing it under GPLv3. 11 Simon Kelley for relicensing it under GPLv3.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 3ecc4b7e..77ac5efe 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -127,7 +127,7 @@ final: untabify master-menu
127 127
128MAKEINFOFLAGS=-D$(RENDITION) 128MAKEINFOFLAGS=-D$(RENDITION)
129 129
130GENDOCS=gendocs.sh 130GENDOCS=${top_srcdir}/doc/gendocs.sh
131 131
132TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E 132TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
133 133
diff --git a/doc/gendocs.sh b/doc/gendocs.sh
new file mode 100755
index 00000000..fc5beeb6
--- /dev/null
+++ b/doc/gendocs.sh
@@ -0,0 +1,310 @@
1#!/bin/sh
2# gendocs.sh -- generate a GNU manual in many formats. This script is
3# mentioned in maintain.texi. See the help message below for usage details.
4
5scriptversion=2007-10-23.16.gray
6
7# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 3 of the License,
12# or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22# Original author: Mohit Agarwal.
23# Send bug reports and any other correspondence to bug-texinfo@gnu.org.
24
25prog=`basename "$0"`
26srcdir=`pwd`
27
28scripturl="http://svn.gnu.org.ua/viewvc/mailfromd/trunk/doc/gendocs.sh"
29templateurl="http://svn.gnu.org.ua/viewvc/mailfromd/trunk/doc/gendocs_template"
30
31: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
32: ${MAKEINFO="makeinfo"}
33: ${TEXI2DVI="texi2dvi -t @finalout"}
34: ${DVIPS="dvips"}
35: ${DOCBOOK2HTML="docbook2html"}
36: ${DOCBOOK2PDF="docbook2pdf"}
37: ${DOCBOOK2PS="docbook2ps"}
38: ${DOCBOOK2TXT="docbook2txt"}
39: ${GENDOCS_TEMPLATE_DIR="."}
40: ${TEXI2HTML="texi2html"}
41unset CDPATH
42
43version="gendocs.sh $scriptversion
44
45Copyright (C) 2007 Free Software Foundation, Inc.
46There is NO warranty. You may redistribute this software
47under the terms of the GNU General Public License.
48For more information about these matters, see the files named COPYING."
49
50usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
51
52Generate various output formats from PACKAGE.texinfo (or .texi or .txi) source.
53See the GNU Maintainers document for a more extensive discussion:
54 http://www.gnu.org/prep/maintain_toc.html
55
56Options:
57 -o OUTDIR write files into OUTDIR, instead of manual/.
58 --docbook convert to DocBook too (xml, txt, html, pdf and ps).
59 --html ARG pass indicated ARG to makeinfo for HTML targets.
60 --help display this help and exit successfully.
61 --version display version information and exit successfully.
62
63Simple example: $prog emacs \"GNU Emacs Manual\"
64
65Typical sequence:
66 cd YOURPACKAGESOURCE/doc
67 wget \"$scripturl\"
68 wget \"$templateurl\"
69 $prog YOURMANUAL \"GNU YOURMANUAL - One-line description\"
70
71Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR
72to override). Move all the new files into your web CVS tree, as
73explained in the Web Pages node of maintain.texi.
74
75MANUAL-TITLE is included as part of the HTML <title> of the overall
76manual/index.html file. It should include the name of the package being
77documented. manual/index.html is created by substitution from the file
78$GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the
79generic template for your own purposes.)
80
81If you have several manuals, you'll need to run this script several
82times with different YOURMANUAL values, specifying a different output
83directory with -o each time. Then write (by hand) an overall index.html
84with links to them all.
85
86If a manual's texinfo sources are spread across several directories,
87first copy or symlink all Texinfo sources into a single directory.
88(Part of the script's work is to make a tar.gz of the sources.)
89
90You can set the environment variables MAKEINFO, TEXI2DVI, and DVIPS to
91control the programs that get executed, and GENDOCS_TEMPLATE_DIR to
92control where the gendocs_template file is looked for. (With --docbook,
93the environment variables DOCBOOK2HTML, DOCBOOK2PDF, DOCBOOK2PS, and
94DOCBOOK2TXT are also respected.)
95
96By default, makeinfo is run in the default (English) locale, since
97that's the language of most Texinfo manuals. If you happen to have a
98non-English manual and non-English web site, check the SETLANG setting
99in the source.
100
101Email bug reports or enhancement requests to bug-texinfo@gnu.org.
102"
103
104calcsize()
105{
106 size=`ls -ksl $1 | awk '{print $1}'`
107 echo $size
108}
109
110outdir=manual
111html=
112PACKAGE=
113MANUAL_TITLE=
114
115while test $# -gt 0; do
116 case $1 in
117 --help) echo "$usage"; exit 0;;
118 --version) echo "$version"; exit 0;;
119 -o) shift; outdir=$1;;
120 --docbook) docbook=yes;;
121 --html) shift; html=$1;;
122 -*)
123 echo "$0: Unknown or ambiguous option \`$1'." >&2
124 echo "$0: Try \`--help' for more information." >&2
125 exit 1;;
126 *)
127 if test -z "$PACKAGE"; then
128 PACKAGE=$1
129 elif test -z "$MANUAL_TITLE"; then
130 MANUAL_TITLE=$1
131 else
132 echo "$0: extra non-option argument \`$1'." >&2
133 exit 1
134 fi;;
135 esac
136 shift
137done
138
139if test -s "$srcdir/$PACKAGE.texinfo"; then
140 srcfile=$srcdir/$PACKAGE.texinfo
141elif test -s "$srcdir/$PACKAGE.texi"; then
142 srcfile=$srcdir/$PACKAGE.texi
143elif test -s "$srcdir/$PACKAGE.txi"; then
144 srcfile=$srcdir/$PACKAGE.txi
145else
146 echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2
147 exit 1
148fi
149
150if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
151 echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2
152 echo "$0: it is available from $templateurl." >&2
153 exit 1
154fi
155
156echo Generating output formats for $srcfile
157
158cmd="$SETLANG $MAKEINFO -o $PACKAGE.info \"$srcfile\""
159echo "Generating info files... ($cmd)"
160eval "$cmd"
161mkdir -p $outdir/
162tar czf $outdir/$PACKAGE.info.tar.gz $PACKAGE.info*
163info_tgz_size=`calcsize $outdir/$PACKAGE.info.tar.gz`
164# do not mv the info files, there's no point in having them available
165# separately on the web.
166
167cmd="${TEXI2DVI} \"$srcfile\""
168echo "Generating dvi ... ($cmd)"
169eval "$cmd"
170
171# now, before we compress dvi:
172echo Generating postscript...
173${DVIPS} $PACKAGE -o
174gzip -f -9 $PACKAGE.ps
175ps_gz_size=`calcsize $PACKAGE.ps.gz`
176mv $PACKAGE.ps.gz $outdir/
177
178# compress/finish dvi:
179gzip -f -9 $PACKAGE.dvi
180dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
181mv $PACKAGE.dvi.gz $outdir/
182
183cmd="${TEXI2DVI} --pdf \"$srcfile\""
184echo "Generating pdf ... ($cmd)"
185eval "$cmd"
186pdf_size=`calcsize $PACKAGE.pdf`
187mv $PACKAGE.pdf $outdir/
188
189cmd="$SETLANG $MAKEINFO -o $PACKAGE.txt --no-split --no-headers \"$srcfile\""
190echo "Generating ASCII... ($cmd)"
191eval "$cmd"
192ascii_size=`calcsize $PACKAGE.txt`
193gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz
194ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz`