Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-23-2024, 03:00 PM   #1
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 54
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
"Add blank .smil file?"

This is probably too niche for anyone to spend much time on, but:

I do lots of readaloud (media-overlay) epubs, and sometimes have to manually create a new .smil file so one of the XHTML files can have synchronized word highlighting.

Currently I unzip the epub, duplicate one of the .smils, rename it XYZ, rezip the epub, manually add the XYZ filename to the manifest, associate it with the appropriate XHTML file in the opf, use one of the existing <par>s from the original .smil as templates to create new ones, add ids to the appropriate word spans to the XHTML to match what the <par>s are calling for in the XYZ .smil, and probably a few things I'm forgetting.

This takes ten minutes or something, so it's not like it's fatal, but can some part of this process be automated? Maybe something like select "Add blank SMIL file," then the dialogue is something like: "Ask me what XHTML this should be associated with, then give me a generic <par> line that has that XHTML in it with a generic fragment identifier," it gets added to the opf in the right ways, and then I can take it manually from there?
noteon is offline   Reply With Quote
Old 05-23-2024, 03:06 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,745
Karma: 5446592
Join Date: Nov 2009
Device: many
Why not just create a template empty .smil file and use AddExisting to add that? If that is insufficient, then maybe select the xhtml file you want to use in BookBrowser and call a plugin to create the smil file with a par sample and have it add the things to the current epub.

I think a plugin would be the best approach since this is typically not something most epub devs do.

I and other plugin devs can help you take a stab at it.

Last edited by KevinH; 05-23-2024 at 03:10 PM.
KevinH is offline   Reply With Quote
Advert
Old 05-23-2024, 03:15 PM   #3
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 54
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
That makes sense.

A template empty .smil would get partway there, but there's still the file association stuff with multiple new ids in the opf, which makes my eyes cross. EDIT: Oh, that's already in your answer, NEVER MIND.

Where's the So You've Decided A Plugin Should Be Easy page?
noteon is offline   Reply With Quote
Old 05-23-2024, 03:25 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,745
Karma: 5446592
Join Date: Nov 2009
Device: many
The best way to learn to create Sigil plugins is to examine the code of existing plugins. There is also a plugin developer manual epub the can be downloaded from here:

https://github.com/Sigil-Ebook/Sigil...ork_rev14.epub

But I am happy to help get you started as I think this could be a useful plugin/addition for Sigil.

All we need is an example epub with a single chapter and its associated correct smil file. That way we can see exactly what you are trying to achieve.

It has just been too long since I played around with the smil spec to remember how they are integrated into the opf and what the contents should look like.

If you can attach one here, I would be happy to create a simple plugin example for you to modify and fix as you like. You can then add a gui to it to collect any extra information you need on the fly.

Last edited by KevinH; 05-23-2024 at 03:27 PM.
KevinH is offline   Reply With Quote
Old 05-23-2024, 03:33 PM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,745
Karma: 5446592
Join Date: Nov 2009
Device: many
Here is a silly sample plugin that tries to show examples of most of the basic features of Sigil's plugin interface. It may be a good starting point.

https://www.mobileread.com/forums/sh...d.php?t=251452

Grab testme3_v031.zip from the first post in that sticky thread.
KevinH is offline   Reply With Quote
Advert
Old 05-23-2024, 03:45 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,745
Karma: 5446592
Join Date: Nov 2009
Device: many
Actually my ePub3-itizer plugin has a bunch of old code to parse and update existing smil files that is now commented out but could be brought back to life and used.
KevinH is offline   Reply With Quote
Old 05-23-2024, 04:29 PM   #7
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 54
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Quote:
Originally Posted by KevinH View Post
If you can attach one here, I would be happy to create a simple plugin example for you to modify and fix as you like. You can then add a gui to it to collect any extra information you need on the fly.
Wow, that is a very generous offer, thank you! I'll get you something after this job is shipped.

I used the ePub3-itizer all the time for a while, there. Many headaches avoided.
noteon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep the full file name and not add "unknown" ? bounce Calibre 7 08-27-2021 06:47 PM
Adding a new format to "add an empty file..." ownedbycats Calibre 4 07-19-2020 11:20 AM
using "Add Blank SVG Image" dhdurgee Sigil 3 11-07-2015 01:47 PM
Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" therealjoeblow Calibre 15 07-25-2011 03:14 PM
"Add new format" to text file without extension myudkowsky Calibre 4 11-25-2010 02:00 PM


All times are GMT -4. The time now is 02:42 PM.


MobileRead.com is a privately owned, operated and funded community.