PDF→EPUB: Add EPUB 3 step, use HTML 5 in example.

This commit is contained in:
tastytea 2021-03-27 19:36:28 +01:00
parent b56cf6c52b
commit dad938ce69
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 31 additions and 18 deletions

View File

@ -53,14 +53,25 @@ guide.
Click on menu:Add books[Add empty book]. Then fill in the metadata and select Click on menu:Add books[Add empty book]. Then fill in the metadata and select
“EPUB” as format. You can add more metadata and a cover image by right-clicking “EPUB” as format. You can add more metadata and a cover image by right-clicking
the book and then selecting menu:Edit metadata[]. Open Calibre's editor by right the book and then selecting menu:Edit metadata[]. Open Calibre's editor by right
clicking on the book and selecting menu:Edit book[]. You start with a single XHTML clicking on the book and selecting menu:Edit book[].
file, `start.xhtml`. I always use that for the title page, the copyright notice
and so on. You can force a page break to separate the title and the copyright Calibre creates EPUB 2 books by default. Convert the book to EPUB
notice with CSS: Add `style="page-break-after: always;"` to the last element of 3footnote:[EPUB 3 introduces many accessibility features, see
the virtual “page” or use a CSS class. To add a CSS file click menu:File[New link:{url-ap-semantics}[AccessiblePublishing: EPUB Semantics, ARIA Roles, &
file] and enter a filename ending with `.css`. Add the CSS file to the document Metadata] for details.] by clicking menu:Tools[Upgrade book internals]. This
by right clicking on `start.xhtml` in the file browser and selecting will, among other things, convert `toc.ncx` to `nav.xhtml`. To support e-book
menu:Link stylesheets…[]. readers which can't handle EPUB 3 yet, re-create `toc.ncx` as an empty file. It
is filled automatically when you create the table of Contents. Open
`metadata.opf` and replace `<spine>` with `<spine toc="id1">` (`id1` is the ID
of `toc.ncx`, defined a few lines above).
You start with a single XHTML file, `start.xhtml`. I always use that for the
title page, the copyright notice and so on. You can force a page break to
separate the title and the copyright notice with CSS: Add
`style="page-break-after: always;"` to the last element of the virtual “page” or
use a CSS class. To add a CSS file click menu:File[New file] and enter a
filename ending with `.css`. Add the CSS file to the document by right clicking
on `start.xhtml` in the file browser and selecting menu:Link stylesheets…[].
[NOTE] [NOTE]
The built-in preview does not show page breaks. The built-in preview does not show page breaks.
@ -71,7 +82,7 @@ Your files should look similar to this:
[source,html] [source,html]
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="de">
<head> <head>
<title>Meine zwei Jahre in Russland</title> <title>Meine zwei Jahre in Russland</title>
@ -80,23 +91,25 @@ Your files should look similar to this:
<body> <body>
<div class="pagebreak center" id="title"> <section class="pagebreak center" id="title" aria-label="Title">
<p>Emma Goldman</p> <p>Emma Goldman</p>
<h1>Meine zwei Jahre in Russland</h1> <h1>Meine zwei Jahre in Russland</h1>
</div> </section>
<p>1. Auflage<br/> <section aria-label="Meta data">
München, Januar 2020</p> <p>1. Auflage<br/>
München, Januar 2020</p>
<p id="copyright">Anti-Copyright (siehe S. 362)</p> <p id="copyright">Anti-Copyright (siehe S. 362)</p>
<p>Die englische Originalausgabe erschien 1921 und 1925 in den <p>Die englische Originalausgabe erschien 1921 und 1925 in den
USA aufgrund eines Versehens in zwei Teilen unter den Titeln USA aufgrund eines Versehens in zwei Teilen unter den Titeln
<em>My Disillusionment in Russia</em> und <em>My Further Disillusionment in <em>My Disillusionment in Russia</em> und <em>My Further Disillusionment in
Russia.</em></p> Russia.</em></p>
</section>
</body> </body>