Mobileread
Two questions
#1  Gregg Bell 10-20-2018, 06:14 PM
1) How come some of the chapters in my novels in Sigil have the book title in the title tags on every file and others don't? (I've made them identically and not manually added anything to the title tags.) Does it matter if the title is in those chapter files?

2) I have removed the language ending of that tag that begins <html xmlns... and I have also removed the language stuff from the <body> tag. Is this okay the way I have it? Thanks.image »
Selection_048.png 
Reply 

#2  Tex2002ans 10-20-2018, 07:25 PM
First, I wanted to point out KevinH's Sigil Plugin, "Access-Aide".

It helps fill blank <title>s (using the first heading in the document) + add lang + xml:lang to your <html>.

Quote Gregg Bell
1) How come some of the chapters in my novels in Sigil have the book title in the title tags on every file and others don't? (I've made them identically and not manually added anything to the title tags.)
Did you convert using Calibre or something else?

Sometimes the tools put gibberish in the <title> (like InDesign puts the filenames... you can safely delete those):

Code
<title>Chapter_1.xhtml</title>
<title>abc123456890_book_EPUB.epub</title>
Sometimes tools will put some info (like Book Title, Chapter Title, Author, [...]):

Code
<title>Gregg Bell - Dupes-A-Navy: Chapter 1</title>


Quote Gregg Bell
Does it matter if the title is in those chapter files?
It doesn't hurt if it's blank, but it could be helpful IF there is meaningful info in the <title>.

Something like:

Code
<head>	<title>Chapter One: The Beginning</title>	<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body> <h2>Chapter One: The Beginning</h2>
would be helpful for Accessibility reasons:

Technical Side Note: WCAG has a few articles on how to create good <title>s:

G88: Providing descriptive titles for Web pages
H25: Providing a title using the title element
Understanding SC 2.4.2

For example, G88 gives this reasoning/recommendation for good <title>s:

Spoiler Warning below






Quote
Descriptive titles help users find content, orient themselves within it, and navigate through it. A descriptive title allows a user to easily identify what Web page they are using and to tell when the Web page has changed. The title can be used to identify the Web page without requiring users to read or interpret page content. Users can more quickly identify the content they need when accurate, descriptive titles appear in site maps or lists of search results. When descriptive titles are used within link text, they help users navigate more precisely to the content they are interested in.

The title of each Web page should:


Quote Gregg Bell
2) I have removed the language ending of that tag that begins <html xmlns... and I have also removed the language stuff from the <body> tag. Is this okay the way I have it?
Again, having the lang + xml:lang there doesn't hurt.

