Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2016, 01:43 AM   #1
ksimpson1986
Member
ksimpson1986 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2016
Device: ibooks
Collapsible TOC?

Hi, i'm creating an eBook based off of a 1300 page daily devotional. that being said, it has a massive table of contents with each day of the year being a link. This TOC is developed from indesign so it's already linked and ready. the issue is, when viewing it in an eReader, the TOC is expanded by default, so it takes 5 minutes to swipe through all the of the table of contents to get to the next part of the eBook. i have created an extra entry of each month, and moved each of the 30/31 days of each month inside that monthly "folder". problem is, it's all still completely expanded by default. when i view the TOC in the viewer, and tell it to collapse, it looks perfect. just 12 options, and you can expand each month to see each day. after i save it, it expands again automatically...I hope this makes sense. Is there an HTML code that will cause the TOC to be collapsed by default? If not, is there other software that will? thank you!
ksimpson1986 is offline   Reply With Quote
Old 10-22-2016, 05:10 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,883
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
No, the code just "Nests.' Indent.

Remember EPUB2, NCX is the 'real' TOC for devices,

since you want it to start 'collapsed':
Make the NCX entry point to a page (XHTML) that is the 'Contents for that sections Start. Those items (links) will never be in the NCX


Generate a overall HTML TOC page (from the nested monster NCX). Split it into 'Sections' and move those to the beginning (location in the file list) of their respective places. rename the files for clarity eg TOC02, TOC03... and Insert an top level Chapter (number) title at the beginning, that will be picked up by the TOC Generator tool in the next step
ie <h1>Section x Contents </h1>

now regenerate the NCX, but restrict (the pulldown is at the bottom) to only the top levels assigned to the Sections TOC : h1

Doing it in this order, lets Sigil do the tedious, "get the links correct" part and leaves it to you to push the big chunks around
theducks is offline   Reply With Quote
Advert
Old 10-22-2016, 06:18 AM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by ksimpson1986 View Post
that being said, it has a massive table of contents with each day of the year being a link. This TOC is developed from indesign so it's already linked and ready.
I have worked on a handful of books that were massive TOCs with 500+ entries in them (compilations of newspaper articles over years).

Just organize and display the TOCs in a meaningful way, and the user can figure it out from there (skipping to a given year/month/day).

This is what sample code for an HTML TOC might be:

Spoiler:

Quote:
<p class="tocone"><a href="../Text/2010.xhtml">2010</a></p>

<p class="toctwo"><a href="../Text/2010.01.xhtml">January 2010</a></p>

<p class="tocthree"><a href="../Text/2010.01.01.xhtml">2010/01/01</a></p>

<p class="tocthree"><a href="../Text/2010.01.02.xhtml">2010/01/02</a></p>

<p class="toctwo"><a href="../Text/2010.02.xhtml">February 2010</a></p>

<p class="tocthree"><a href="../Text/2010.02.01.xhtml">2010/02/01</a></p>

<p class="tocthree"><a href="../Text/2010.02.02.xhtml">2010/02/02</a></p>

<p class="tocone"><a href="../Text/2011.xhtml">2011</a></p>

<p class="toctwo"><a href="../Text/2011.01.xhtml">January 2011</a></p>

<p class="tocthree"><a href="../Text/2011.01.01.xhtml">2011/01/01</a></p>

<p class="tocthree"><a href="../Text/2011.01.02.xhtml">2011/01/02</a></p>

[...]


and use CSS to tweak the look:

Spoiler:

Code:
.tocone {
	font-size: 2em;
	font-weight: bold;
	margin-top: 1em;
	margin-bottom: 1em;
	text-align: center;
}

.toctwo {
	font-size: 1.2em;
	margin-left: 2em;
	text-indent: -2em;
}

.tocthree {
	margin-top: 0;
	margin-bottom: 0;
	margin-left: 4em;
	text-indent: -2em;
}


I have attached a sample EPUB.

Click image for larger version

Name:	SampleTOCSigil.png
Views:	558
Size:	61.2 KB
ID:	152517

Side Note: If you are interested in both massive EPUBs, I wouldn't mind giving links if you wanted to see how those work on your devices. (One book is organized Year - Volume.Issue - ~650 articles, and the other is Year - ~970 articles.) I think the TOCs work perfectly.

Quote:
Originally Posted by ksimpson1986 View Post
the issue is, when viewing it in an eReader, the TOC is expanded by default, [...] i have created an extra entry of each month, and moved each of the 30/31 days of each month inside that monthly "folder". problem is, it's all still completely expanded by default.
I am not 100% clear on what is "expanded" and "folders", but I believe you are talking about the TOC.NCX?

Is this what you are talking about in the sidebar of Sigil?

Click image for larger version

Name:	SigilTOCNCX.png
Views:	403
Size:	12.3 KB
ID:	152518

Quote:
Originally Posted by ksimpson1986 View Post
when i view the TOC in the viewer, and tell it to collapse, it looks perfect. just 12 options, and you can expand each month to see each day. after i save it, it expands again automatically...
There is no way that you can control the display of the TOC.NCX on devices. It is up to each device on how they handle it (some might have the TOC fully collapsed by default, others might not).

If such a large TOC bothers you, maybe it might be best to just limit the TOC.NCX to Year/Month. (This can be done in Sigil using Tools - Table of Contents - Edit Table of Contents...).

Personally? I would just leave it how it is. Anyone who thinks the TOC.NCX is too cumbersome would be able to use the HTML TOC instead, where they might be able to navigate slightly easier depending on their device.
Attached Files
File Type: epub SampleTOC.epub (6.5 KB, 266 views)

