View Single Post
Old 01-11-2023, 04:42 PM   #14
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
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.
IMHO, the most difficult task for non-programmers is to add sequential ids to all images and to create hyperlinks from the list of illustration chapter to them.

How about creating a simple proof-of-concept plugin that does the following:
  • Look for <img> tags in all xhtml files except for files with cover page semantics.
  • If an image has a <figure> parent, look for a <figcaption> sibling and use its string as the title.
  • If no <figcaption> sibling exists or the <figcaption> string is empty, use the alt attribute value.
  • If no alt attribute exists or it's empty, use the image basename as the title.
  • Add a unique id attribute to the <img> tag, if it doesn't already exist.
  • Add a new loi.xhtml file at the end of the book or update an existing version so that the plugin can be run repeatedly.
  • Add a List of illustrations <h1> tag.
  • Add hyperlinks to all images.
  • Add/update loi NAV/NCX landmark/guide entries.
This should cover most use cases. As a preference only the loi heading string should be needed, so that French users could for example, define it as "Liste des illustrations."

As a test case, you could use Mutiny of the Bounty and story of Pitcairn Island, which already contains a list of illustrations.
Doitsu is offline