Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2023, 05:45 AM   #1
derrickoswald
Junior Member
derrickoswald began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Sigil
non-conforming meta element name="Sigil version"

It seems that Sigil adds a non-conforming meta element to the metadata in the opf file.

It adds (at least in the Linux flatpack Version 2.0.1, Qt 5.15.10 that I have):

<meta name="Sigil version" content="2.0.1"/>

From the ePub 3.3 specification of metadata contents, the meta element can only have attributes:
  • dir [optional]
  • id [optional]
  • property [required]
  • refines [optional]
  • scheme [optional]
  • xml:lang [optional]

Is there a way to have Sigil insert a correct meta element, e.g. creator with a role:

<dc:creator id="software">Sigil 2.0.1</dc:creator>
<meta refines="#software" property="role" scheme="marc:relators">oth</meta>

or any other correct syntax?

I see this previous question from 2016, with an answer that basically says to build the code yourself, or use an output plugin.

For the "build it yourself" choice, I've done that on Linux, patching together various instructions (what a mess that is, but that's a different thread), but sadly, I see no icons in the UI so it's not a usable version.

Would the second "output plugin" option really work? There is only half an interface:
Code:
# metadata get/set

    def getmetadataxml(self):
        # returns a utf-8 encoded metadata xml fragement
        return self._w.getmetadataxml()
but sadly, there is no setmetadataxml() method.
Any suggestions?
derrickoswald is offline   Reply With Quote
Old 11-12-2023, 05:54 AM   #2
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
The simplest workaround for today: use SIGIL_DISABLE_VERSION_META environment to disable the addition of this entry to the metadata.
BeckyEbook is offline   Reply With Quote
Advert
Old 11-12-2023, 06:27 AM   #3
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by derrickoswald View Post
I've done that on Linux, patching together various instructions (what a mess that is, but that's a different thread)
As the person who volunteers his time to keep the Linux build instructions as up to date as possible, you'll want to tread lightly in that different thread (should you choose to start one).
DiapDealer is offline   Reply With Quote
Old 11-12-2023, 07:47 AM   #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,651
Karma: 5433388
Join Date: Nov 2009
Device: many
And epub2 style informational metadata is perfectly legal in epub3 and by spec must be ignored.

So there is no need to change anything. Just disable it using the provided environment variable.

Last edited by KevinH; 11-12-2023 at 07:49 AM.
KevinH is offline   Reply With Quote
Old 11-12-2023, 12:38 PM   #5
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,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by derrickoswald View Post
From the ePub 3.3 specification of metadata contents, the meta element can only have attributes:[...]
Not really, since the specs also mention that the epub3 specs are based on HTML5, and in HTML5, the meta tag may have a name attribute.
Moreover, several of the epub3 sample files endorsed by the EPUB3 Working Group contain <meta name="cover" content="cover"/> entries. For example: Wasteland and Page Blanche

Quote:
Originally Posted by derrickoswald View Post
[...]
Code:
    <dc:creator id="software">Sigil 2.0.1</dc:creator>
    <meta refines="#software" property="role" scheme="marc:relators">oth</meta>
or any other correct syntax?
Even though another well-known epub app does this, technically you can't use <dc:creator> for apps, because that entry should only be used for persons, organizations or services that create documents.

BTW, if you want to find out whether an epub book is valid, simply check it with EPUBCheck.

Quote:
Originally Posted by derrickoswald View Post
[...]but sadly, there is no setmetadataxml() method. Any suggestions?
You're mistaken, there's, of a course, a bk.setmetadataxml() method.
You might want to download the latest version of the Sigil Plugin Framework Guide.
Doitsu is offline   Reply With Quote
Advert
Old 11-13-2023, 10:59 AM   #6
derrickoswald
Junior Member
derrickoswald began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Sigil
Quote:
Originally Posted by BeckyEbook View Post
The simplest workaround for today: use SIGIL_DISABLE_VERSION_META environment to disable the addition of this entry to the metadata.
For the flatpak version, this command does the above:

Code:
flatpak override --user --env=SIGIL_DISABLE_VERSION_META=true com.sigil_ebook.Sigil
derrickoswald is offline   Reply With Quote
Old 11-13-2023, 11:20 AM   #7
derrickoswald
Junior Member
derrickoswald began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Nov 2023
Device: Sigil
Quote:
Originally Posted by Doitsu View Post
You're mistaken, there's, of a course, a bk.setmetadataxml() method.
You might want to download the latest version of the Sigil Plugin Framework Guide.
Sorry, because of the comments in the post from 2016, I was looking at the output container documentation (line 135 of outputcontainer_py.html in Sigil_Plugin_Framework_rev14.epub):
Code:
# metadata get/set

    def getmetadataxml(self):
        # returns a utf-8 encoded metadata xml fragement
        return self._w.getmetadataxml()
which suggests there is no setmetadataxml() method.

Is it not true that an output type plugin is passed an outputcontainer object?
If the outputcontainer object does have a setmetadataxml() method, should the documentation be updated?
If it does not have a setmetadataxml() method, should it?
If not, would an edit type plugin's changes to delete the meta tag not be overridden by the save operation (in the case that environment SIGIL_DISABLE_VERSION_META didn't exist to do this)?
derrickoswald is offline   Reply With Quote
Old 11-13-2023, 11:33 AM   #8
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
setmetadataxml() is for updating the metadata of the existing epub. Since an output plugin can be used to output whatever format a dev desires, there didn't seem to be much sense in providing an epub-only setmetadatxml() method in the output container object. Much like there is no epub-only getmetadataxml() method in the input container object. We couldn't guarantee either would work in all situations.

If one is starting from an epub and ending with an epub, it would make more sense to me to use an Edit Plugin to modify the metadata. If one needs to preserve the original, then Save As and/or Checkpointing would come into play. Using the output container to create a new epub with slightly tweaked metadata seems counter-productive to me.

Last edited by DiapDealer; 11-13-2023 at 02:28 PM.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Epub 2.0.1 validator error: "Error while parsing file: element "img" missing required justin-b-918 ePub 6 04-26-2022 10:02 AM
Moving the "TOC tab" to the Right Panel -- Suggestion for the next version of Sigil? hhtmp88 Sigil 10 08-21-2020 12:56 PM
"Error while parsing file 'element "img" not allowed here" shotsfromthebar Editor 3 03-31-2017 03:53 AM
The element type "p" must be terminated by the matching end-tag "</p>". uieluck ePub 10 02-12-2013 07:04 PM
Any way to apply calibre's "Series" (and number) meta-info from within Sigil...? Vintage Season Sigil 2 07-02-2010 11:35 PM


All times are GMT -4. The time now is 09:00 AM.


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