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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-17-2018, 04:47 PM   #1
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
How to put the Index in the TOC

Greetings. I just found Sigil to edit my eBooks. What a great editor! It is a marvelous tool, so I am studying it to understand all the details in order to get the most out of it. I am creating the books entirely within Sigil, so there are no import issues to deal with.

In my eBook, I am generating a TOC and an HTML TOC and an Index automatically. What I would like to do is add the Index to the TOC. The Index is at the end of the book, and it is not even apparent that there is an Index when I open the book. I also have to manually go to the end of the book (scroll scroll scroll) just to get to the Index. It would be nice if I could have a link to the Index in the TOC.

Since the TOC and the Index files are rewritten each time I update them, adding an <h1> tag to the Index is not a permanent solution. Manually editing the TOC to add the Index also gets overwritten.

Does anyone know of a way to have Sigil add the Index to the TOC when the files are generated automatically? It would be nice if I didn't have to edit the TOC or the Index manually after each update.

Thanks
Banjo
(_)=='=~
Banjo is offline   Reply With Quote
Old 09-17-2018, 06:19 PM   #2
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 680
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Kindle (Key3, PW2, PW3), Nook (ST, GLP), Kobo Touch, Tolino Vision 2
I see two solutions.

1. Build your own version of Sigil, in which the index file will have the h1 tag.
All you have to do is correct two lines in file /src/MiscEditors/IndexHTMLWriter.cpp
Here and here.

And one line in file /src/BookManipulation/Book.cpp
Here

But of course I understand that this is not a solution for everyone.

2. Replace (only once) the entry in the css file for the index: div.sgc-index-title to h1.sgc-index-title

Instead of manually replacing div with h1 – use the plugin.
Based on a simple example prepared by Doitsu.
If you use a non-English version of Sigil, replace the word "Index" in the plugin.py file (line 9) with the translated one.

Maybe someone will come up with other solutions?
Attached Files
File Type: zip IndexH1.zip (1,000 Bytes, 142 views)
BeckyEbook is offline   Reply With Quote
Advert
Old 09-17-2018, 06:51 PM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,532
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
If you wait until all edits are complete, it doesn't seem that onerous to me to do a one time manual edit of the html toc and the ncx to pop the index page into them. Saved clips could make it even more trivial.
DiapDealer is offline   Reply With Quote
Old 09-17-2018, 10:18 PM   #4
Banjo
Zealot
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 120
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Thanks for the quick replies. I will look into those ideas.

I agree that it is not a big deal to do a quick edit of the TOC files after the updates. It would just be a matter of not forgetting to do it. But that is certainly not a show-stopper.

It would be interesting to compile a unique version of Sigil, but that will take me some time to set up. I am running on Linux Mint 18.1. I have Qt Creator installed. Would that be an appropriate IDE to use for builds?

Banjo
(_)=='=~
Banjo 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
E-book viewer TOC won't stay put wildchild1954 Calibre 3 06-21-2018 06:24 AM
Put Flightcrew PI in Index BetterRed Plugins 1 12-16-2016 04:47 PM
Marvin crashes on Index/ ToC links of some ePub books - How do I debug? crashnburn Marvin 1 02-06-2016 02:12 PM
Feature request: Ability to put a book in a series without an index number lunixer Calibre 6 08-29-2011 11:37 AM
TOC and Index links in Sigil Bamber ePub 10 11-11-2010 02:12 PM


All times are GMT -4. The time now is 12:06 AM.


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