Thread: kepub stuff
View Single Post
Old 09-27-2014, 01:51 PM   #11
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 603
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Kobo should first address existing Kobo kepub issues which can really mess up the output (of older kepubs). This is the main problem of kepubs.
Which is caused by making device features software dependent while device features should always be handled by the device (user agent) itself and should be independent from the software (kepub).

The user agent should decide if additional code should be parsed into the book before it is displayed on the screen. The file extension can be used for that (.kepub.epub: yes, parse additionalcode; .epub: don't parse additional code).

How to make/enable device features less software dependent?
  1. Remove the Kobo Style Hacks from the kepub (software) and move it to the user agent (firmware).
    This makes every (future) change to Kobo Style Hacks backwards compatible and every kepub 'looks' the same regardless when it was converted to kepub. Less complains from customers about older, incorrectly displayed books.

    This is similar to Loading a custom CSS on kepub opening which is parsed in before the book is displayed on the screen. Kobo Style Hacks should be parsed by the user agent in a similar way (i.e. a second CSS which can carry the same name kobo.css) and remove the empty (and useless) kobo.css from the book itself. The same for the java script code.
    If I remember correctly, the code found in kobo.js is (was) also present in (older) firmware releases. Meaning there is no real need to put this in the book itself too.
    Code:
    Example code:
    <!-- kobo-style -->
      <link href="css/kobo.css" rel="stylesheet" type="text/css" />
      <script src="js/kobo.js" type="text/javascript">
    </script>
      
    <style type="text/css">
    div#book-inner p, div#book-inner div { font-size: 1.0em; } a { color: black; } a:link, a:visited, a:hover, a:active { color: blue; } div#book-inner * { margin-top: 0 !important; margin-bottom: 0 !important;}
    </style>
  2. Keep only the 'Kobo wrappers and position code' in the book.
    (But if it can be handled by the firmware then move it to the firmware.)
    • Wrapper
      Code:
      <body>
        <div id="book-columns">
          <div id="book-inner">
      	 </div>
        </div>
      </body>
    • Positioning
      Code:
      <span id="kobo.1.1">
      <span id="kobo.1.2">
  3. But it starts by reconverting/updating all older kepubs to the latest Kobo Style Hacks version for a uniform ouput.
    All kepubs (in any language) that still contain older versions of Kobo Style Hacks code should be reconverted/updated to the latest code to guarantee a correct output on Kobo devices. That's where it all starts as customers paid for a book and should be displayed correctly.
Anak is offline   Reply With Quote