Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2018, 08:19 PM   #1
Evil Overlord
Member
Evil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enough
 
Posts: 23
Karma: 564
Join Date: Jul 2011
Device: Kindle 3
Question UUID basics & template

I have a stable EPUB that I tend to use as a template. It works fine, but it's only just occurred to me that perhaps it's reusing the same UUID over and over. It hasn't caused me any trouble, but is there a way to use a file as a template, and avoid this problem?
Evil Overlord is offline   Reply With Quote
Old 02-18-2018, 01:02 AM   #2
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 6099999
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Evil Overlord View Post
I have a stable EPUB that I tend to use as a template. It works fine, but it's only just occurred to me that perhaps it's reusing the same UUID over and over. It hasn't caused me any trouble, but is there a way to use a file as a template, and avoid this problem?
You could just create a folder with all the common template files you use.

Create a new EPUB, Right-Click in the Book Browser + "Add Existing Files":

Click image for larger version

Name:	AddExistingFiles.png
Views:	108
Size:	16.4 KB
ID:	162367

I have a folder of common CSS + Front/Backmatter that gets used in every book that I just import in every time. Then I do whatever tweaks are needed.
Tex2002ans is offline   Reply With Quote
Advert
Old 02-18-2018, 04:11 AM   #3
Maui
Connoisseur
Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.Maui ought to be getting tired of karma fortunes by now.
 
Maui's Avatar
 
Posts: 57
Karma: 600000
Join Date: Jan 2018
Device: Galaxy Tab S2
Another way is to copy & paste a new UUID from here

https://www.uuidgenerator.net/

or to write a plugin which is modifying the content.opf.
Maui is offline   Reply With Quote
Old 02-18-2018, 10:43 AM   #4
KevinH
Wizard
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: 3,108
Karma: 1931746
Join Date: Nov 2009
Device: many
Or remove the uuid dc:identifier and the content.opf will create a new one before saving it

Updated: whoops! This only works when the epub in question has obfuscated fonts!

So you would have to edit/add the bookid dc:identifier metadata and make sure it matches what is used in the ncx..

Last edited by KevinH; 02-18-2018 at 01:57 PM. Reason: fixing my mistak
KevinH is offline   Reply With Quote
Old 02-18-2018, 11:07 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 19,327
Karma: 99454782
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I've always meant to knock together an input plugin that would allow a user to select from different predefined template epubs. Just never found the time.
DiapDealer is online now   Reply With Quote
Advert
Old 02-18-2018, 08:40 PM   #6
Evil Overlord
Member
Evil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enoughEvil Overlord will become famous soon enough
 
Posts: 23
Karma: 564
Join Date: Jul 2011
Device: Kindle 3
Thanks, all.

@DiapDealer - I'd love to have that plugin (but have no idea how to make my own).

