Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2016, 05:32 AM   #1
sbin
Voracious reader
sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.
 
sbin's Avatar
 
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" />
or
Code:
<meta content="0.9.2" name="Sigil version"/>
It may be silly, but this is what I'm asked for.

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
sbin is offline   Reply With Quote
Old 01-06-2016, 06:50 AM   #2
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
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 06:55 AM.
rubeus is offline   Reply With Quote
Advert
Old 01-06-2016, 09:42 AM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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...
eschwartz is offline   Reply With Quote
Old 01-06-2016, 09:49 AM   #4
rubeus
Banned
rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.rubeus ought to be getting tired of karma fortunes by now.
 
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
But calibre inserts itself again...
rubeus is offline   Reply With Quote
Old 01-06-2016, 09:52 AM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Advert
Old 01-06-2016, 10:32 AM   #6
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: 27,922
Karma: 198500000
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?
DiapDealer is online now   Reply With Quote
Old 01-06-2016, 10:41 AM   #7
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: 8,102
Karma: 5450184
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.
KevinH is offline   Reply With Quote
Old 01-06-2016, 02:48 PM   #8
sbin
Voracious reader
sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.sbin is less competitive than you.
 
sbin's Avatar
 
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).


Quote:
Originally Posted by DiapDealer View Post
Does your boss ask you to create word-processing documents or spreadsheets with no branding?
I'm lucky that they don't sell them, otherwise it'd be a sure bet
sbin is offline   Reply With Quote
Old 01-06-2016, 02:56 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Old 01-06-2016, 03:46 PM   #10
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,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by eschwartz View Post
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.
Removing all non-DC metadata will also remove the cover image metadata entry that some apps use.
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"/>
(It'll also change the doctype of XHTML files of epub files saved with Sigil 0.8.x.)

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">
to

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">
Install the plugin as usual and select it via Plugins > Output > DeleteSigilMetadata.

(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 12:53 PM.
Doitsu is offline   Reply With Quote
Old 01-06-2016, 03:54 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by Doitsu View Post
Removing all non-DC metadata will also remove the cover image metadata entry that some apps use.
Interesting point! That should be considered a bug in the plugin.
(What meta entry? I thought cover is a guide item.)

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.
Not a problem, bookmarks are only added by E-Book Viewer, and both can be disabled in Preferences.

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 03:57 PM.
eschwartz is offline   Reply With Quote
Old 01-06-2016, 04:47 PM   #12
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,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by eschwartz View Post
(What meta entry? I thought cover is a guide item.)
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" />
(xxx is the manifest id of the cover image.)

Sigil will automatically add this entry it a new cover image is generated via Tools > Add Cover...
Doitsu is offline   Reply With Quote
Old 01-06-2016, 04:48 PM   #13
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: 8,102
Karma: 5450184
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 05:24 PM.
KevinH is offline   Reply With Quote
Old 01-06-2016, 07:34 PM   #14
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: 8,102
Karma: 5450184
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
KevinH is offline   Reply With Quote
Old 01-06-2016, 08:33 PM   #15
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change opf filename from content.opf to title.opf northstar7 Sigil 3 09-23-2013 12:44 PM
Sigil 0.5.3 keeps rebuilding my content.opf file from scratch mtrahan Sigil 7 04-28-2012 09:10 AM
Sigil corrupting content.opf (0.4, 0.5) cyana Sigil 21 02-11-2012 05:25 PM
Sigil resets edits to content.opf adv_dp_fan Sigil 7 09-28-2011 06:50 PM
ebook-meta --to-opf segfaults gurmuq Calibre 3 08-14-2010 09:36 PM


All times are GMT -4. The time now is 06:46 AM.


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