Filenames in xHTML output

Pavel Sanda sanda at lyx.org
Sat Aug 1 20:20:36 UTC 2020


On Sat, Aug 01, 2020 at 02:31:33AM -0400, Richard Kimberly Heck wrote:
> On 7/29/20 12:20 PM, Pavel Sanda wrote:
> > On Sun, Jul 19, 2020 at 09:22:33PM -0400, Richard Kimberly Heck wrote:
> >>> when we export xHTML output, the exported images are in the form
> >>> "incrementnumber_path_to_the_image_imagefilename.png".
> >>>
> >>> I'm strugling with two issues:
> >>>
> >>> - the initial number is unstable - e.g. if you insert new fig in the document
> >>>   all subsequent ones suddenly get +1.  after several exports you get bunch of
> >>>   obsolete files which you need to manually delete after each update.
> >>>
> >>> - the filenames tend to unnecesarily disclose directory structures (from what I
> >>>   see full path, not just relative  used.)
> >>>
> >>> Is there some shortcoming if the filenames were hashes of the pictures
> >>> (or filename+hash so one can still makes sense of the files)?
> >>> It would help with both problems.
> >> I used mangled names just because it was relatively easy to do. We can
> >> change it to whatever we want, I suppose.
> > Attached is the patch that mangles graphic filenames by hashes (sha2 of filename+abs path).
> > It omits counting part as I coud not figure out why we use counting at all.
> >
> > Is there case in which xHTML meaningfully exports two pictures with the same
> > path+name but different counter? (I checked the same file with two different
> > size, but that still exports as a single file).
> 
> I doubt it. As I said, I think I used mangled names because I was lazy
> (in a bad way) and did not think about this case. I'd push as is and see
> if anyone complains. Probably worth a note in the 2.4.0 release notes,
> though.

It's in, we will see, I tested that it does not interfere with latex export
and export of xHTML math images, but who knows what remains...

Another change I have in mind is to provide possibility to export whole xhtml
tree into specified subdirectory so the source tree is not that much polluted
by the xHTML files.

Pavel


More information about the lyx-devel mailing list