Enrico Forestieri wrote:
On Thu, Jun 14, 2007 at 04:06:16PM -0400, Richard Heck wrote:
I've added two scripts: a dir_copy.py script, that simply copies the
entire temporary directory over to a subdirectory of the intended output
directory, and a tex4html_copy.py script that copies only .png, .html,
and .css files, these (I'm pretty sure) being the only kinds of files
generated by htlatex. What happens, in the end, then, is that if you
open /path/to/file/LyXFile.lyx and do File>Export>HTML, then you end up
with a (possibly new) directory /path/to/file/LyXFile.html.LyXconv/ and
all the relevant files are in there. Rather, say, than scattered across
/path/to/file/, which would make it a hassle then to move them to a
webserver.
When the html converter is not htlatex, why don't you simply take a
snapshot of the files that are in the temp dir just before calling the
converter, put their names in a file, say "FilesToNotBeCopied", and
then use a html_copy.py script that copies only those files that are
not listed in "FilesToNotBeCopied"?
Yes, we discussed this before, and I thought about that, but there are
two problems. One is that we don't know that none of the files that are
generated by the HTML converter over-write files that are already
present. I don't know that this would be a common problem, but it's
possible. I had proposed trying to check the timestamps to avoid this
problem, but that turned out to be useless, because of the granularity
of the timestamps. The other is that it involves messing with
Converters.cpp, which is what I was kind of trying not to do. And we
don't want to check there what the converter is, so we'd have to
generate this file all the time. I guess there could be a special flag
for that, but that just seems so messy. The better solution would be for
me to find out what latex2html generates, then write a special script
for it.
You may also want to check if one of the `files' created by the
converter is instead a directory and properly copy that, too.
I'll add that to the dir_copy.py program. It actually means I can just
use copytree(), so everything gets simpler.
And then remove the `files' that gets copied, of course.
Yes, of course, if we go that way.
Richard
--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto