[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add support for generating HTML docs a` la PDF, etc., revision 2
From: |
Alexandre Duret-Lutz |
Subject: |
Re: Add support for generating HTML docs a` la PDF, etc., revision 2 |
Date: |
Tue, 04 Mar 2003 23:44:47 +0100 |
User-agent: |
Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) |
>>> "Richard" == Richard Dawe <address@hidden> writes:
Richard> Hello.
Richard> Below is a revised version of the patch to add support for an 'html'
Richard> target for generating HTML using makeinfo. Changes:
Richard> * NEWS entry;
Richard> * does not assume --no-split;
Richard> * will clean up correctly if user sets MAKEINFOFLAGS = --no-split;
Richard> * the test checks with & without --no-split and runs distcheck.
Richard> I'm not happy about one change in cleaning up the HTML: I changed
Richard> an "rm -f" to "rm -rf" for %TEXICLEAN%. This seems a bit too much
Richard> to me, but it's probably OK.
I'm not really worried either, except that anyone reading
texibuild.am will be puzzled. Let's add a comment...
Richard> I also looked at adding tests for texi2html, texi2www,
Richard> but the options they support don't look like makeinfo
Richard> at all. I think Alexandre suggested supporting them
Richard> using 'html-am'.
In fact I was merely suggesting that we use something like
$(MAKEINFO_html) and $(MAKEINFO_htmlFLAGS) instead of $(MAKEINFO)
and $(MAKEINFOFLAGS). This allow you the override the tool
used to produce html without affecting *.info rules.
Of course, we'd need better names :) Anyway, we can do this later.
And sure, html-am will do the trick too.
Here is a revised version of this patch, with the following changes.
* NEWS entry augmented
* test case augmented (distcheck was a stupid idea of mine:
it tests nothing since distcheck doesn't call `make html')
* skip the test if `makeinfo --html' is not supported
* missing bits in initialize_per_input (discovered these
by adding `SUBDIRS=rec' to the test case, and running
it with BSD make)
Does it still looks ok?
2003-03-04 Richard Dawe <address@hidden>
* automake.in (output_texinfo_build_rules, handle_texinfo_helper,
initialize_per_input): Add infrastructure for generating HTML
documentation from texinfo source.
* lib/am/texinfos.am: Add rules for building HTML documentation
from texinfo source.
* lib/am/texibuild.am: Likewise.
* automake.texi (Texinfo): Document rules for building
HTML documentation from texinfo source.
* NEWS: Mention the 'html' target.
* tests/txinfo21.test: New file.
* tests/Makefile.am (TESTS): Add txinfo21.test.
* tests/defs.in: Handle required=makeinfo-html.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.205
diff -u -r1.205 NEWS
--- NEWS 26 Feb 2003 20:53:47 -0000 1.205
+++ NEWS 4 Mar 2003 22:42:36 -0000
@@ -57,6 +57,13 @@
* Texinfo rules back up and restore info files when makeinfo fails.
+* Texinfo rules now support the `html' target.
+ Running this requires Texinfo 4.0 or greater.
+ `html' is a new recursive target, so if your package mixes
+ hand-crafted `Makefile.in's with Automake-generated `Makefile.in's,
+ you should adjust the former to support (or ignore) this target so
+ that `make html' recurses successfully.
+
New in 1.7:
* Autoconf 2.54 is required.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1437
diff -u -r1.1437 automake.in
--- automake.in 26 Feb 2003 20:53:48 -0000 1.1437
+++ automake.in 4 Mar 2003 22:42:44 -0000
@@ -766,6 +766,8 @@
'ps-am' => [],
'info' => [],
'info-am' => [],
+ 'html' => [],
+ 'html-am' => [],
# Installing/uninstalling.
'install-data-am' => [],
@@ -3763,7 +3765,7 @@
MAKEINFOFLAGS => $makeinfoflags,
DEPS => "@deps",
DIRSTAMP => $dirstamp);
- return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps");
+ return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
}
@@ -3780,7 +3782,8 @@
my @texis = &variable_value_as_list_recursive ('info_TEXINFOS', 'all');
- my (@info_deps_list, @dvis_list, @pdfs_list, @pss_list, @texi_deps);
+ my (@info_deps_list, @texi_deps);
+ my (@dvis_list, @pdfs_list, @pss_list, @htmls_list);
my %versions;
my $done = 0;
my @texi_cleans;
@@ -3833,6 +3836,7 @@
push (@dvis_list, $infobase . '.dvi');
push (@pdfs_list, $infobase . '.pdf');
push (@pss_list, $infobase . '.ps');
+ push (@htmls_list, $infobase . '.html');
# If a vers*.texi file is needed, emit the rule.
if ($vtexi)
@@ -3926,6 +3930,7 @@
&define_variable ("DVIS", "@dvis_list", INTERNAL);
&define_variable ("PDFS", "@pdfs_list", INTERNAL);
&define_variable ("PSS", "@pss_list", INTERNAL);
+ &define_variable ("HTMLS", "@htmls_list", INTERNAL);
# This next isn't strictly needed now -- the places that look here
# could easily be changed to look in info_TEXINFOS. But this is
# probably better, in case noinst_TEXINFOS is ever supported.
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.326
diff -u -r1.326 automake.texi
--- automake.texi 26 Feb 2003 21:05:12 -0000 1.326
+++ automake.texi 4 Mar 2003 22:42:52 -0000
@@ -4005,11 +4005,11 @@
@vindex info_TEXINFOS
Automake generates rules to build @file{.info}, @file{.dvi}, @file{.ps},
-and @file{.pdf} files from your Texinfo sources. The @file{.info} files
-are built by @code{make all} and installed by @code{make install}
-(unless you use @code{no-installinfo}, see below). The other files can
-be built on request by @code{make dvi}, @code{make ps}, and @code{make
-pdf}.
address@hidden and @file{.html} files from your Texinfo sources.
+The @file{.info} files are built by @code{make all} and installed
+by @code{make install} (unless you use @code{no-installinfo}, see below).
+The other files can be built on request by @code{make dvi}, @code{make ps},
address@hidden pdf} and @code{make html}.
@cindex Texinfo flag, VERSION
@cindex Texinfo flag, UPDATED
@@ -5276,6 +5276,8 @@
@trindex ps-local
@trindex pdf
@trindex pdf-local
address@hidden html
address@hidden html-local
@trindex check
@trindex check-local
@trindex install
@@ -5296,9 +5298,9 @@
@trindex installcheck-local
The targets that support a local version are @code{all}, @code{info},
address@hidden, @code{ps}, @code{pdf}, @code{check}, @code{install-data},
address@hidden, @code{uninstall}, @code{installdirs},
address@hidden and the various @code{clean} targets
address@hidden, @code{ps}, @code{pdf}, @code{html}, @code{check},
address@hidden, @code{install-exec}, @code{uninstall},
address@hidden, @code{installcheck} and the various @code{clean} targets
(@code{mostlyclean}, @code{clean}, @code{distclean}, and
@code{maintainer-clean}). Note that there are no
@code{uninstall-exec-local} or @code{uninstall-data-local} targets; just
Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.16
diff -u -r1.16 texibuild.am
--- lib/am/texibuild.am 25 Feb 2003 20:07:33 -0000 1.16
+++ lib/am/texibuild.am 4 Mar 2003 22:42:56 -0000
@@ -73,6 +73,11 @@
?GENERIC? $(TEXI2PDF) %SOURCE%
?!GENERIC? $(TEXI2PDF) -o $@ `test -f '%SOURCE%' || echo
'$(srcdir)/'`%SOURCE%
+?GENERIC?%SOURCE_SUFFIX%.html:
+?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
+ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) --html %MAKEINFOFLAGS%
\
+ -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+
## If we are using the generic rules, we need separate dependencies.
## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
## rules.)
@@ -82,4 +87,5 @@
if %?GENERIC%
%DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
%DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
+%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
endif %?GENERIC%
Index: lib/am/texinfos.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texinfos.am,v
retrieving revision 1.101
diff -u -r1.101 texinfos.am
--- lib/am/texinfos.am 19 Feb 2003 19:12:55 -0000 1.101
+++ lib/am/texinfos.am 4 Mar 2003 22:42:57 -0000
@@ -59,18 +59,21 @@
$(DVIPS) -o $@ $<
endif %?LOCAL-TEXIS%
-.PHONY: info info-am dvi dvi-am pdf pdf-am
+.PHONY: info info-am dvi dvi-am pdf pdf-am html html-am
if %?SUBDIRS%
RECURSIVE_TARGETS += info-recursive dvi-recursive pdf-recursive ps-recursive
+RECURSIVE_TARGETS += html-recursive
.PHONY info: info-recursive
.PHONY dvi: dvi-recursive
.PHONY pdf: pdf-recursive
.PHONY ps: ps-recursive
+.PHONY html: html-recursive
else !%?SUBDIRS%
info: info-am
dvi: dvi-am
pdf: pdf-am
ps: ps-am
+html: html-am
endif !%?SUBDIRS%
if %?LOCAL-TEXIS%
@@ -78,11 +81,13 @@
dvi-am: $(DVIS)
pdf-am: $(PDFS)
ps-am: $(PSS)
+html-am: $(HTMLS)
else ! %?LOCAL-TEXIS%
info-am:
dvi-am:
pdf-am:
ps-am:
+html-am:
endif ! %?LOCAL-TEXIS%
@@ -242,7 +247,9 @@
.PHONY: mostlyclean-aminfo
mostlyclean-am: mostlyclean-aminfo
mostlyclean-aminfo:
- -rm -f %TEXICLEAN%
+## Use `-rf', not just `-f', because %TEXICLEAN% also contains
+## any directory created by `makeinfo --html'.
+ -rm -rf %TEXICLEAN%
.PHONY: maintainer-clean-aminfo
maintainer-clean-am: maintainer-clean-aminfo
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.475
diff -u -r1.475 Makefile.am
--- tests/Makefile.am 26 Feb 2003 20:53:48 -0000 1.475
+++ tests/Makefile.am 4 Mar 2003 22:42:57 -0000
@@ -429,6 +429,7 @@
txinfo18.test \
txinfo19.test \
txinfo20.test \
+txinfo21.test \
transform.test \
unused.test \
vars.test \
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.12
diff -u -r1.12 defs.in
--- tests/defs.in 20 Feb 2003 12:28:37 -0000 1.12
+++ tests/defs.in 4 Mar 2003 22:42:58 -0000
@@ -106,6 +106,11 @@
echo "$me: running makedepend -f-"
( makedepend -f- ) || exit 77
;;
+ makeinfo-html)
+ # Make sure makeinfo understands --html.
+ echo "$me: running makeinfo --html --version"
+ ( makeinfo --html --version ) || exit 77
+ ;;
non-root)
# Skip this test case if the user is root.
# We try to append to a read-only file to detect this.
Index: tests/txinfo21.test
===================================================================
RCS file: tests/txinfo21.test
diff -N tests/txinfo21.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/txinfo21.test 4 Mar 2003 22:42:58 -0000
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test support for building HTML documentation.
+
+required='makeinfo-html tex'
+. ./defs || exit 1
+
+set -e
+
+cat >>configure.in <<EOF
+AC_CONFIG_FILES([rec/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am << 'END'
+SUBDIRS = rec
+info_TEXINFOS = main.texi sub/main.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden
+END
+
+mkdir sub
+mkdir rec
+cp main.texi sub/main.texi
+cp main.texi rec/main.texi
+
+cat > rec/Makefile.am << 'END'
+info_TEXINFOS = main.texi
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+$MAKE
+
+# Test production of split-per-node HTML.
+$MAKE html
+test -d main.html
+test -d sub/main.html
+test -d rec/main.html
+$MAKE clean
+test ! -d main.html
+test ! -d sub/main.html
+test ! -d rec/main.html
+
+# Test production of a single HTML file.
+MAKEINFOFLAGS=--no-split $MAKE -e html
+test -f main.html
+test -f sub/main.html
+test -f rec/main.html
+$MAKE clean
+test ! -f main.html
+test ! -f sub/main.html
+test ! -f rec/main.html
--
Alexandre Duret-Lutz
- Re: Add support for generating HTML docs a` la PDF, etc., revision 2,
Alexandre Duret-Lutz <=