View Single Post
Old 02-27-2017, 04:29 AM   #1
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
Minimal and ideal EPUB3 testcase?

I have a good knowledge in HTML and CSS and some experience with EPUB2 (created with Sigil).

Now I like to start to create EPUB3 files instead of EPUB2 (not as a publisher, just for my own purpose and joy in good source code).

I prefer it, when the code is minimal/puristic and tries to strive to an ideal.

Is there anyone who created an "ideal" and "minimal" EPUB3 to show how consise good source code can be?

I would love to take a look as an inspiration.
Of course attributes like "ideal" and "minimalistic" are highly subjective.

Thank you.

Edit:
Thanks to all, who posted their helpful hints in this thread. A really nice discussion.

As a result I can proudly present a validated minimal epub3 file in the attachement.
It is not perfect, but near

If there will be improvements in the future, I will update the attachement and the code citations.

Attention please!

If you like to look into the source code of the epub, please do not use Sigil to open it, because Sigil will change the file structure automatically.

If you like to test the file on a Kobo, please replace the extension ".epub" by ".kepub.epub".

content.opf
Code:
<?xml 
  version= "1.0" 
  encoding="utf-8"?>
<package 
  version=          "3.0" 
  unique-identifier="book-id" 
  xmlns:dc=         "http://purl.org/dc/elements/1.1/" 
  xmlns=            "http://www.idpf.org/2007/opf">
  <metadata>
    <dc:identifier id="book-id">      urn:ISBN:978-3-908778-02-8</dc:identifier>
    <meta property="dcterms:modified">2017-03-07T12:12:12Z      </meta>
    <dc:language>                     de                        </dc:language>
    <dc:title>                        Tanz der seligen Geister  </dc:title>
    <dc:creator>                      Alice Munro               </dc:creator>   <!-- optional -->
    <dc:publisher>                    Dörlemann                 </dc:publisher> <!-- optional -->
    <dc:date>                         2012                      </dc:date>      <!-- optional -->
  </metadata>
  <manifest>
    <item id="content" href="content.xhtml" media-type="application/xhtml+xml"/>
    <item id="nav"     href="nav.xhtml"     media-type="application/xhtml+xml" properties="nav"/>
    <item id="cover"   href="cover.jpg"     media-type="image/jpeg"            properties="cover-image"/>
  </manifest>
  <spine>
    <itemref idref="content"/>
  </spine>
</package>
nav.xhtml
Code:
<?xml 
  version= "1.0" 
  encoding="utf-8"?>
<!DOCTYPE html>
<html 
  xmlns=     "http://www.w3.org/1999/xhtml" 
  xmlns:epub="http://www.idpf.org/2007/ops" 
  xml:lang=  "de">
<head />
<body>
<h2>Inhaltsverzeichnis</h2>
<nav epub:type="toc">
  <ol>
    <li><a href="content.xhtml#t1">Der Walker Brothers-Cowboy</a></li>
    <li><a href="content.xhtml#t2">Die leuchtenden Häuser</a></li>
    <li><a href="content.xhtml#t3">Bilder</a></li>
    <li><a href="content.xhtml#t4">Danke für die Schlittenfahrt</a>
      <ol>
        <li><a href="content.xhtml#t4_1">Das Büro</a></li>
        <li><a href="content.xhtml#t4_2">Ein Gläschen Medizin</a></li>
      </ol>
    </li>
    <li><a href="content.xhtml#t5">Zur Autorin und zu ihrer Übersetzerin</a></li>
    <li><a href="content.xhtml#t6">Zum Buch</a></li>
    <li><a href="content.xhtml#t7">Impressum</a></li>
  </ol>
</nav>
</body>
</html>
Attached Files
File Type: epub Tanz_der_seligen_Geister_epub3_minimal.v1.epub (34.7 KB, 205 views)

Last edited by ibu; 03-11-2017 at 05:35 AM.
ibu is offline   Reply With Quote