Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2010, 05:55 PM   #1
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 258
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
HTML to EPUB: list indent disappears

I searched but couldn't find anything on the subject, so forgive me if it has been asked before. I had the following HTML:
Code:
        <style>
            ul.circle {list-style-type:circle}
            ul.square {list-style-type:square}
            ol.decimal {list-style-type:decimal}
            ol.upper-roman {list-style-type:upper-roman}
            ol.lower-alpha {list-style-type:lower-alpha}
        </style>
.....
        <ul class="circle">
            <li>Bullet</li>
            <li>Another bullet</li>
            <li>
                Nested points
                <ul class="square">
                    <li>Point</li>
                    <li>Another point</li>
                </ul>
            </li>
        </ul>
        <ol class="decimal">
            <li>First item</li>
            <li>Second item</li>
            <li>
                More details
                <ol class="upper-roman">
                    <li>First detail</li>
                    <li>Second detail</li>
                </ol>
            </li>
            <li>
                A different angle
                <ol class="lower-alpha">
                    <li>First angle</li>
                    <li>Another angle</li>
                </ol>
            </li>
        </ol>
This displays a multi-level list with proper bullets and indentation. If I convert this HTML to EPUB using Calibre, those styles are redefined as follows:
Code:
circle {
    display: block;
    list-style-type: circle;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1em
    }
.decimal {
    display: block;
    list-style-type: decimal;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1em
    }
.lower-alpha {
    display: block;
    list-style-type: lower-alpha;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0
    }
.square {
    display: block;
    list-style-type: square;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0
    }
.upper-roman {
    display: block;
    list-style-type: upper-roman;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0
    }
and leads to all indentation of nested items to disappear. Is there some way to preclude this from happening?
dmapr is offline   Reply With Quote
Old 04-29-2010, 08:25 PM   #2
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: 26,103
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sounds like a bug, open a ticket and I'll look at it when I have a minute.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 04-29-2010, 08:33 PM   #3
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 258
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
Thanks Kovid!

Created ticket #5415.

Last edited by dmapr; 04-29-2010 at 08:45 PM. Reason: Added ticket number.
dmapr is offline   Reply With Quote
Old 04-29-2010, 09:44 PM   #4
yekim54
What the Dog Saw
yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.yekim54 ought to be getting tired of karma fortunes by now.
 
yekim54's Avatar
 
Posts: 305
Karma: 981684
Join Date: Jul 2008
Location: Dunn Loring
Device: Sony PRS-505, PRS-650, Asus TF101
Quote:
Originally Posted by dmapr View Post
Thanks Kovid!

Created ticket #5415.
Thanks for opening that ticket, I was just about to report the same bug. The list <li> tags worked in version 0.5.14, but apparently became broken in version 0.6 onward.
yekim54 is offline   Reply With Quote
Old 04-30-2010, 12:18 AM   #5
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 258
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
Quote:
Originally Posted by yekim54 View Post
Thanks for opening that ticket, I was just about to report the same bug. The list <li> tags worked in version 0.5.14, but apparently became broken in version 0.6 onward.
I've also noticed it in some FB2 conversions where it flattens the embedded TOC — but it's quite possible that this is actually an ADE display bug. Sigil displays the file correctly as does Calibre ebook viewer.
dmapr is offline   Reply With Quote
Old 04-30-2010, 12:35 PM   #6
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 258
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
Just wanted to apologize to Kovid for really screwing up in filing the ticket. I did not make it clear that the problem was only visible in ADE (reader & PC software). Should there be a next time I'll be a lot more diligent in choosing the right components and describing the problem correctly.

Kovid, thanks for Calibre and thanks for the fix! Looking forward to the next release. Once again, sorry for the mess
dmapr is offline   Reply With Quote
Old 04-30-2010, 12:40 PM   #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: 26,103
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No problem Thanks to that ticket I discovered yet another bug in ADE
kovidgoyal is offline   Reply With Quote
Old 04-30-2010, 05:16 PM   #8
dmapr
Addict
dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.dmapr composes epic poetry in binary.
 
Posts: 258
Karma: 90958
Join Date: Sep 2009
Device: PRS-950, Kobo Aura HD
Quote:
Originally Posted by kovidgoyal View Post
No problem Thanks to that ticket I discovered yet another bug in ADE
Good!

BTW, I downloaded the 0.6.50 and converting that same HTML file I get an error:
Code:
C:\TEMP>"c:\Program Files\Calibre2\ebook-convert.exe" lists.html lists-calibre.epub
1% Converting input to HTML...
InputFormatPlugin: HTML Input running
on C:\TEMP\lists.html
Language not specified
Creator not specified
Building file list...
Forcing lists.html into XHTML namespace
34% Running transforms on ebook...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
67% Creating EPUB Output
Python function terminated unexpectedly
  'CSSRuleList' object has no attribute 'rulesOfType' (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 103, in main
  File "site.py", line 85, in run_entry_point
  File "site-packages\calibre\ebooks\conversion\cli.py", line 254, in main
  File "site-packages\calibre\ebooks\conversion\plumber.py", line 905, in run
  File "site-packages\calibre\ebooks\epub\output.py", line 159, in convert
  File "site-packages\calibre\ebooks\epub\output.py", line 474, in workaround_ade_quirks
AttributeError: 'CSSRuleList' object has no attribute 'rulesOfType'
Is there something I need to change in my original HTML?
Code:
<html>
        <head>
                <title>List tests</title>
                <style>
                        ul.circle {list-style-type:circle}
                        ul.square {list-style-type:square}
                        ol.decimal {list-style-type:decimal}
                        ol.upper-roman {list-style-type:upper-roman}
                        ol.lower-alpha {list-style-type:lower-alpha}
                </style>
        </head>
        <body>
                <ul class="circle">
                        <li>Bullet</li>
                        <li>Another bullet</li>
                        <li>
                                Subpoints
                                <ul class="square">
                                        <li>Subpoint</li>
                                        <li>Another subpoint</li>
                                </ul>
                        </li>
                </ul>
                <ol class="decimal">
                        <li>First item</li>
                        <li>Second item</li>
                        <li>
                                More details
                                <ol class="upper-roman">
                                        <li>First detail</li>
                                        <li>Second detail</li>
                                </ol>
                        </li>
                        <li>
                                A different angle
                                <ol class="lower-alpha">
                                        <li>First angle</li>
                                        <li>Another angle</li>
                                </ol>
                        </li>
                </ol>
        </body>
</html>
dmapr is offline   Reply With Quote
Old 04-30-2010, 06:31 PM   #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: 26,103
Karma: 5101571
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No that's a bug (I forgot to update cssutils in the binary builds) I'll be releasing 0.6.51 in a bit
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
TOC disappears when converting from .prc to epub baselworld Calibre 3 09-06-2010 02:10 AM
Calibre Indent Issue When Removing Blank Lines (Converting From HTML to MOBI or EPUB) David Derrico Calibre 5 08-04-2010 12:13 AM
HTML Book + non HTML TOC to epub aarcane Calibre 4 03-02-2010 02:58 AM
Why ePub rather than HTML? Robotech_Master Workshop 20 03-30-2009 03:53 PM
Ignore initial indent in HTML files? The Old Man Sony Reader Dev Corner 2 06-21-2008 08:38 PM


All times are GMT -4. The time now is 04:46 AM.


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