Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 05-05-2015, 04:03 PM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
EPUB3 and DOCTYPE

Hi

I just produced an EPUB3. The xhtml files began this way:

Code:
<!DOCTYPE html>
<html lang="fr-FR" xml:lang="fr-FR" xmlns="http://www.w3.org/1999/xhtml">
 
  <head>
    <title>Title</title>
    <meta charset="UTF-8" />
    <link href="styles/styles.css" rel="stylesheet" type="text/css" />
  </head>
The files validate with Epubcheck as EPUB3.

Once "beautified" with the Calibre editor, it looks this way:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr-FR" xml:lang="fr-FR">

  <head>
    <title>Title</title>
    <link href="styles/styles.css" rel="stylesheet" type="text/css"/>
  </head>
This second file validates also with Epubcheck as EPUB3.
Both files agree on utf8.

However, I would have rather, for EPUB3 files, let this part untouched, as it looks correct (even if the second one is correct too).

Would it be possible to make the above change optional for EPUB3 files?
roger64 is offline   Reply With Quote
Old 05-05-2015, 05:19 PM   #2
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: 28,365
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Calibre doesn't do doctypes. Your choices are to not use Beautify, or to create a regex function/plugin to put them (doctypes) back after Beautifying/Fixing, or to get used to them not being there. The editor's not really epub3 aware to begin with, it just doesn't break an epub3 if you're careful.
DiapDealer is offline   Reply With Quote
Advert
Old 05-05-2015, 05:35 PM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
I know Calibre did not do Doctype for EPUB2. I think one of the points was to get rid of entities which had bothered Sigil users some time and to use utf-8 only. This is the past.

But maybe, it could offer an option for EPUB3 where entities cannot be used? I read this comment from a qualified representative of the IDPF :

Quote:
EPUB 3 uses XHTML5 for content documents, so a doctype isn't required. Adding the HTML5 doctype isn't harmful, either:

<!DOCTYPE html>

It has the benefit of triggering the correct validation in some XML editors, and I suppose could also avoid your content being rendered in quirks mode if it's incorrectly served up as text/html.

As HTML is no longer defined by DTDs, EPUB 3 removed the ability to reference external entities from the doctype. If you include an XHTML 1.1 doctype, you're going to get this error when you validate, as that's what it's attempting to do:
External entities are not allowed in XML. External entity declaration found: %OEBEntities

Last edited by roger64; 05-05-2015 at 05:43 PM.
roger64 is offline   Reply With Quote
Old 05-05-2015, 06:27 PM   #4
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: 28,365
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
But maybe, it could offer an option for EPUB3 where entities cannot be used? I read this comment from a qualified representative of the IDPF :
As I said, calibre doesn't really care if an epub is version 2 or 3. It doesn't seek to find out. It's fairly agnostic and unconcerned.

There is no:
Code:
if is epub3:
  blah, blah
else:
  blah
logic in calibre's codebase (to my knowledge).

Last edited by DiapDealer; 05-05-2015 at 06:31 PM.
DiapDealer is offline   Reply With Quote
Old 05-05-2015, 06:46 PM   #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: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Since the editor doesn't recognize EPUB3 and aparently EPUB3 doesn't recognize doctypes, what is the problem?
(Did EPUB2 recognize them? )

Wouldn't be the first time missing doctypes irritated calibre users, and calibre still doesn't care.

They are unnecessary and their only purpose is basically as a security blanket, so... ignore them?
That was the general idea in EPUB2 as well!

Honestly I don't quite understand what this has to do with EPUB3 specifically anyway, can we file this under "calibre eats my doctypes and I like them so please hands off"?
eschwartz is offline   Reply With Quote
Advert
Old 05-06-2015, 01:52 AM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@echwartz
I am sorry you do not understand and I hope I don't offend anyone.

@DiapDealer
Quote:
There is no:
Code:
if is epub3:
  blah, blah
else:
  blah
logic in calibre's codebase (to my knowledge).
Sometime, this day may come. Why not imagine a converter that ask you if you wish to export either an EPUB2 or an EPUB3. Is it so impossible?

I just ask an "EPUB3 related" question...

