![]() |
#1 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
ToC renumbering
In toc.ncx, each entry is numbered in sequential order. If one of the entries is deleted, all the entries after that need to be renumbered. Can Sigil do this for us or can it be made to do this for us?
|
![]() |
![]() |
![]() |
#2 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I don't always have an ncx that exactly matches what would be produced by "Generate TOC from headings." I often build portions of the ncx manually.
So while it's certainly not something that will keep me up nights if it never materializes; the ability to sequentially renumber existing ncx entries (without regenerating the toc from headings) would be a feature that I would giggle with glee about. ![]() |
![]() |
![]() |
![]() |
#4 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Could you describe an example a bit more - before after entries in the TOC, and explain how a heading gets removed?
Its something I can add to the issue log to track. In addition to modifying Generate TOC to add the ability to select the heading levels to include in the generated TOC, I've though about using regex to search the document for certain patterns, possibly even entries already in TOC, and then allowing you to choose which entries to include. That would allow auto-renumbering, but is a much bigger issue that may not be as useful. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
do toc numbers have to be sequential ?
I often delete chunks of an existing toc to remove unwanted pages/ matching toc entires from start/end of books & that seems to have no effect on remainder of book. It doesn't seems to matter if toc numbering starts not at 1 or if a later part is removed. e.g. this toc now starts at 2 , but book is fine: <navMap> <navPoint class="chapter" id="prol_1" playOrder="2"> <navLabel> <text>Prologue</text> </navLabel> <content src="Text/StraightIntoDa_prol_1.html"/> </navPoint> <navPoint class="chapter" id="part_1" playOrder="3"> <navLabel> <text>Munich, 1929</text> </navLabel> <content src="Text/StraightIntoDa_part_1.html"/> </navPoint>..... this one starts at 105, then goes 1 thru 99, there is no 100.,101,102,103,104. <navMap> <navPoint class="chapter" id="cd587276-645c-4638-adde-7410bf5899f5" playOrder="105"> <navLabel> <text>Cover</text> </navLabel> <content src="Text/dummy_split_106.html"/> </navPoint> <navPoint class="chapter" id="1f87fc56-2eb2-4723-be6c-bc4bb244aa42" playOrder="1"> <navLabel> <text>Title Page</text> </navLabel> <content src="Text/dummy_split_000.html"/> </navPoint> Last edited by cybmole; 01-16-2012 at 04:06 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
Like I said, it's not that big of a deal for me, but it's something I would use if it did exist. Last edited by DiapDealer; 01-16-2012 at 04:41 PM. |
||
![]() |
![]() |
![]() |
#7 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#8 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
If I remember correctly, in the latest ePub 2 spec, the playOrder property is optional, but if present the values must be unique and consecutive. If you have missing or repeated values it is probably easier to remove them all (they have no use that I know of).
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I should try removing the playorder and see what FlightCrew does.
|
![]() |
![]() |
![]() |
#10 |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
I have a working test version of the tox.ncx playOrder renumbering - right click on the toc.ncx file and select Refresh TOC PlayOrder and the toc.ncx navMap gets re-written exactly the same except the playOrder values start at 1 and increment from there. So you can add something in the middle and it'll correct the numbers.
But I do have some questions. As also mentioned in https://www.mobileread.com/forums/showthread.php?t=75984 I found that the NCX file can also have 2 other types of navigation lists besides the navPoint - navList and pageList. The current Generate TOC From Headings functionality in Sigil does not do anything with navList or pageList, so the renumbering also ignores/deletes these types of lists. However, I'm wondering if anyone uses navList or pageList? If it is used and it is in a toc.ncx that you renumber, then the navList/pageList entries will be removed. If it is used, possibly/likely to be used, then I can extend the code to rewrite those as well - since they also have playOrder numbers. As far as I can see there is only one set of playOrder numbers used by each section, so if there is some specific interlaced ordering of the elements that was manually created in the file then that would be lost and all navPoints would show up before the navList and the pageList items in the playOrder. |
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,586
Karma: 4290425
Join Date: Jun 2009
Location: Foristell, Missouri, USA
Device: Nokia N800, PRS-505, Nook STR Glowlight, Kindle 3, Kobo Libra 2
|
Not all books are designed to really use headers. One book I recently read, used images from Grey's Anatomy to denote breaks in chapters. Now that the ToC editor has been replaced with only the option to generate ToC from headers, stuff like that is now a pain in the ass.
Requiring you to either make ToC by hand, or use traditional Chapter headings really limits artistic license. Hell, we can't even rename the ToC entries anymore in the ToC view. The old Editor, we could rename the entries, incase we wanted the ToC to appear slightly different than how they were at the start of each Chapter. Not only that, but there are legit uses for using Headers but not wanting it to be listed in the ToC. I don't know, why even use Sigil if we're forced to code more by hand. I've been using Sigil for quite a while, and there are some changes that have made things easier, but other it so much more difficult. |
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
|
Quote:
IF the toc editor has been scrapped in 0.5 I will want to stay on 0.4.2! it is there in 0.4.2. which I still use. |
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#14 | |
Sigil developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Quote:
If there are features that you want, then if, when you ask for them, you provide more details it might help get them implemented. For instance, it seems like renaming the entry in the TOC is something that people want. At the moment this can be done by editing the toc.ncx file directly. Or if you generate from headings, then you can put a title value in your heading tag to show the title in the toc instead of the text in the heading. And of course in generating headings you can select which ones to include (0.5.0 even includes an extra drop down that lets you select/unselect based on heading level automatically). I assume, but I'm only guess, that what you want is the ability to select the TOC entry in the active TOC display and to rename it there without going into the toc.ncx file. If so, that's something I can look into. Though it opens the question of whether or not just the toc.ncx file should be updated, or if the element should have its title value changed as well for consistency (which would also keep generate from headings in sync). |
|
![]() |
![]() |
![]() |
#15 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,888
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
where noshow is small or hidden styling. <h# class="image" title="Still anything you want"><img alt="" class="chapterN" src="../Images/00002.jpg" /></h#> My favourite is to use a background image and place text (the number) on top,. 1 image file, not 50 = smaller EPUB |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Generated TOC links back to TOC page in the book | Caleb666 | Sigil | 7 | 08-17-2011 11:58 AM |
Inline TOC from toc.ncx | elmago79 | Kindle Formats | 38 | 03-25-2011 12:56 PM |
ePub TOC to mobi TOC | edmnddntes | Conversion | 5 | 01-24-2011 02:56 AM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |
renumbering a pdf | pimpoum | 1 | 04-30-2009 03:03 AM |