bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: images subdirectories in epub


From: Per Bothner
Subject: Re: images subdirectories in epub
Date: Wed, 3 Aug 2022 15:08:09 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0



On 8/3/22 14:01, Patrice Dumas wrote:
On Wed, Aug 03, 2022 at 12:16:04PM -0700, Per Bothner wrote:
Again - why? More specifically: why are you putting the html/xhtml file in a
separate xhtml subdirectory?  If you get rid of that, it seems you avoid the 
problem.

No, the problem is not avoided, because the additional image
subdirectory is still not created.

Agreed: when I generate HTML my Makefile has to explicitly copy over the image 
files.
It would probably be better to have tex2any do that by default (or as an option
if we're concerned about compatibility).  Even more-so for epub: Whether 
texi2any
creates the epub file directly or uses a separate script, that script needs to 
copy
over the image files before creating the epub archive.

As to why the xhtml file is not put directly in the EPUB directory
(which could be named differently), it is to have a structure that I find
cleaner.  That way in the EPUB directory, there are only the opf file and
directories, xhtml for the manual files, images for the images and
something like js for the javascript (and css for specific CSS files,
but I am not sure it is used like that in practice, but it would fit well
in this setup). ...

However, if this structure is not right, I can change it, it is in no
way dictated by the standard, but I would like to have more substantive
arguments.

The primary use-case for generating epub is to support e-readers, but another
useful application is as a compressed container format for the html represention
of a manual.  For example an application or server could store the manual
as an epub file, and then map http requests to members of the epub archive.
(A server doesn't even have to uncompress the member, but can send it
compressed to a browser that understands gzip compression.  I implemented
this for the libwebsockets library.)

A related use-case is to use epub as a distribution format for manuals.
Installation is then just a matter of running unzip.

In these applications, it is useful that the structure of the epub archive
mirrors the preferred layout of a directory for web-browsing. This also
reduces the risk of errors and inconsistencies, I believe.

(For these applications it is also preferable that files be valid html and
have the .html extension, rather than .xhtml - but that is a separate 
discussion.)

The "index.html" (or index.xhtml) file should be in the top directory.
It is easier and traditionally if the other pages are in the same directory.
Similarly, images should either be in the same directory as index.html
(and the other html files) or in a sub-directory - *not* in a sibling directory.
--
        --Per Bothner
per@bothner.com   http://per.bothner.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]