diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-10-23 13:35:01 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-10-23 13:35:01 +0000 |
commit | 13b3191f6d774341df664222adc5f85cad0a00cb (patch) | |
tree | 29d5ae33681cc1eea8e2bcb9d8cea419446e1cbb | |
parent | 9e569139583178c7e1c35147cef3fd17493a11da (diff) | |
download | mailfromd-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-- | ChangeLog | 6 | ||||
-rw-r--r-- | doc/Makefile.am | 2 | ||||
-rwxr-xr-x | doc/gendocs.sh | 310 | ||||
-rwxr-xr-x | doc/gendocs_template | 10 | ||||
-rw-r--r-- | doc/mailfromd.texi | 59 |
5 files changed, 364 insertions, 23 deletions
@@ -1,5 +1,11 @@ | |||
1 | 2007-10-23 Sergey Poznyakoff <gray@gnu.org.ua> | 1 | 2007-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 | ||
128 | MAKEINFOFLAGS=-D$(RENDITION) | 128 | MAKEINFOFLAGS=-D$(RENDITION) |
129 | 129 | ||
130 | GENDOCS=gendocs.sh | 130 | GENDOCS=${top_srcdir}/doc/gendocs.sh |
131 | 131 | ||
132 | TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E | 132 | TEXI2DVI=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 | |||
5 | scriptversion=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 | |||
25 | prog=`basename "$0"` | ||
26 | srcdir=`pwd` | ||
27 | |||
28 | scripturl="http://svn.gnu.org.ua/viewvc/mailfromd/trunk/doc/gendocs.sh" | ||
29 | templateurl="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"} | ||
41 | unset CDPATH | ||
42 | |||
43 | version="gendocs.sh $scriptversion | ||
44 | |||
45 | Copyright (C) 2007 Free Software Foundation, Inc. | ||
46 | There is NO warranty. You may redistribute this software | ||
47 | under the terms of the GNU General Public License. | ||
48 | For more information about these matters, see the files named COPYING." | ||
49 | |||
50 | usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE | ||
51 | |||
52 | Generate various output formats from PACKAGE.texinfo (or .texi or .txi) source. | ||
53 | See the GNU Maintainers document for a more extensive discussion: | ||
54 | http://www.gnu.org/prep/maintain_toc.html | ||
55 | |||
56 | Options: | ||
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 | |||
63 | Simple example: $prog emacs \"GNU Emacs Manual\" | ||
64 | |||
65 | Typical sequence: | ||
66 | cd YOURPACKAGESOURCE/doc | ||
67 | wget \"$scripturl\" | ||
68 | wget \"$templateurl\" | ||
69 | $prog YOURMANUAL \"GNU YOURMANUAL - One-line description\" | ||
70 | |||
71 | Output will be in a new subdirectory \"manual\" (by default, use -o OUTDIR | ||
72 | to override). Move all the new files into your web CVS tree, as | ||
73 | explained in the Web Pages node of maintain.texi. | ||
74 | |||
75 | MANUAL-TITLE is included as part of the HTML <title> of the overall | ||
76 | manual/index.html file. It should include the name of the package being | ||
77 | documented. manual/index.html is created by substitution from the file | ||
78 | $GENDOCS_TEMPLATE_DIR/gendocs_template. (Feel free to modify the | ||
79 | generic template for your own purposes.) | ||
80 | |||
81 | If you have several manuals, you'll need to run this script several | ||
82 | times with different YOURMANUAL values, specifying a different output | ||
83 | directory with -o each time. Then write (by hand) an overall index.html | ||
84 | with links to them all. | ||
85 | |||
86 | If a manual's texinfo sources are spread across several directories, | ||
87 | first 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 | |||
90 | You can set the environment variables MAKEINFO, TEXI2DVI, and DVIPS to | ||
91 | control the programs that get executed, and GENDOCS_TEMPLATE_DIR to | ||
92 | control where the gendocs_template file is looked for. (With --docbook, | ||
93 | the environment variables DOCBOOK2HTML, DOCBOOK2PDF, DOCBOOK2PS, and | ||
94 | DOCBOOK2TXT are also respected.) | ||
95 | |||
96 | By default, makeinfo is run in the default (English) locale, since | ||
97 | that's the language of most Texinfo manuals. If you happen to have a | ||
98 | non-English manual and non-English web site, check the SETLANG setting | ||
99 | in the source. | ||
100 | |||
101 | Email bug reports or enhancement requests to bug-texinfo@gnu.org. | ||
102 | " | ||
103 | |||
104 | calcsize() | ||
105 | { | ||
106 | size=`ls -ksl $1 | awk '{print $1}'` | ||
107 | echo $size | ||
108 | } | ||
109 | |||
110 | outdir=manual | ||
111 | html= | ||
112 | PACKAGE= | ||
113 | MANUAL_TITLE= | ||
114 | |||
115 | while 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 | ||
137 | done | ||
138 | |||
139 | if test -s "$srcdir/$PACKAGE.texinfo"; then | ||
140 | srcfile=$srcdir/$PACKAGE.texinfo | ||
141 | elif test -s "$srcdir/$PACKAGE.texi"; then | ||
142 | srcfile=$srcdir/$PACKAGE.texi | ||
143 | elif test -s "$srcdir/$PACKAGE.txi"; then | ||
144 | srcfile=$srcdir/$PACKAGE.txi | ||
145 | else | ||
146 | echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2 | ||
147 | exit 1 | ||
148 | fi | ||
149 | |||
150 | if 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 | ||
154 | fi | ||
155 | |||
156 | echo Generating output formats for $srcfile | ||
157 | |||
158 | cmd="$SETLANG $MAKEINFO -o $PACKAGE.info \"$srcfile\"" | ||
159 | echo "Generating info files... ($cmd)" | ||
160 | eval "$cmd" | ||
161 | mkdir -p $outdir/ | ||
162 | tar czf $outdir/$PACKAGE.info.tar.gz $PACKAGE.info* | ||
163 | info_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 | |||
167 | cmd="${TEXI2DVI} \"$srcfile\"" | ||
168 | echo "Generating dvi ... ($cmd)" | ||
169 | eval "$cmd" | ||
170 | |||
171 | # now, before we compress dvi: | ||
172 | echo Generating postscript... | ||
173 | ${DVIPS} $PACKAGE -o | ||
174 | gzip -f -9 $PACKAGE.ps | ||
175 | ps_gz_size=`calcsize $PACKAGE.ps.gz` | ||
176 | mv $PACKAGE.ps.gz $outdir/ | ||
177 | |||
178 | # compress/finish dvi: | ||
179 | gzip -f -9 $PACKAGE.dvi | ||
180 | dvi_gz_size=`calcsize $PACKAGE.dvi.gz` | ||
181 | mv $PACKAGE.dvi.gz $outdir/ | ||
182 | |||
183 | cmd="${TEXI2DVI} --pdf \"$srcfile\"" | ||
184 | echo "Generating pdf ... ($cmd)" | ||
185 | eval "$cmd" | ||
186 | pdf_size=`calcsize $PACKAGE.pdf` | ||
187 | mv $PACKAGE.pdf $outdir/ | ||
188 | |||
189 | cmd="$SETLANG $MAKEINFO -o $PACKAGE.txt --no-split --no-headers \"$srcfile\"" | ||
190 | echo "Generating ASCII... ($cmd)" | ||
191 | eval "$cmd" | ||
192 | ascii_size=`calcsize $PACKAGE.txt` | ||
193 | gzip -f -9 -c $PACKAGE.txt >$outdir/$PACKAGE.txt.gz | ||
194 | ascii_gz_size=`calcsize $outdir/$PACKAGE.txt.gz` | ||