Enrico Forestieri wrote:
On Thu, Jun 14, 2007 at 06:49:17PM -0400, Richard Heck wrote:
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.
On POSIX systems the granularity is 1 second, on Windows with FAT it
is 2 seconds. So, what about creating a file, taking its timestamp,
waiting for 2 seconds and then calling the converter?
This seems an awful waste of time. I suppose if we were doing this in
the background it wouldn't be so bad, but that's not how it's presently
done. But anyway, there's another and to my mind fatal problem, the one
that got me going this direction in the first place. Suppose you View
HTML before you Export HTML. Then all the files that the converter will
generate are already present, and nothing will be exported. I'm sure
there's some way to work around that, but, again, it seems to me that
it's getting very messy for what is, in reality, a very special case.
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.
This is wrong, as you also have to take into account tth, hevea and I am
sure that an user could use some other converter that you don't know
about.
Right, of course. But we can check for the ones we do know about and
take appropriate action. That said, since we're just copying on the
basis of extensions, maybe there should be an extra argument for that,
and then we don't have to write extra scripts. The copier just becomes:
python -tt ext_copier.py -e png,css,html $$i $$o.
What do you think?
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