MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Workshop (https://www.mobileread.com/forums/forumdisplay.php?f=178)
-   -   Some files.html & toc.xhtml (also Cover.xhtml) (https://www.mobileread.com/forums/showthread.php?t=283369)

chaot 02-06-2017 05:37 PM

Some files.html & toc.xhtml (also Cover.xhtml)
 
1 Attachment(s)
:welcome:

I create via Tools->Table of Contents->Insert inline Table of Contents such one. It came as .xhtml-file. My other files are all .html, apart from Cover.xhtml (I don't know why this one is also .xhtml).

Attachment 154817
toc.xhtml

What is this all about?

Edit:
And why it came with such a CSS, which doesn't function in ereaders, at least not in my one!?

Code:

<head>
  <title>Inhaltsverzeichnis</title>
  <style type="text/css">
  li {
    list-style-type: none;
    padding-left: 2em;
    margin-left: 0;
  }
  a {
    text-decoration: none;
  }
  a:hover {
    color: red;
  }

  </style>
</head>


JSWolf 02-06-2017 05:43 PM

It doesn't actually matter which file extension is used. Just pick one and rename so they are all the same. They don't have to be the same, it just looks better.

chaot 02-06-2017 05:59 PM

1 Attachment(s)
Attachment 154819
Are you sure?

Check Book is after the change to toc.html unchanged. For what kind of changes is the message meant?

Turtle91 02-06-2017 06:42 PM

There is no problem with changing .xhtml to .html, or vice versa.

jhowell 02-06-2017 07:31 PM

The file extension is unimportant. What actually matters is the mime type declared in the OPF. It should be application/xhtml+xml for XHTML files.

Toxaris 02-07-2017 03:12 AM

Quote:

Originally Posted by chaot (Post 3471431)
And why it came with such a CSS, which doesn't function in ereaders, at least not in my one!?

Code:

<head>
  <title>Inhaltsverzeichnis</title>
  <style type="text/css">
  li {
    list-style-type: none;
    padding-left: 2em;
    margin-left: 0;
  }
  a {
    text-decoration: none;
  }
  a:hover {
    color: red;
  }

  </style>
</head>


Well, not all CSS elements are supported in the ePUB2 specifications. That being said, alternative colors for anchors have been known to be supported badly in the various readers.
Now, the hover selector might work on a tablet or PC, but not on a standalone reader for sure.

chaot 02-07-2017 11:49 AM

The message say:
Quote:

You are changing the file type of toc.xhtml to toc.html. Doing so can cause problems, are you sure?
That means: The OS/calibre has recognized what's going on. Yes!? And you all say, there is no problem about changing file extensions, OK. Then the message is redundant and should be removed for such file extension changes.

I specify my question from #3: For what kind of changes is the message box created at all?

@jhowell - that's alright, as you see:
Code:

<manifest>
    <item href="toc.html" id="id8" media-type="application/xhtml+xml"/>
... and at end ...
    <reference type="toc" title="Inhaltsverzeichnis" href="toc.html#calibre_generated_inline_toc"/>

Inhaltsverzeichnis is German (means content list): From where/why calibre knows, it's a German book?

Not from here:
Code:

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

I changed all files from lang="de" to lang="en" and 'refresh' the toc.xhtml, but still it's named Inhaltsverzeichnis.

Quote:

Originally Posted by Toxaris (Post 3471638)
Now, the hover selector might work on a tablet or PC, but not on a standalone reader for sure.

Yes, that was, what I meant: HOVER doesn't function in ereaders.
So, it shouldn't come as integrated CSS here!

DiapDealer 02-07-2017 12:12 PM

EPUB3 recommends .xhtml extensions. EpubCheck will actually issue a warning for files that are .htm, or .html (in an epub3). Better safe than sorry, in my opinion (even though warnings are not errors). I make them all .xhtml (regardless of the epub version).

chaot 02-07-2017 01:35 PM

All .xhtml to be safe for future: Piece of good advice!

BetterRed 02-07-2017 04:08 PM

Quote:

Originally Posted by chaot (Post 3471446)
Attachment 154819
Are you sure?

Check Book is after the change to toc.html unchanged. For what kind of changes is the message meant?

That calibre book editor message is not file type specific, if you inadvertently rename myimage.jpg to justanotherimage.jng you'll get a similar message -- and in that case it probably will matter. Which is a good reason not to blithely uncheck "Show this message again:"

FWIW Sigil doesn't issue similar warnings.

I don't know if any of the epub validators would object to the presence of a .jng file, or if any ereader devices would know what to do with one.

I do same as DD - make all the text files .xhtml.

BR

Doitsu 02-07-2017 05:15 PM

Quote:

Originally Posted by chaot (Post 3471805)
@jhowell - that's alright, as you see:
Code:

<manifest>
    <item href="toc.html" id="id8" media-type="application/xhtml+xml"/>
... and at end ...
    <reference type="toc" title="Inhaltsverzeichnis" href="toc.html#calibre_generated_inline_toc"/>

Inhaltsverzeichnis is German (means content list): From where/why calibre knows, it's a German book?

Not from here:
Code:

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

I changed all files from lang="de" to lang="en" and 'refresh' the toc.xhtml, but still it's named Inhaltsverzeichnis.

If you use the German Calibre user interface and/or create a new German language book in Calibre Editor, Calibre will use the German translation of Table of Contents = Inhaltsverzeichnis whenever you generate an inline (HTML) TOC. It'll also add a opf guide item with an Inhaltsverzeichnis title attribute.

Make sure to select Englisch from the Sprache (Language) dropdown list box in the Neues Buch erstellen (Create new book) dialog box when you create a new English epub.

chaot 02-08-2017 02:00 PM

Quote:

Originally Posted by BetterRed (Post 3471888)
I do same as DD - make all the text files .xhtml.

You still learn something about it.

Quote:

Originally Posted by Doitsu (Post 3471909)
If you use the German Calibre user interface

I use English interface!

Quote:

... and/or create a new German language book in Calibre Editor, Calibre will use the German translation of Table of Contents = Inhaltsverzeichnis whenever you generate an inline (HTML) TOC. It'll also add a opf guide item with an Inhaltsverzeichnis title attribute.
The book is German. But how detect calibre that it is a German book?

Quote:

Make sure to select Englisch from the Sprache (Language) dropdown list box in the Neues Buch erstellen (Create new book) dialog box when you create a new English epub.
It isn't a new created book.

Doitsu 02-08-2017 02:15 PM

Quote:

Originally Posted by chaot (Post 3472364)
The book is German. But how detect calibre that it is a German book?

It either uses an advanced heuristics algorithm or it simply checks the value of the following metadata entry in the .opf file:

Code:

<dc:language>de</dc:language>
If you're really curious about it, you might want to ask this question in the Calibre Editor forum.

BTW, if it's a German book, why do you want to change the value of the TOC guide item title attribute?

chaot 02-09-2017 11:49 AM

@Doitsu: Quit simple! Sometimes we can't see the wood for the trees.

In Edit Metadata there is a dropdown box Language: German (in my case).
E.g. I test with French: then inline TOC comes as Table des Matières

Tested with Yoruba (a westafrican language): Table of Contents. Kovid made a mistake here. Correct is: Tabili ti awọn akoonu ti (Google translate). :)

Quote:

BTW, if it's a German book, why do you want to change the value of the TOC guide item title attribute?
I didn't want to change anything (here) - only to understand better!

Anyway, I know now: there is no mystery! :thanks: all!

BetterRed 02-09-2017 06:16 PM

Quote:

Originally Posted by chaot (Post 3472790)
Tested with Yoruba (a westafrican language): Table of Contents. Kovid made a mistake here. Correct is: Tabili ti awọn akoonu ti (Google translate). :)

I'd be more inclined to believe Kovid than Google.

My Google English to Yoruba translator yields "Atọka akoonu" for "Table of Contents", as does a Nigerian Yoruba dictionary site.

I think Google translates differently if your Google language is set to other than the source language - perhaps by translating source to user's google language and then to target language. I've experienced this when translating FX Italian to Swedish when my Google language is set to English, if I set my google language to Italian I sometimes get a different result - which is almost invariably 'better' according to my Swedish interlocutor ;)

BR


All times are GMT -4. The time now is 08:21 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.