09-17-2018, 04:47 PM | #1 |
Zealot
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 (_)=='=~ |
09-17-2018, 06:19 PM | #2 |
Guru
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
|
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? |
09-17-2018, 06:51 PM | #3 |
Grand Sorcerer
Posts: 27,547
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.
|
09-17-2018, 10:18 PM | #4 |
Zealot
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 (_)=='=~ |
|
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 |