Last edited by Tex2002ans; 10-22-2016 at 06:37 AM.
Tex2002ans is offline   Reply With Quote
Old 10-22-2016, 08:37 PM   #4
ksimpson1986
Member
ksimpson1986 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2016
Device: ibooks
Thanks for the replies everyone...

I'm having an odd issue with this though, if i can figure out how to attach an image with this i'll show you, but i have about 1000 TOC entries that are linked and work correctly. but when i go to "generate TOC", there's nothing there. just a blank window. i'm not sure why it's linked...but it's not linked? i have no clue. this is the one thing with Sigil that's blowing my mind. i feel so limited with this.
Attached Thumbnails
Click image for larger version

Name:	Capture1.PNG
Views:	431
Size:	112.8 KB
ID:	152533   Click image for larger version

Name:	Capture2.PNG
Views:	387
Size:	24.8 KB
ID:	152534   Click image for larger version

Name:	Capture3.PNG
Views:	399
Size:	60.1 KB
ID:	152535  
ksimpson1986 is offline   Reply With Quote
Old 10-22-2016, 08:54 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,883
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
The tool does not work from the HTML TOC

It uses the Headings (h#) as section title and anchors
h1
h2
h3
to generate the nest

Warning: The Generate HTML TOC then uses the NCX This will REPLACE any declared Table of Content (semantic)
theducks is offline   Reply With Quote
Advert
Old 10-22-2016, 09:57 PM   #6
ksimpson1986
Member
ksimpson1986 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Oct 2016
Device: ibooks
so if i'm understanding you correctly, although this would be a long process, could i attach an H1 command to all 12 months(causing them to collapse?), then H2 to each day of the month, then H3 to the title under each day of the month, and so on? that would help it understand? i'll do whatever i need to do to make sure it's right.
ksimpson1986 is offline   Reply With Quote
Old 10-22-2016, 10:04 PM   #7
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by ksimpson1986 View Post
but when i go to "generate TOC", there's nothing there. just a blank window. i'm not sure why it's linked...but it's not linked? i have no clue. this is the one thing with Sigil that's blowing my mind. i feel so limited with this.
As theducks mentioned, Sigil's "Tools - Table of Contents - Generate Table of Contents" is helpful + works when you have a document that is properly marked up using the <h1-h6> tags. Like this:

Spoiler:
Code:
<h1>January</h1>

<h2>January 1</h2>

<h3>Say Goodbye to the Past and Hello to the Future!</h3>

<h4>—Philippians 3:13</h4>

<p>Blah blah blah text.</p>


It won't be able to automatically generate a TOC for you if you have code using <p>s and <div>s like this (I ripped this out of one of the latest InDesign EPUBs I worked on):

Spoiler:
Code:
<div id="_idContainer000" class="Basic-Text-Frame">
	<p class="Chapter-number ParaOverride-1"><span class="CharOverride-1">chapter 1</span></p>
	<p class="Chapter-heading"><span class="CharOverride-2">Education in California</span></p>
</div>
[...]


Quote:
Originally Posted by ksimpson1986 View Post
I'm having an odd issue with this though, if i can figure out how to attach an image with this i'll show you, but i have about 1000 TOC entries that are linked and work correctly.
Ok, from your images I can tell that this is some really rotten code that InDesign created (both for the HTML TOC + the TOC.NCX).

We might be able to salvage something meaningful and better using Regex + digging into the nitty gritty.

Mind sharing this EPUB on the board? Or if it is copyrighted, would you mind putting the EPUB on a filesharing site (Google Drive, etc. etc.) and sending me a link via PM?

Side Note: I also can't see much of a reason WHY this specific book would need a TOC nested four deep (Month -> Month Day# -> Title -> Bible).

Are there multiple sermons per day, or multiple Bibles under each day?

I think it would be better organized by condensing the Month Day# + Title... and maybe the Bible in there too.

Original:

- January
-- January 1
--- Say Goodbye to the Past and Hello to the Future!
---- —Philippians 3:13

Potential #1:

- January
-- January 1: Say Goodbye to the Past and Hello to the Future!
--- —Philippians 3:13

Potential #2:

- January
-- January 1: Say Goodbye to the Past and Hello to the Future! (Philippians 3:13)

Last edited by Tex2002ans; 10-22-2016 at 10:08 PM.
Tex2002ans is offline   Reply With Quote
Old 10-22-2016, 10:15 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,883
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
You might be able to do a creative REGEX (or use the toolbag plugin) to replace all TAG instances of
<p class="foo">
with <h3> and you can tick the box to optionally keep the class assigned

also the TOC tool will use the value from title='short name here" if it is present, instead of using the header (visible) text
theducks is offline   Reply With Quote
Old 10-23-2016, 02:17 AM   #9
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by theducks View Post
The tool does not work from the HTML TOC

It uses the Headings (h#) as section title and anchors
h1
h2
h3
to generate the nest

Warning: The Generate HTML TOC then uses the NCX This will REPLACE any declared Table of Content (semantic)
Not necessarily. The automated tool uses the heading tags, but it is not the only way. In fact, if you go to the 'edit TOC' option via the menu, you can add/remove/change all kinds of TOC entries. Not only from headers, but from all kinds of links, including p and div tags.
Toxaris is offline   Reply With Quote
Reply

Tags
table of contents, toc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Problems with Collapsible TOC on Paperwhite Siavahda Amazon Kindle 2 07-21-2015 03:04 PM
Multiple HTML files w/ TOC to MOBI, not added in order listed in TOC dysfunction Conversion 3 01-03-2014 12:40 AM
Collapsible TOC - possible? lockheed Amazon Kindle 12 10-12-2012 01:48 PM
Collapsible TOC in pdf files md02439 iRex 3 11-05-2011 05:08 PM


All times are GMT -4. The time now is 04:36 PM.


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