From jbuck@synopsys.com Sat Dec  9 23:17:10 MET 1995
Article: 18662 of gnu.misc.discuss
Path: jurix.jura.uni-sb.de!pf2.phil.uni-sb.de!news.coli.uni-sb.de!news.dfn.de!gina.zfn.uni-bremen.de!marvin.pc-labor.uni-bremen.de!news.uni-stuttgart.de!news.rhrz.uni-bonn.de!news.rwth-aachen.de!uni-paderborn.de!golden-gate.owl.de!fu-berlin.de!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!aesop.synopsys.com!news.synopsys.com!jbuck
From: jbuck@synopsys.com (Joe Buck)
Newsgroups: gnu.misc.discuss
Subject: Re: Texinfo -> HTML
Date: 8 Dec 1995 18:13:48 GMT
Organization: Synopsys Inc., Mountain View, CA 94043-4033
Lines: 42
Message-ID: <4a9v8s$2ou@hermes.synopsys.com>
References: <DJ5tFH.4x6@exeter.ac.uk>
NNTP-Posting-Host: deerslayer.synopsys.com

ken@msor.ex.ac.uk writes:
>	is there any way to convert Texinfo source to HTML documents
>(preferably with things like @file commands being translated to links
>although this isn't vital) ?  I tries Info2HTML (a Perl script that
>said it should be installed with the server or some such), when I tried
>to run it on its own it gave an HTML page saying basically that it couldn't
>process the file.

Use texi2html, which gives much better results; it takes the .texi file
as input, not the .info file.  See the URL

http://wwwcn1.cern.ch/dci/texi2html/

But no, it doesn't turn things like @file commands into links.  However,
I managed to make this work by using sed as a preprocessor.

See http://www.cygnus.com/misc/g++FAQ_toc.html
and http://www.cygnus.com/misc/g++FAQ.html

To produce this result from a .texi file, I used the following evil
magic (a portion of a makefile, no warranties on this cruft):

g++FAQ.html:	g++FAQ.texi
	mkdir work
	sed -e 's?@file{\([fth]*p://[^}]*\)}?@strong{<A HREF="\1">\1</A>}?' \
	    -e 's?\([.+a-zA-Z0-9-]*@@[.a-zA-Z0-9-]*[a-zA-Z0-9]\)?<A HREF="mailto:\1">\1</A>?' \
	    g++FAQ.texi > work/g++FAQ.texi
	cd work; texi2html g++FAQ.texi
	mv work/*.html .
	rm -r work

What those hairy regular expressions do is convert things of the form
@file{ftp://...} and @file{http://...} into hyperlinks, and also
convert email addresses into mailto hyperlinks.

Ideally, the texinfo input language should be extended to have new
entries, something like @url{...} and @email{...}, which would be
generated appropriately in info, TeX-typeset, and HTML output.

-- 
-- Joe Buck 	<jbuck@synopsys.com>	(not speaking for Synopsys, Inc)




