![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
About navpoints and their ids
Hi
Sometimes we have to rebuild the toc.ncx file and replace the existing one. The Calibre editor does it very well. I remarked that all the newly created navpoints ids coming from the Calibre editor use uuids, instead of a "natural" incremental value (like text1, text2, etc.). I would have better limit the use of uuid exclusively to the book identifier because it's a very unfriendly qualifier and not for such common things like navpoints ids. However, when I looked how to replace these uuids with incremental values, I realized that it seemed a complicated thing to do, either using CSS or worse even regexes, which may explain Kovid Goyal's choice. Has somebody found a simple way to insert incremental values in EPUB (for navpoints ids or for some other use?). If I use Sigil 6.2 to rebuild the toc.ncx file, I will obtain incremental values for navpoints ids (navpoint-1; etc.) so there should be a way? Last edited by roger64; 09-25-2014 at 03:59 AM. Reason: sigil |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Guess, you like to use it for generating chapter numbers in a toc, there is an other way you can go with the editor:
Generate your Toc with the toc generator and then mark all entries, make a right click and do a bulk rename of all selected items. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@Divingduck
Thanks for your input but I refered about the toc.ncx file and its navpoints ids. Calibre use uuid for them and Sigil use incremental values (like 'navpoint-1', 'navpoint-2', etc.). In fact, if you open one EPUB with Sigil and type Ctrl-T, it will rewrite your toc.ncx file and make use of these incremental values. I was just saying that the incremental values (à la Sigil) seem to be more handy than cumbersome uuid. Both are unique identifiers, at least for the file. I wish I could obtain the same result directly with Calibre. Last edited by roger64; 09-26-2014 at 11:34 AM. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,505
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
This is strictly an aesthetic wish, correct? I mean ... once those IDs are created (and are unique), you need not fiddle, adjust--or even look at--them again. I understand wanting simpler, more easily modified code, but this seems to me to be a situation where it just doesn't have any bearing on anything (other than not liking how it looks). The fact is, navpoint ids never need to be adjusted, tweaked, or are even used by any other markup in the ebook. They just need to be unique. They could only be considered "cumbersome" if you actually needed to do anything with them (other than make sure they're there).
If it's that important to you have more aesthetically pleasing navpoint IDs, why not just capture the PlayOrder numeric attribute in a regex search that will allow you to replace the uuid with a simpler, custom ID of your choice based on the incrementing PlayOrder digit(s) you captured? Last edited by DiapDealer; 09-26-2014 at 12:00 PM. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
As well a good hint to use the playorder digits.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
Of course it's a wish and a personal taste. ![]() Thanks anyway for the playorder tip. I will nevertheless follow on using Ctrl-T with Sigil to make these cumbersome uuids disappear (one for the book id is enough for me). |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,505
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
"Lengthy-string-you-don't-like-looking-at-very-much" ... sure. ![]() |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
Regarding the play-order attribute, I read in the specs: Code:
NCX documents that do not contain a DOCTYPE may omit the playOrder attribute. Let me remark also that the navpoint id must be a unique identifier. If I select only the play-order number to replace them (i.e. a plain number with single or double digits), it seems very probable that this number will NOT be an unique identifier suitable for this purpose. If I name them, 'text1', ou 'navpoint-1' (the Sigil way), this risk disappear. Last edited by roger64; 09-27-2014 at 03:00 AM. |
|
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,505
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Play orders don't have to be consecutive, but they can't repeat if present. So if they ARE present in your epubs, it should be trivial to create your "prettier" (and still unique) navpoint id from them using regex search and replace. |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thanks.
Nota: I finally found how to objectively qualify uuids for navpoint ids. They are not "cumbersome", it's just an "overkill". ![]() |
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,505
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#12 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Might this have anything to do with your aesthetic objection?
https://github.com/kovidgoyal/calibr...6ac2e67bb5aabe |
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
indeed!!
![]() God has long ears. Let Him be blessed! ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
NavPoints and Page Maps | MattScott | Kindle Developer's Corner | 15 | 08-08-2012 06:10 AM |
epub->mobi & kindle navpoints | dmaddock1 | Calibre | 1 | 09-04-2010 10:43 AM |
Comic books on the Kindle -- how to put navpoints in a MOBI? | Jackbishop | Workshop | 0 | 02-04-2010 11:00 PM |
NavPoints in Windows MobiPocket Reader | wallcraft | Kindle Formats | 2 | 08-09-2009 07:40 PM |