Last edited by roger64; 05-06-2015 at 01:56 AM.
roger64 is offline   Reply With Quote
Old 05-06-2015, 06:16 AM   #7
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: 28,365
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
Sometime, this day may come. Why not imagine a converter that ask you if you wish to export either an EPUB2 or an EPUB3. Is it so impossible?
No, not impossible at all. I was just addressing your wish to have calibre's editor treat epub3's differently. The simple answer is that the editor doesn't speak epub3 (other than being able to handle html5 and css3). Until it does officially support epub3, there's little point in asking for it to treat epub3s differently.
DiapDealer is offline   Reply With Quote
Old 05-06-2015, 06:54 AM   #8
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Open-source EPUB3 converters begin to appear (I use one, even if it is still in beta). It's seems natural for me to open the newly created EPUB3 in the Calibre editor.

It's about time to define an EPUB3 policy as there are significant differences in some fields between EPUB3 and EPUB2 (and very few in others). Maybe my question is the first of many others which will come soon.
roger64 is offline   Reply With Quote
Old 05-06-2015, 07:36 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,199
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As I have said before, you do not need doctypes in your ebooks. They serve no useful purpose. That remains just as true for EPUB 3 as it is for EPUB 2. The HTML standard has moved away from DTD (A DTD is what a doctype declares). As such I have no intentions of supporting doctype in calibre, regardless of versions of epub.
kovidgoyal is offline   Reply With Quote
Old 05-06-2015, 09:02 AM   #10
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: 85400180
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 roger64 View Post
@echwartz
I am sorry you do not understand and I hope I don't offend anyone.
I think I understood very well, actually. But don't worry, no offense taken. I was simply trying to solve confusion.

Quote:
@DiapDealer


Sometime, this day may come. Why not imagine a converter that ask you if you wish to export either an EPUB2 or an EPUB3. Is it so impossible?

I just ask an "EPUB3 related" question...
Color me entirely shocked that Kovid's approach to doctypes hasn't changed.
After all, its not like EPUB3 treats them differently than EPUB2 so why would it make a difference?
eschwartz is offline   Reply With Quote
Old 05-06-2015, 10:36 AM   #11
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by kovidgoyal View Post
As I have said before, you do not need doctypes in your ebooks. They serve no useful purpose. That remains just as true for EPUB 3 as it is for EPUB 2. The HTML standard has moved away from DTD (A DTD is what a doctype declares). As such I have no intentions of supporting doctype in calibre, regardless of versions of epub.
Thanks for your reply.

@eschwartz
Quote:
its not like EPUB3 treats them differently than EPUB2
I just asked this question because we do not speak about the same DOCTYPE for EPUB2 and EPUB3.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
is not the same as:
Code:
<!DOCTYPE html>
If I am not wrong,
- with the first (old) one, you can use named entities.
- with the second (new - html5), you can't.

But don't worry, I understand that the Calibre way will just stay the same.

Last edited by roger64; 05-06-2015 at 10:39 AM.
roger64 is offline   Reply With Quote
Old 05-06-2015, 10:43 AM   #12
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: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
They are the same except one includes a reference to the xhtml specifications.

Both are declaring the file to be of type="html" -- useful, that.
eschwartz is offline   Reply With Quote
Old 05-07-2015, 01:35 AM   #13
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

@eschwartz

I am sorry to disagree again with your previous comment. In this precise context, the word html does not mean the same thing: its meaning is related to the Doctype you use

<!DOCTYPE html> goes at the top of every HTML5 page.

The HTML5 word <!DOCTYPE html> means "this page is written in HTML5" as opposed to, say HTML 4.01. (and its three different former Doctypes).

It may be useless for EPUB3 purposes, but it's different.

Last edited by roger64; 05-07-2015 at 01:59 AM. Reason: purpose
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePub3-3D odedta ePub 4 08-13-2014 09:02 AM
Epub3 XHTML Validation epub3 Ramesh Arpitha ePub 5 06-30-2014 08:32 PM
New Errors Converting epub3 -> zip -> epub3 Lola25 ePub 2 11-12-2013 09:37 PM
DOCTYPE ERROR Zenphobia ePub 15 09-20-2013 07:45 PM
Bad DOCTYPE declaration causes BS to crash macpablus Recipes 7 09-04-2011 03:41 PM


All times are GMT -4. The time now is 04:51 AM.


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