Thread: Two questions
View Single Post
Old 10-20-2018, 07:25 PM   #2
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
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:
Originally Posted by Gregg Bell View Post
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:
Originally Posted by Gregg Bell View Post
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:
  • If that HTML gets opened up in a browser, the <title> is what shows in the tab.
  • If being read by a screenreader, the person may have the <title> spoken out loud.
  • Some ereaders might display that as the header/footer (don't know of any that do).

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:
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:
  • Identify the subject of the Web page
  • Make sense when read out of context, for example by a screen reader or in a site map or list of search results
  • Be short


Quote:
Originally Posted by Gregg Bell View Post
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:
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:
  • It allows braille translation software to substitute control codes for accented characters, and insert control codes necessary to prevent erroneous creation of Grade 2 braille contractions.
  • Speech synthesizers that support multiple languages will be able to orient and adapt to the pronunciation and syntax that are specific to the language of the page, speaking the text in the appropriate accent with proper pronunciation.
  • Marking the language can benefit future developments in technology, for example users who are unable to translate between languages themselves will be able to use machines to translate unfamiliar languages.
  • Marking the language can also assist user agents in providing definitions using a dictionary.


So it could help:
  • Braille conversion
  • TTS
  • Dictionary support
  • Automatic Translation
    • Think Google Translate
  • Spellchecking
    • Calibre has Multi-Language Spellchecking
  • Hyphenation
  • [...]

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

Last edited by Tex2002ans; 10-20-2018 at 07:42 PM.
Tex2002ans is offline   Reply With Quote