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 02-05-2022, 06:09 AM   #1
paperback
Connoisseur
paperback began at the beginning.
 
Posts: 76
Karma: 10
Join Date: Feb 2022
Device: None
Create TOC in ordinary webpage?

There is an "Insert inline TOC" feature, and this creates a special xhtml page. I'm wondering why the user is not able to create his/her own htm(l) page and automatically insert the TOC there, with the style rules for the TOC automatically added to the existing styles sheet?

Or is there a special advantage in having a separate xhtml page with its own inline styles?
paperback is offline   Reply With Quote
Old 02-05-2022, 06:54 AM   #2
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Maybe create your own CSS in

.....\AppData\Roaming\calibre\resources\templates\ inline_toc_styles.css

to use in the In Line toc.xhtml

Spoiler:
Code:
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: normal;
}

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;
}
h2 {
  page-break-before: always;
  page-break-after: avoid;
  text-indent: 0;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 2.5em;
  font-weight: bold;
  font-style: normal;
  font-family: sans-serif;
}
phossler is offline   Reply With Quote
Advert
Old 07-09-2022, 01:12 PM   #3
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
On my Windows 11 machine as of today (09 July 2022), that file isn't in AppData any more. It, and it's whole resources folder, are now under Calibre's program folder:

C:\Program Files\Calibre2\app\resources\templates\inline_toc_ styles.css
enuddleyarbl is online now   Reply With Quote
Old 07-09-2022, 01:31 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,155
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by paperback View Post
There is an "Insert inline TOC" feature, and this creates a special xhtml page. I'm wondering why the user is not able to create his/her own htm(l) page and automatically insert the TOC there, with the style rules for the TOC automatically added to the existing styles sheet?

Or is there a special advantage in having a separate xhtml page with its own inline styles?
There is no real advantage to having the separate xhtml page but do you really want to create the links for the ToC manually when the computer is ready, willing and able to do the scut work? BTW, xhtml is the extension required for epub3 but most programs don't seem to care if you use htm, html, xhtml, whatever.

Personally, I use Sigil and it adds a stylesheet for the inline ToC which can be easily be merged into the main stylesheet or deleted since I have most of the entries already in my default stylesheet.

Last edited by DNSB; 07-09-2022 at 01:33 PM.
DNSB is offline   Reply With Quote
Old 07-09-2022, 09:02 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DaveLessnau View Post
On my Windows 11 machine as of today (09 July 2022), that file isn't in AppData any more. It, and it's whole resources folder, are now under Calibre's program folder:

C:\Program Files\Calibre2\app\resources\templates\inline_toc_ styles.css
The content of C:\Program Files\Calibre2\app\resources\ contains the default resources that get used if there is no override in the calibre configuration folder: C:\Users\<username>\AppData\Roaming\calibre\resources.

An install of a new version of calibre will overwrite the contents of the C:\Program Files\Calibre2\ folder.

See ==>> Overriding icons, templates, et cetera

BR
BetterRed is offline   Reply With Quote
Advert
Old 07-09-2022, 11:02 PM   #6
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
Quote:
Originally Posted by BetterRed View Post
The content of C:\Program Files\Calibre2\app\resources\ contains the default resources that get used if there is no override in the calibre configuration folder: C:\Users\<username>\AppData\Roaming\calibre\resources.

An install of a new version of calibre will overwrite the contents of the C:\Program Files\Calibre2\ folder.

See ==>> Overriding icons, templates, et cetera

BR
Thanks. That link to the help file gives me everything I need to set that up. I'm off to give it a try.
enuddleyarbl is online now   Reply With Quote
Old 07-19-2022, 06:37 PM   #7
phossler
Wizard
phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.phossler ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 447222
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
Not sure this is pertinent, but this still works on my Win10 machine using Calibre 6.1


The file ...

C:\Users\<used>\AppData\Roaming\calibre\resources\ templates\inline_toc_styles.css

... has the CSS that the inline TOC uses

Code:
  <title>Table of Contents</title>
  <style type="text/css"><![CDATA[
  
  /* >>>> inline_toc_styles.css inserted here <<<< */
  
  ]]></style>
</head>

<body id="calibre_generated_inline_toc">
I have the CSS that makes the inline TOC formats just the way I like 'em

Last edited by phossler; 07-19-2022 at 06:42 PM.
phossler is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Create TOC from XPath mjcatt Editor 8 08-29-2019 01:24 PM
Can I create an EPUB TOC by myself? yJan1986 ePub 24 10-29-2018 02:26 PM
Ho do I create a TOC for ePub which does convert to an active TOC in Kindle Previewer K-Thom Calibre 1 09-24-2013 06:32 PM
create TOC for every X pages omegauo Conversion 0 03-21-2011 01:45 AM
How to create linked TOC? squawker Sony Reader 1 03-04-2007 08:20 AM


All times are GMT -4. The time now is 07:18 AM.


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