Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 11-09-2014, 11:31 AM   #1
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
More inline ToC grief

I have a book with two levels of headings and the inline ToC appears like this:

<ul class="level1">
<li><a href="index_split_002.html">Part One</a>
<ul class="level2">
<li><a href="index_split_003.html">Chapter One</a></li>

I want the level 1 headings to be in bold with 1em space above, so I modified the CSS in the ToC header to look like this:

ul.level1 {
list-style-type: none;
padding-left: 2em;
margin: 0;
}
ul.level1>li {
margin-top: 1em;
font-weight: bold;
}
ul.level2 {
list-style-type: none;
font-weight: normal;
padding-left: 2em;
margin: 0;
}

The ul.level1>li style is ignored. I checked it with Firefox and it displays as expected, but not in Calibre. Does anyone know what might be going on here?
Phssthpok is offline   Reply With Quote
Old 11-09-2014, 11:35 AM   #2
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
I just checked the book with Adobe Digital Editions as a sanity check and the ToC displays as expected -- so this seems to be Calibre limitation/bug/feature.
Phssthpok is offline   Reply With Quote
Advert
Old 11-09-2014, 11:40 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre uses webkit to render html, I highly doubt that that css will not display in webkit.
kovidgoyal is online now   Reply With Quote
Old 11-09-2014, 12:03 PM   #4
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by kovidgoyal View Post
calibre uses webkit to render html, I highly doubt that that css will not display in webkit.
Apologies; it shows up OK in the viewer, it only fails to display properly in the editor (the Live CSS and Inspector views don't pick up the LI styling either, BTW). Thought it was in the viewer too, but I must have confused myself somehow, oops.
Phssthpok is offline   Reply With Quote
Old 11-09-2014, 09:26 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The editor also uses webkit to display html, indeed the very same component as the viewer (QWebView)
kovidgoyal is online now   Reply With Quote
Advert
Old 11-10-2014, 06:02 AM   #6
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
So here's the code for an inline ToC:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

<head>
  <title>Table of Contents</title>
  <style type="text/css">
  ul.level1 {
    list-style-type: none;
    padding-left: 2em;
    margin: 0;
  }
  ul.level1>li {
    margin-top: 1em;
    font-weight: bold;
  }
  ul.level2 {
    list-style-type: none;
    font-weight: normal;
    padding-left: 2em;
    margin: 0;
  }
  a {
    text-decoration: none;
  }
  a:hover {
    color: red;
  }
  </style>
</head>

<body id="calibre_generated_inline_toc">

  <h2>Table of Contents</h2>

  <ul class="level1">

    <li><a href="index_split_002.html">Part One</a>

      <ul class="level2">
        <li><a href="index_split_004.html">Chapter One</a></li>
        <li><a href="index_split_005.html">Chapter Two</a></li>
        <li><a href="index_split_006.html">Chapter Three</a></li>
        <li><a href="index_split_007.html">Chapter Four</a></li>
        <li><a href="index_split_008.html">Chapter Five</a></li>
      </ul>

    </li>

    <li><a href="index_split_009.html">Part Two</a>

      <ul class="level2">
        <li><a href="index_split_010.html">Chapter Six</a></li>
        <li><a href="index_split_011.html">Chapter Seven</a></li>
        <li><a href="index_split_012.html">Chapter Eight</a></li>
      </ul>

    </li>

  </ul>

</body>

</html>
and here's a screenshot showing the file open in the editor:



The same file in the book viewer:



As you can see, the viewer gets it right but the editor doesn't.
Phssthpok is offline   Reply With Quote
Old 11-10-2014, 09:41 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Can you attach an actual file, I dont want to spend time building one for myself.
kovidgoyal is online now   Reply With Quote
Old 11-10-2014, 09:50 AM   #8
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
The code I posted is a complete copy of "toc.xthml" -- you can just cut & paste directly into the editor.
Phssthpok is offline   Reply With Quote
Old 11-10-2014, 10:33 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...c9e4f1e767cc9c
kovidgoyal is online now   Reply With Quote
Old 11-10-2014, 11:31 AM   #10
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
The speed at which you deal with things amazes me. Colour me impressed.
Phssthpok is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inline TOC formatting phossler Editor 9 03-29-2014 06:05 AM
Inline TOC from toc.ncx elmago79 Kindle Formats 38 03-25-2011 12:56 PM
Use Regex to Code an Inline TOC, from an External TOC's .ncx File mostlynovels ePub 2 03-16-2011 12:15 PM
Tags around inline TOC links jhempel24 Sigil 0 01-08-2011 06:21 AM
Trying to make an Inline TOC crutledge Sigil 2 05-09-2010 05:46 AM


All times are GMT -4. The time now is 03:47 AM.


MobileRead.com is a privately owned, operated and funded community.