![]() |
#1 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#2 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#4 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 576
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
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.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> ![]() The same file in the book viewer: ![]() As you can see, the viewer gets it right but the editor doesn't. |
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#8 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#10 |
Age improves with wine.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |