01-06-2016, 06:32 AM | #1 |
Voracious reader
Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
avoiding Sigil's meta in content.opf
My boss at work wants me to produce epubs without brands/app names in the content.opf, so every time I deliver a book for the publication, I have to manually remove metas such as:
Code:
<meta name="generator" content="Adobe InDesign" />
Code:
<meta content="0.9.2" name="Sigil version"/>
I was wondering if it would be possible to prevent Sigil from inserting its meta in the first place, so I could avoid the hassle of unpacking the epub, deleting that single line and packing the epub again. Thanks |
01-06-2016, 07:50 AM | #2 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Get the sources, change them and compile your own Sigil. Thats the only way to get rid of Sigil's own entry. The CleanOPF Plugin will eliminate all others, but it cant do anything against Sigil's own entry.
Of course tools can unpack the epub, manipulate the OPF and stick everything together again, but Sigil will regenarate it when you touch the ebook with Sigil again. CleanOPF Plugin Last edited by rubeus; 01-06-2016 at 07:55 AM. |
Advert | |
|
01-06-2016, 10:42 AM | #3 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
The Modify EPUB plugin for calibre can clear ALL non-DC metadata from selected books IIRC...
|
01-06-2016, 10:49 AM | #4 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
But calibre inserts itself again...
|
01-06-2016, 10:52 AM | #5 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You can turn that off in the most trivial of manners. Or copy the file directly.
|
Advert | |
|
01-06-2016, 11:32 AM | #6 |
Grand Sorcerer
Posts: 28,038
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Output plugns can be created to do just about any kind of tweaking, "de-branding," or conversions one could want.
Does your boss ask you to create word-processing documents or spreadsheets with no branding? |
01-06-2016, 11:41 AM | #7 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I agree, the simplest solution is an output plugin that just removes that line from the metadata in the opf. A simple regular expression will easily take care of that.
|
01-06-2016, 03:48 PM | #8 |
Voracious reader
Posts: 56
Karma: 14644
Join Date: Oct 2009
Device: Kobo Aura One, Sony PRS T2, iPhone 6, Cybook Orizon, Cybook Gen3
|
Thanks everyone.
I don't have the programming skills required to build plugins or anything else. I might get the job done with just a regular expression if I had a software that could operate inside epub files. But on the Mac I have at my workplace I can only use indesign and not much else (I've been allowed to install sigil and textwrangler because they're free). I'm lucky that they don't sell them, otherwise it'd be a sure bet |
01-06-2016, 03:56 PM | #9 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Can you get calibre? As I said, you can do a final bulk Modify EPUB on all your EPUBs, to remove all non-DC metadata.
There is even a companion python script which can be used to run the plugin via the CLI against arbitrary *.epub files. |
01-06-2016, 04:46 PM | #10 | |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
And since I haven't figured out how to prevent Calibre from adding its own metadata entries and bookmark files I don't think that metadata handling with Calibre would be such a good idea. @sbin: I've created an alpha version of an Python 3 Sigil output plugin that'll only delete the following Sigil metadata entry: Code:
<meta content="XXX" name="Sigil version"/> from: Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> (The plugin will save the updated file to the Desktop.) Since the plugin will update the .opf file and repack the ePub file and I'm not a programmer, there's a slight possibility that this'll introduce new problems. If you decide to use the plugin in a production environment, you might want to test it with a number of files. I.e. unzip the original epub and the epub generated by this plugin and compare both folders with a diff program. USE AT YOUR OWN RISK! In case you're looking for a plugin, use KevinH's sampleOutput.zip instead. Last edited by Doitsu; 01-30-2016 at 01:53 PM. |
|
01-06-2016, 04:54 PM | #11 | ||
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
(What meta entry? I thought cover is a guide item.) Quote:
Also, the CLI form of the plugin operates on *.epub files, not calibre book records with registered EPUB formats. Last edited by eschwartz; 01-06-2016 at 04:57 PM. |
||
01-06-2016, 05:47 PM | #12 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
cover can be both a guide item and a metadata entry.
Amazon requires the following metadata entry for epub2 books: Code:
<meta name="cover" content="xxxx" />
Sigil will automatically add this entry it a new cover image is generated via Tools > Add Cover... |
01-06-2016, 05:48 PM | #13 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
eschwartz,
Again, this is not a calibre help thread. It is a Sigil help thread. You have brought it up in at least 5 posts! I don't mind having Calibre mentioned once in case it is what the user needs, but please let's keep promotion and discussion of Calibre in a Calibre thread not in a Sigil help thread. For Sigil, an output plugin is the right approach and once I knew the original poster did not know how to write one, I (or as it seems Doitsu in this case!) would have generated one. It is just too simple to worry about. Thanks, KevinH Last edited by KevinH; 01-06-2016 at 06:24 PM. |
01-06-2016, 08:34 PM | #14 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
Looks good to me with one caveat. If an ebook has its own fonts, we should be sure to obfusctate them using the routines in epub_utils.py just to be safe. Sigil does this when writing an epub but otherwise keeps the fonts unobfuscated. I will add a routine to epub _utils that will take care of this automatically. Nicely done! KevinH |
01-06-2016, 09:33 PM | #15 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Four, not five. And the first three were before Doitsu got involved. Existing code shall always trump the philosophical idea of code.
The fourth time was partially a non-calibre query, and part correcting a misapprehension. I don't think either was unreasonable, but particularly the first part... Aside: calibre core is not a Sigil competitor, only the calibre Editor is. A calibre tool for bulk automation existed, I suggested it; Sigil has no CLI; processing dozens of previous books *might* be desired. If I had been on my computer, I would probably want to write a standalone python script for bulk processing. I didnt even realize at first that the OP was using a work computer without calibre. I have the nagging suspicion that such a topic, while equally offtopic in the Sigil forum, would not have set you off like that^^ I did not get a chance to respond at first, and it seems you have toned down your original post, but I had been planning on asking you why you are so aggressive about calibre, esp. the part that has nothing to do with your competitor. Do you wish to make mention of calibre verboten in the Sigil forums? If so, I think it is only fair that Sigil be verboten in the calibre forums. With a little luck, both projects could become a right laughingstock. ... Anyway, I know enough to know when my presence is philosophically offensive. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change opf filename from content.opf to title.opf | northstar7 | Sigil | 3 | 09-23-2013 01:44 PM |
Sigil 0.5.3 keeps rebuilding my content.opf file from scratch | mtrahan | Sigil | 7 | 04-28-2012 10:10 AM |
Sigil corrupting content.opf (0.4, 0.5) | cyana | Sigil | 21 | 02-11-2012 06:25 PM |
Sigil resets edits to content.opf | adv_dp_fan | Sigil | 7 | 09-28-2011 07:50 PM |
ebook-meta --to-opf segfaults | gurmuq | Calibre | 3 | 08-14-2010 10:36 PM |