An EPUB Reader should be able to still pull the book's language from the EPUB's Metadata (Tools > Metadata Editor), and grab your dc:language (in your case, "en" (English) or "en-US" (English (United States)).

BUT, again, think screen reader or someone converting to a different format. They may pull the HTML out separately and read it elsewhere.

So you may want to add the lang + xml:lang to your HTML as well.

This doesn't hurt:

Code
<html xmlns="http://www.w3.org/1999/xhtml">
but this could be made more helpful:

Code
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
Another way of explaining: The EPUB Metadata tells the reader "This EPUB is in US English", while the HTML tells the reader "This specific HTML page is in US English".

(Imagine there could be a US English book, but it has a British English chapter within it.)

Technical Side Note:

H57: Using language attributes on the html element

H57 explains why lang + xml:lang on <html> are important:

Spoiler Warning below






Quote
The objective of this technique is to identify the default language of a document by providing the lang and/or xml:lang attribute on the html element.

Identifying the language of the document is important for a number of reasons:


So it could help:

Again, an EPUB Reader SHOULD still be able to pull it from the EPUB Metadata... but not all tools will be reading your EPUB in EPUB. :P
Reply 

#3  Gregg Bell 10-20-2018, 07:36 PM
Quote Tex2002ans
First, I wanted to point out KevinH's Sigil Plugin, "Access-Aide".

It helps fill blank <title>s (using the first heading in the document) + add lang + xml:lang to your <html>.



Did you convert using Calibre or something else?

Sometimes the tools put gibberish (like InDesign puts the filenames in there... you can safely delete those):

Code
<title>Chapter_1.xhtml</title>
<title>abc123456890_book_EPUB.epub</title>
Sometimes tools will put some info (like Book Title, Chapter Title, Author, [...]) in the <title></title>:

Code
<title>Gregg Bell - Dupes-A-Navy: Chapter 1</title>




It doesn't hurt if it's blank, but it could be helpful IF there is meaningful info in the <title>.

Something like:

Code
<head>	<title>Chapter One: The Beginning</title>	<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body> <h2>Chapter One: The Beginning</h2>
would be helpful for Accessibility reasons:

Technical Side Note: WCAG has a few articles on how to create good <title>s:

G88: Providing descriptive titles for Web pages
H25: Providing a title using the title element
Understanding SC 2.4.2

For example, G88 gives this reasoning/recommendation for good <title>s:





Again, having the lang + xml:lang there doesn't hurt.

An EPUB Reader should be able to still pull the book's language from the EPUB's Metadata (Tools > Metadata Editor), and grab your dc:language (in your case, "en" (English) or "en-US" (English (United States)).

BUT, again, think screen reader or someone converting to a different format. They may pull the HTML out separately and read it elsewhere.

So you may want to add the lang + xml:lang to your HTML as well.

This doesn't hurt:

Code
<html xmlns="http://www.w3.org/1999/xhtml">
but this could be made more helpful:

Code
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
Another way of explaining: The EPUB Metadata tells the reader "This EPUB is in US English", while the HTML tells the reader "This specific HTML page is in US English".

(Imagine there could be a US English book, but it has a British English chapter within it.)

Technical Side Note:

H57: Using language attributes on the html element

H57 explains why lang + xml:lang on <html> are important:



So it could help Braille conversion, TTS, Dictionary support, Automatic Translation, [...].

Again, an EPUB Reader SHOULD still be able to pull it from the EPUB Metadata... but not all tools will be reading your EPUB in EPUB. :P
Wow. Super post. Thanks a ton, Tex. I really appreciate it!
Reply 

#4  DiapDealer 10-21-2018, 07:51 AM
Quote Gregg Bell
Wow. Super post.
Seconded.
Reply 

#5  exaltedwombat 10-21-2018, 02:45 PM
One reason not to use both 'lang' and 'xml:lang' is that FlightCrew will flag 'lang' as an error.
Reply 

#6  Doitsu 10-21-2018, 05:57 PM
Quote exaltedwombat
One reason not to use both 'lang' and 'xml:lang' is that FlightCrew will flag 'lang' as an error.
Flightcrew is hopelessly outdated. Besides, the DAISY Consortium recommends using both attributes for epub2 and epub3 books.
Reply 

#7  exaltedwombat 10-21-2018, 07:35 PM
Has someone told Lulu? (I think it was Lulu who bounced epubs that didn't pass FlightCrew?)
Reply 

#8  KevinH 10-22-2018, 07:38 AM
As this relates to FlightCrew, it is the xml schema that determines if an attribute is allowed or not. The vast part of validating an epub2 is done against that schema. As far as I know these schema in Flightcrew are the most recent published for epub2. So the spec for epub2 has evolved but without a proper updated schema, there is not much I can do. I will look again to see if there are newer xml schemas for epub2 that are old enough to not add or allow epub3 only language features.
Reply 

#9  Doitsu 10-22-2018, 07:47 AM
Quote exaltedwombat
Has someone told Lulu? (I think it was Lulu who bounced epubs that didn't pass FlightCrew?)
According to Lulu:

Quote Lulu
File must be EPUB 2 and validated against EPUBCheck 3.0.1
Reply 

#10  Gregg Bell 05-22-2019, 04:15 PM
I'm using 0.9.9 Sigil. I got confused re-reading this post. (There were just too many details and it seemed contradictory information.) If somebody can please make this very simple for me I'd really appreciate it. I just want to know what's the best way to do this for an ebook that is a novel (to go on Amazon).

I'm analyzing two ebooks. The first screenshot is of my last book, which I'll post here. Both books passed Epubchek with no issues. Flightcrew has issues with both. (And I'm not concerned about the first warning about the OPF not being reachable. That's just because the cover isn't there.)

image »


This next one is the book I just formatted. Now this is just the default that Sigil provided. (I of course chose US english as the language in the metadata editor.)

image »

So in the first screenshot I used

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-US">

instead of

<html xmlns="http://www.w3.org/1999/xhtml">

And I deleted

lang="en-US" dir="ltr"

from the <body> tag.

I can do either or something different. What's the best way to go? This is a simple ebook. No video or anything like that. A cover, some backmatter images and text.


If it matters, this is the way the plugins look. (I'm running xubuntu 18.04LTS.)

image »

Thanks!
Reply 

  Next »  Last »  (1/4)
Today's Posts | Search this Thread | Login | Register