|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Enthusiast
![]() Posts: 49
Karma: 26
Join Date: Jan 2022
Device: none
|
Is there a way or plugin/script to generate a list of images in the epub (loi.xhtml)?
loi.xhtml is the list of illustrations that's sometimes included at the end of the epub. In its basic form, it's just a list of hyperlinked images. Is there a way to generate that in Sigil?
I found the same question on StackExchange, but no one answered him. https://ebooks.stackexchange.com/que...-illustrations |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
I assume you mean in an automated manner. If so, the only way I can think of would be by a custom plugin.
If you had to do it manually, you could run Reports and look at the Images report and grab a quick list of links by saving the report as csv and working it into xhtml with a text editor. You might be able to generate a list of img src attribute values using Find and Replace and copy and paste the selected text into a separate document. Or just copy the opf manifest and strip out everything but the images you want and edit it to create the loi.xhtml. There might also be a way to trick the Index tool into creating a set of src urls for images as well. People may have other ideas. Creating a plugin to do that would be very straight forward if you are familiar with plugin programming in python via the plugin interface. So perhaps someone has created one already. |
![]() |
Advert | |
|
![]() |
#3 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,611
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
But Tenome explicitly asked for a way to do this in Sigil?
|
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,344
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Yep. Let's exhaust the "can I do this with Sigil" discussion before we move on to how it might be done with calibre, please. Even the Stack Exchange question they linked to was Sigil specific.
|
![]() |
Advert | |
|
![]() |
#6 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,611
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
If I do a Search in the calibre editor forum with Keyword Sigil by BetterRed I get a list of 98 posts. Many of them start with "Try the Sigil blah blah". I don't recall any reaction from Kovid - other than by implementing the feature I cited in the calibre editor.
BR |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Wouldn't a list of images need a descriptive field for each image? Maybe it could look for a figcaption tag immediately after each image or use that img alt info? A list of links to images as found in spine order would need something to act as the anchor. Unless a thumbnail becomes the descriptor.
Just thinking about what makes sense here. I may even take a shot at a plugin myself if exactly what it entails could be mapped out. |
![]() |
![]() |
#8 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Quote:
So we can not always be responsive to feature requests when all ways of handling the issue in question in Sigil have not yet been explored. So when a person asks for a Sigil solution, we like to explore those options first instead of pointing people to a calibre plugin that may or may not do what the op asked for. Hope that explains things. |
|
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
If there is general interest and if anyone has ideas on how to or where to scrape tags to create title / descriptions for each entry in the loi.xhtml list.
Various possibilities include:
I would be happy to create a plugin to do something like one or two of these. Last edited by KevinH; 01-10-2023 at 07:08 PM. |
![]() |
![]() |
#10 | |
Enthusiast
![]() Posts: 49
Karma: 26
Join Date: Jan 2022
Device: none
|
Quote:
<title id="svgtitle"></title> <desc id="svgdesc"></desc>. but I think if you just allow for customization it'll work out. I don't know how many people would use the plugin, but I do know at least that standardebooks.org utilizes loi.xhtml (you can see an example of how they handle images here) and they make a lot of epubs, so it would be used pretty often I think if they know about it. |
|
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
From that link, there is this example:
Code:
<p>...</p> <figure id="illustration-10"> <img alt="An apple and a pear inside a bowl, resting on a table." src="../images/illustration-10.jpg" epub:type="z3998:photograph"/> <figcaption>The Monk’s Repast</figcaption> </figure> Since the title attribute is allowed on the figure tag, perhaps using that would be best since it would not be seen directly while at the same time allowing its value to be different from the alt value, and if need be longer or shorter than the figcaption itself. The epub editor can easily choose to fill that in however they want before running the plugin. So perhaps the order is look for title attribute on figure tag, and if exists, use it, if not then use the figcaption that is a child of that figure tag. This would probably be helpful to the most people. I would need to see an exact examples with svg wrappers if you wanted that case handled as well. Last edited by KevinH; 01-10-2023 at 10:33 PM. |
![]() |
![]() |
#12 |
Enthusiast
![]() Posts: 49
Karma: 26
Join Date: Jan 2022
Device: none
|
Mine is definitely an edge case, so I wouldn't worry about it. I'm still not even sure if I'll use this format anyway, I'm still fairly new to this and I swear I've seen like 4 different methods for giving images titles/captions/alt text/etc. It's a bit overwhelming.
|
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Took a look at the loi.xhtml spec from standardepubs you linked to and it is a bit of a mess. In general, epub:type attributes should not be placed on body tags as that prevents aria role tags from being added, vocabulary need not be prefixed as xhtml namespaces as no elements or attributes need prefixes in this case, file names as well as locations need not be fixed, the landmarks should be in the nav landmarks section not in the body of the file, etc.
I'd say that standardepubs are a bit over the top with their "standardization". So if I do create a list of illustrations plugin for Sigil, it would not match what standardepubs specifies, as their spec is not correct technically with their use of epub:type on a body tag and is way over the top. It completely ignores what the NAV landmarks section is for. Lets first hear from others about what they think about the idea of a list of illustrations plugin for Sigil and how it should work if we made one. Last edited by KevinH; 01-11-2023 at 10:26 AM. |
![]() |
![]() |
#14 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
How about creating a simple proof-of-concept plugin that does the following:
As a test case, you could use Mutiny of the Bounty and story of Pitcairn Island, which already contains a list of illustrations. |
|
![]() |
![]() |
#15 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,445
Karma: 5703082
Join Date: Nov 2009
Device: many
|
In case of figure or div or svg parent of the img tag, shouldn't the id be added to that parent and not the img tag itself?
Also a template_loi.xhtml might prove useful, don't you think? Last edited by KevinH; 01-11-2023 at 06:25 PM. |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tools Script generate WordWise for all type of ebook | xnohat | Kindle Developer's Corner | 22 | 04-01-2025 04:32 AM |
plugin that can generate NCX/Guide for epub-2 e-readers? | hobnail | Calibre | 4 | 11-29-2019 05:09 PM |
PRS-T2 script to generate collections | stegro | Sony Reader Dev Corner | 8 | 01-05-2018 03:58 AM |
Conversion from xhtml to epub loose svg images | pwessel | Conversion | 3 | 05-24-2015 11:29 PM |
Script to generate thumbnails | Jellby | Bookeen | 0 | 01-02-2010 11:51 AM |