[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gendocs.sh patch
From: |
Simon Josefsson |
Subject: |
Re: gendocs.sh patch |
Date: |
Sun, 23 Nov 2003 16:02:25 +0100 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
address@hidden (Karl Berry) writes:
> * util/gendocs.sh: Don't blindly 'rm -rf'. Create HTML tar.gz as
> ${PACKAGE}_html_node.tar.gz instead of $PACKAGE_html_node.tar.gz.
>
> Thanks Simon. Are those the only problems you found with gendocs.sh?
> Any suggestions/problems with the output?
>
> As far as I know, you are the first person to try to use the script
> other than mohit (who wrote it originally) and myself ...
I use it for gnu sasl/libidn/gss/shishi, and it work fine.
Only flaw I have found is the comment:
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
It doesn't seem to be mentioned in my maintain.texi copy.
Hm. I have enhanced it somewhat further for DocBook too. After
adding a switch for it, I think it wouldn't hurt to add this too. It
doesn't work for me now, but it is because docbook2html fails. It
looks harmless for people that don't use --docbook.
Index: gendocs.sh
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/gendocs.sh,v
retrieving revision 1.7
diff -u -p -u -w -r1.7 gendocs.sh
--- gendocs.sh 23 Nov 2003 14:11:27 -0000 1.7
+++ gendocs.sh 23 Nov 2003 14:59:16 -0000
@@ -32,6 +32,10 @@ templateurl="http://savannah.gnu.org/cgi
: ${MAKEINFO="makeinfo"}
: ${TEXI2DVI="texi2dvi"}
: ${DVIPS="dvips"}
+: ${DOCBOOK2TXT="docbook2txt"}
+: ${DOCBOOK2HTML="docbook2html"}
+: ${DOCBOOK2PDF="docbook2pdf"}
+: ${DOCBOOK2PS="docbook2ps"}
: ${GENDOCS_TEMPLATE_DIR="."}
unset CDPATH
@@ -51,6 +55,7 @@ Generate various output formats from PAC
Options:
-o OUTDIR write files into OUTDIR, instead of manual/.
+ --docbook convert to DocBook too (xml, txt, html, pdf and ps).
--help display this help and exit successfully.
--version display version information and exit successfully.
@@ -100,6 +105,7 @@ while test $# -gt 0; do
--help) echo "$usage"; exit 0;;
--version) echo "$version"; exit 0;;
-o) shift; outdir=$1;;
+ --docbook) docbook=yes;;
-*)
echo "$0: Unknown or ambiguous option \`$1'." >&2
echo "$0: Try \`--help' for more information." >&2
@@ -203,6 +209,44 @@ srcfiles=`ls *.texinfo *.texi *.txi 2>/d
tar czfh $outdir/$PACKAGE.texi.tar.gz $srcfiles
texi_tgz_size="`calcsize $outdir/$PACKAGE.texi.tar.gz`"
+if test -n "$docbook"; then
+ echo Generating docbook XML...
+ ${MAKEINFO} -o - --docbook $srcfile > ${srcdir}/$PACKAGE-db.xml
+ docbook_xml_size="`calcsize $PACKAGE-db.xml`"
+ gzip -f -9 -c $PACKAGE-db.xml >$outdir/$PACKAGE-db.xml.gz
+ docbook_xml_gz_size="`calcsize $outdir/$PACKAGE-db.xml.gz`"
+ mv $PACKAGE-db.xml $outdir/
+
+ echo Generating docbook HTML...
+ split_html_db_dir=html_node_db
+ ${DOCBOOK2HTML} -o $split_html_db_dir ${outdir}/$PACKAGE-db.xml
+ (
+ cd ${split_html_db_dir} || exit 1
+ tar -czf ../$outdir/${PACKAGE}_html_node_db.tar.gz -- *.html
+ )
+ html_node_db_tgz_size="`calcsize $outdir/${PACKAGE}_html_node_db.tar.gz`"
+ rm -f $outdir/html_node_db/*.html
+ mkdir -p $outdir/html_node_db
+ mv ${split_html_db_dir}/*.html $outdir/html_node_db/
+ rmdir ${split_html_db_dir}
+
+ echo Generating docbook ASCII...
+ ${DOCBOOK2TXT} ${outdir}/$PACKAGE-db.xml
+ docbook_ascii_size="`calcsize $PACKAGE-db.txt`"
+ mv $PACKAGE-db.txt $outdir/
+
+ echo Generating docbook PS...
+ ${DOCBOOK2PS} ${outdir}/$PACKAGE-db.xml
+ gzip -f -9 -c $PACKAGE-db.ps >$outdir/$PACKAGE-db.ps.gz
+ docbook_ps_gz_size="`calcsize $outdir/$PACKAGE-db.ps.gz`"
+ mv $PACKAGE-db.ps $outdir/
+
+ echo Generating docbook PDF...
+ ${DOCBOOK2PDF} ${outdir}/$PACKAGE-db.xml
+ docbook_pdf_size="`calcsize $PACKAGE-db.pdf`"
+ mv $PACKAGE-db.pdf $outdir/
+fi
+
echo Writing index file...
curdate="`date '+%B %d, %Y'`"
sed \
@@ -219,6 +263,12 @@ sed \
-e "s/%%ASCII_SIZE%%/$ascii_size/g" \
-e "s/%%ASCII_GZ_SIZE%%/$ascii_gz_size/g" \
-e "s/%%TEXI_TGZ_SIZE%%/$texi_tgz_size/g" \
+ -e "s/%%DOCBOOK_HTML_NODE_TGZ_SIZE%%/$html_node_db_tgz_size/g" \
+ -e "s/%%DOCBOOK_ASCII_SIZE%%/$docbook_ascii_size/g" \
+ -e "s/%%DOCBOOK_PS_GZ_SIZE%%/$docbook_ps_gz_size/g" \
+ -e "s/%%DOCBOOK_PDF_SIZE%%/$docbook_pdf_size/g" \
+ -e "s/%%DOCBOOK_XML_SIZE%%/$docbook_xml_size/g" \
+ -e "s/%%DOCBOOK_XML_GZ_SIZE%%/$docbook_xml_gz_size/g" \
-e "s,%%SCRIPTURL%%,$scripturl,g" \
-e "s/%%SCRIPTNAME%%/$prog/g" \
$GENDOCS_TEMPLATE_DIR/gendocs_template >$outdir/index.html