Hi Josh,
I think the three options to export images/CSS cover all use cases we
can think of right now. If the code handles these three cases, then any
modification later on will be simple; so I think we don't need to worry
about possible other options.
For the image name, is "X" a temporary name or a token to separate file
names with the same paths but different subdirectories? If it's the
latter, it can't be removed. I would either use the directory relative
to the document root as "X" (with slashes replaced by underscores, for
example), or a unique token.
Please make some test cases such as a document containing the following:
root/pics/x.fig
root/pics_x.fig
to check if you can deal with poorly chosen file names for images.
In this case, replacing "/" with "_" is obviously not enough to
distinguish between the two files.
Josh Hieronymus wrote:
Hi everyone,
I'm coming up against two design decisions, and I thought I'd ask the
list to see what others think about them.
First, I'm in the process of implementing an option to save the CSS and
image files generated during XHTML export to separate styles/ and
images/ subdirectories. Currently, the CSS saves to the header of the
generated XHTML file by default, with an option to save to a separate
file in the same directory as the XHTML file, while images always save
to the same directory as the generated XHTML file. I'm trying to decide
how to present the new options to the user. Richard has suggested, and I
would agree, that we can present a single option to use subdirectories
instead of separate options for CSS and for images. As I see it, there
are three options for the users: 1) place CSS in the XHTML header and
save images to the same directory as the XHTML file; 2) save CSS and
images as files in the same directory as the XHTML file; and 3) save CSS
and images as files in separate subdirectories. My questions are whether
to present these options with radio buttons, with a dropdown box, or
something else, and whether to allow other options after all.
Second, images created during XHTML export have filenames such as
X_path_to_original_file_filename.ext, where X is the index of the image
within the file (i.e., X is 0 if the image is the 0th image in the file)
and the original file was /path/to/original/file/filename.ext. This
exposes part of the directory structure of the computer used to create
the LyX file, and should probably be changed. I've thought of three
options that could work: 1) X.ext; 2) filename.ext; and 3)
X_filename.ext. My question is whether to go with one of these options,
or whether to try something else. One concern is that it's necessary to
be able to handle collisions between images with the same filename and
extension.
Thanks,
Josh
--
Regards,
Cyrille Artho - http://artho.com/
Those who will not reason, are bigots, those who cannot,
are fools, and those who dare not, are slaves.
-- George Gordon Noel Byron