broken epub (content.opf) was generated on Windows

Takayuki Shimizukawa avatarTakayuki Shimizukawa created an issue

On windows, epub file broken. Readium (Chrome epub viewer application) could not read the epub file.

Windows and Unix generate different content.opf file.

Generated by Unix:

  <manifest>
    <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
    <item id="index.html"
          href="index.html"
          media-type="application/xhtml+xml" />
    <item id="for_writers.html"
          href="for_writers.html"
          media-type="application/xhtml+xml" />
    <item id="introduction.html"
          href="introduction.html"
          media-type="application/xhtml+xml" />
    <item id="what_is_sphinx_index.html"
          href="what_is_sphinx/index.html"
          media-type="application/xhtml+xml" />
    <item id="install_index.html"
          href="install/index.html"
          media-type="application/xhtml+xml" />
  ...
  </manifest>
  <spine toc="ncx">
    <itemref idref="index.html" />
    <itemref idref="for_writers.html" />
    <itemref idref="introduction.html" />
    <itemref idref="what_is_sphinx_index.html" />
    <itemref idref="install_index.html" />
   ...

Generated by Windows:

  <manifest>
    <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" />
    <item id="epub-2"
          href="index.html"
          media-type="application/xhtml+xml" />
    <item id="epub-0"
          href="for_writers.html"
          media-type="application/xhtml+xml" />
    <item id="epub-3"
          href="introduction.html"
          media-type="application/xhtml+xml" />
    <item id="epub-27"
          href="what_is_sphinx/index.html"
          media-type="application/xhtml+xml" />
    <item id="epub-18"
          href="install/index.html"
          media-type="application/xhtml+xml" />
   ...
  </manifest>
  <spine toc="ncx">
    <itemref idref="epub-2" />
    <itemref idref="epub-0" />
    <itemref idref="epub-3" />
    <itemref idref="epub-84" />
    <itemref idref="epub-85" />

It seems id and idref are shifted on Windows.

Comments (3)

  1. Roland Meister

    Thank you for the quick fix. I assume that the change of the id and idref names in cotent.odf were not the cause of the bug (I changed the names deliberately), but different values for os.path.sep.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.