I think I'll try the UUID-generator site. In the case where this came up, I did try a bunch of things to make Sigil generate a new UUID, but they didn't work (perhaps because I don't have obfuscated fonts). I messed with the opf, but that seemed to make things worse. I finally just transferred all the files to a new EPUB, but reordering a bunch of files is tedious.
Evil Overlord is offline   Reply With Quote
Old 02-19-2018, 02:49 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 7,086
Karma: 63405179
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by KevinH View Post
Or remove the uuid dc:identifier and the content.opf will create a new one before saving it

Updated: whoops! This only works when the epub in question has obfuscated fonts!
May inquiring minds ask why that is?

Quote:
So you would have to edit/add the bookid dc:identifier metadata and make sure it matches what is used in the ncx..
Hitch
Hitch is online now   Reply With Quote
Old 02-19-2018, 09:08 AM   #8
KevinH
Wizard
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: 3,108
Karma: 1931746
Join Date: Nov 2009
Device: many
It is because both official font obfuscation algorithms use the main book uuid identifier value in their obfuscation/deobfuscation process. So saving an epub and obfuscating fonts, will simply destroy the font files without a main book uuid dc:identifier.
KevinH is offline   Reply With Quote
Old 02-19-2018, 01:42 PM   #9
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 7,086
Karma: 63405179
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by KevinH View Post
It is because both official font obfuscation algorithms use the main book uuid identifier value in their obfuscation/deobfuscation process. So saving an epub and obfuscating fonts, will simply destroy the font files without a main book uuid dc:identifier.
Duh, of course. I forget, as we never use font obfuscation; we subset.

Thanks for taking the time to respond.

Hitch
Hitch is online now   Reply With Quote
Old 02-19-2018, 03:51 PM   #10
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,106
Karma: 6099999
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Evil Overlord View Post
I think I'll try the UUID-generator site. In the case where this came up, I did try a bunch of things to make Sigil generate a new UUID, but they didn't work (perhaps because I don't have obfuscated fonts). I messed with the opf, but that seemed to make things worse.
Or another method: Create a new EPUB and just copy over the UUID into the template EPUB's content.opf + toc.ncx.

Then you could keep your template EPUB as a base, and don't have to do all that file reordering.

Quote:
Originally Posted by Evil Overlord View Post
I finally just transferred all the files to a new EPUB, but reordering a bunch of files is tedious.
If you do this so often, you could also number your template files to keep them in sorted order when you "Add Existing Files":

Code:
00-cover.xhtml
01-titlepage.xhtml
02-copyright.xhtml
99-backmatter.xhtml
How many template files are we talking here?
Tex2002ans is offline   Reply With Quote
Old 02-19-2018, 06:55 PM   #11
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,689
Karma: 11766398
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
Instead of using the "Add Existing Files" technique, I simply saved a template epub (with all of my default files) as "template.epub" and set my desktop shortcut to open that file. When it opens I "Save As" with the new name then add any other content.
Turtle91 is offline   Reply With Quote
Old 02-19-2018, 06:59 PM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 1,689
Karma: 11766398
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 6/5/iPad 1,2 & Air/Surface Pro/Kindle PW
It would be nice to have Sigil add a UUID if it is missing from the opf automagically...then I would just save my template without a UUID to force generation.

While I'm wishing... Is it possible to force a "Save As" when opening a specific file...such as one named "Template.epub" or "*.tmp" or somesuch??
Turtle91 is offline   Reply With Quote
Old 02-20-2018, 05:09 AM   #13
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 435
Karma: 768286
Join Date: May 2013
Location: Philippines
Device: Android S5
@Evil Overlord...Try the following if you want a new OPF uuid:

* Load your epub template file into Sigil
* Go to the OPF file and delete the "urn:uuid" part from the the uuid value.
* Then run the IDErrorCheck plugin from the Sigil Plugin Index.

The IDErrorCheck plugin will automatically fix and regenerate many incorrect ID errors in your epub -- including the uuids in the OPF and NCX files if they are incorrectly formatted. If you follow the above advice then this plugin should automatically give you a newly generated OPF uuid in the correct format.

And if the OPF uuid is incorrect then the OPF uuid will be replaced and the NCX uuid will also be replaced with the same uuid as the OPF(and vice versa) -- even though this is no longer an IDPF requirement(If the OPF uuid is different from the NCX uuid, Epupcheck no longer gives an error). I learned this from the Epubcheck developer blog after I requested that they fix the "colon" error msg problem some while ago.

Last edited by slowsmile; 02-20-2018 at 09:57 AM.
slowsmile is offline   Reply With Quote
Old 02-21-2018, 08:50 AM   #14
Doitsu
Wizard
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: 4,344
Karma: 14300083
Join Date: Dec 2010
Device: Kindle PW2
I've recycled code from the ODT import plugin to create a simple epub template plugin and attached a beta version.

What the plugin does is add all files in its resources subfolder to the current epub. (It won't overwrite existing files with the same name, though.)
Simply install the plugin, display its resources folder in the file manager and copy all files that you want to add to the resources folder. (You can't use subfolders.)

To display the resources folder:
  1. Press Windows+R (Run)
  2. Copy and paste %USERPROFILE%\AppData\Local\sigil-ebook\sigil\plugins\EpubTemplate\resources and press Enter. (I've already added a dummy cover page for demonstration purposes.)

To run the plugin select Plugins > Edit > EpubTemplate.
Attached Files
File Type: zip EpubTemplate_v0.1.0.zip (9.9 KB, 41 views)
Doitsu is offline   Reply With Quote
Old 02-21-2018, 03:37 PM   #15
bravosx
Connoisseur
bravosx began at the beginning.
 
Posts: 56
Karma: 10
Join Date: Jun 2014
Location: Poland, Żory
Device: Prestigio PER3464B, Onyx Lynx, Lenovo S5000 i Tab4-8"
@Doitsu thank you for the ingenious plugin.

So far, I've been uploading my own templates each one by one. I inserted my xhtml file templates (cover, titlepage, chapters, endnotes) into the plugin as well as a style file and font. Now with one move I can put it all into Sigil.

I'm very happy.
bravosx
bravosx is offline   Reply With Quote
Reply

Tags
sigil, template, uuid

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 01:20 PM
Template Help in S&R Tanjamuse Library Management 2 09-10-2017 07:37 AM
urn:urn|uuid versus regular(?) uuid At_Libitum Library Management 4 10-16-2013 08:47 PM
Layout & Structure basics jeffw Workshop 8 12-19-2007 02:50 AM
PRS-500 Template & extended font support at Feedbooks (poll) Hadrien Sony Reader Dev Corner 9 05-12-2007 01:04 PM


All times are GMT -4. The time now is 04:12 PM.


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