MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Editor (https://www.mobileread.com/forums/forumdisplay.php?f=262)
-   -   inline_toc_styles.css (https://www.mobileread.com/forums/showthread.php?t=274984)

phossler 06-07-2016 08:14 PM

inline_toc_styles.css
 
To have my own CSS used when I make an inline TOC, I created my own styles and put my inline_toc_styles.css into AppData\Roaming\Calibre\resources\templates

1. I took a guess about where to put it since I couldn't find info in the users manual (and for once I guessed right)

2. I get CDATA tags for some reason. They don't seem to hurt, but I wonder why I get them

Code:

  <style type="text/css"><![CDATA[
  li > ul {
    margin-bottom: 1em;
  }
  ul.level1 {
    padding-left: 0;
    font-weight: normal;
    font-size: 100%;
    margin-top: 1em;
    margin-left: 0;
    text-decoration: none;
  }
  ul.level2 {
    font-size: 100%;
  }
  ul.level3 {
    font-style: italic;
  }
  li {
    margin-top: 1em;
    list-style-type: none;
  }
  a {
    text-decoration: none;
    color: black;
  }
  a:hover {
    border-top-style: solid;
    border-bottom-style: solid;
    padding-bottom: 2px;
    padding-top: 1px;
    border-top-width: 2px;
    border-bottom-width: 2px;
    color: white;
    background-color: black;
  }
  ]]></style>


theducks 06-07-2016 10:01 PM

It ain't hard.

File: import into book: <select file>
It auto locates (in file browser)based upon extension

Right click on the LINK TARGET html: select

phossler 06-08-2016 09:17 AM

Sorry, I don't see how that relates to getting [CDATA] tags

I did that and all I got was another html file at the end.

Bertrand 06-08-2016 10:06 AM

I think you get this <![CDATA[ because you are in a xhtml file, and in your css you have this symbol >.

> is a special character in xml. CDATA is used to prevent errors when parsing the document.
A way to say : "ignore all special characters in this section".

If you don't want to see it, put your css in an external file, but as you said, it doesn't hurt.

phossler 06-08-2016 10:53 AM

Ahhh - thanks

Calibre apparently inserts what it finds in the inline_toc_styles.css file when it makes an inline TOC so I was just modeling mine on the built in file (which doesn't have the <)

My version gets used and the CDATA doesn't hurt, so all is well


All times are GMT -4. The time now is 09:38 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.