Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2023, 10:15 AM   #1
GranitStateColin
Member
GranitStateColin began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Jul 2017
Device: none
Calibre EPUB Conversion -- EPUB 3 and HTML vs. XHTML internal file naming

Is there an option in Calibre for when it's converting to EPUB 3 to have it name the content (e.g., index_split_xxxx.html) files with an XHTML extension instead of an HTML extension?

As background, the reason I need EPUB 3 vs just continuing to use EPUB 2 is that EPUB 3 supports some important features in highly structured books that EPUB 2 does not. Nested lists and outlines where individual items may span multiple paragraphs (so counter doesn't update on consecutive paragraphs) are common examples, among others. These are standard features in text books and other nonfiction content. If converting from MS Word, which supports these features without doing anything special, when converting in Calibre, they break in EPUB 2, but work perfectly in EPUB 3.

Functionally, I realize there is no difference between the two file extensions, but the EPUB 3 validation tools used by many distribution companies report the HTML file names as a problem (triggers a warning, not an error, but that's enough that some will block the EPUB). I'm trying to automatically output files without having to go into the editor and manually rename all the content files from index_split_xxx.html to index_split_xxx.xhtml).

The validators seem fine with .HTML or .XHTML in EPUB 2, but only .XHTML in EPUB 3.

If there is no built-in way to do this in Calibre, should I submit this as a feature request, or is there perhaps a tool I could run on the final EPUB file after it's created that could go through and rename those files inside the EPUB?

Last edited by GranitStateColin; 06-03-2023 at 10:17 AM. Reason: fix typo
GranitStateColin is offline   Reply With Quote
Old 06-03-2023, 03:51 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,468
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
As far as I am aware, the current gold standard for checking epubs for error is epubcheck. The requirement for .xhtml as the file extension was dropped by epubcheck several versions back and should no longer cause a warning message.

As for renaming the files, you could use Sigil to select all the .html files in the book browser and then rename them to *.xhtml. I think the calibre ebook-editor has the same functionality but I've never used it for that purpose.

Last edited by DNSB; 06-03-2023 at 03:54 PM.
DNSB is online now   Reply With Quote
Advert
Old 06-03-2023, 08:21 PM   #3
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
In the editor, select any or all files and then right click
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	96
Size:	91.2 KB
ID:	201853  
phossler is offline   Reply With Quote
Old 06-03-2023, 10:17 PM   #4
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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is no requirement for files to have xhtml file extensions in epub 3. That was a bug in epubcheck that has been fixed a long time ago, IIRC.
kovidgoyal is offline   Reply With Quote
Old 06-04-2023, 12:27 AM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,468
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I suspect that this was caused by confusion over what was meant by should.

From the epub 3.2 specification section 2.2 Content Conformance:

Quote:
The XHTML Content Document filename should use the file extension .xhtml.
and from RFC2119:

Quote:
3. SHOULD This word, or the adjective "RECOMMENDED", mean that there
may exist valid reasons in particular circumstances to ignore a
particular item, but the full implications must be understood and
carefully weighed before choosing a different course.
This file properties recommendation was removed in the epub 3.3 specification.

BTW, the various generations of the epub specifications are hardily recommended as a cure for insomnia.
DNSB is online now   Reply With Quote
Advert
Old 06-04-2023, 09:44 AM   #6
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,647
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes the "should" use .xhtml existed in epub 3.0, epub 3.1 and epub 3.2 specs and was erroneously required by epubcheck up untill recently.
KevinH is offline   Reply With Quote
Reply

Tags
conversion, epub 3, xhtml


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming epub file JaniceS1 Calibre 2 05-26-2017 12:19 PM
InDesign - ePub export html files instead of xhtml csavory ePub 5 02-06-2015 01:47 AM
Indesign CS5.5 creates epub with *.html instead of *.xhtml megabusybee ePub 2 12-01-2011 01:48 PM
Quick and dirty conversion of html to epub WITH intra-file links Birdonawire ePub 2 06-18-2010 02:18 AM
Several xhtml/html to a single epub file help. clowe1028 ePub 3 03-21-2010 03:47 AM


All times are GMT -4. The time now is 06:44 PM.


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