![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 972
Join Date: Jul 2011
Device: Kobo Aura One, Kobo Libra Colour
|
![]()
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?
|
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Create a new EPUB, Right-Click in the Book Browser + "Add Existing Files": 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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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 12:57 PM. Reason: fixing my mistak |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,389
Karma: 203720150
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 43
Karma: 972
Join Date: Jul 2011
Device: Kobo Aura One, Kobo Libra Colour
|
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. |
![]() |
![]() |
![]() |
#7 | ||
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,504
Karma: 5703586
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.
|
![]() |
![]() |
![]() |
#9 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Thanks for taking the time to respond. Hitch |
|
![]() |
![]() |
![]() |
#10 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Then you could keep your template EPUB as a base, and don't have to do all that file reordering. Quote:
Code:
00-cover.xhtml 01-titlepage.xhtml 02-copyright.xhtml 99-backmatter.xhtml |
||
![]() |
![]() |
![]() |
#11 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
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.
|
![]() |
![]() |
![]() |
#12 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
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?? |
![]() |
![]() |
![]() |
#13 |
Witchman
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 628
Karma: 788808
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 08:57 AM. |
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,689
Karma: 24031401
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:
To run the plugin select Plugins > Edit > EpubTemplate. |
![]() |
![]() |
![]() |
#15 |
Zealot
![]() Posts: 106
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 |
![]() |
![]() |
![]() |
Tags |
sigil, template, uuid |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using built-in template functions in a custom template function | ilovejedd | Library Management | 4 | 01-28-2018 12:20 PM |
Template Help in S&R | Tanjamuse | Library Management | 2 | 09-10-2017 06:37 AM |
urn:urn|uuid versus regular(?) uuid | At_Libitum | Library Management | 4 | 10-16-2013 07:47 PM |
Layout & Structure basics | jeffw | Workshop | 8 | 12-19-2007 01:50 AM |
PRS-500 Template & extended font support at Feedbooks (poll) | Hadrien | Sony Reader Dev Corner | 9 | 05-12-2007 12:04 PM |