02-18-2022, 12:26 PM | #31 |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Somehow, I fail to see the benefit of hierarchical ids. What exactly would you use them for?
Last edited by Doitsu; 02-19-2022 at 02:24 AM. |
02-18-2022, 04:19 PM | #32 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
Main use at the moment is I would like to create the XHTML TOC such that the link for sections is merely the number like 1, 1.1, etc. with text not as part of the anchor tag. For very long works with many sections, I can then add annotations or highlights for important sections. Helps keep track of important sections of interest in long works.
|
02-18-2022, 06:30 PM | #33 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You're not talking about the anchor tag's id attributes being only numbers are you?
|
02-19-2022, 04:03 PM | #34 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
If ids were as sec1, sec1.1, sec1.1a etc. where I could specify a range of header tags to process e.g. H2 to H4 then after generating the XHTML TOC I could use regex to style sections like:
Code:
<a href=“./file.xhtml#sec1.1”>1.1</a> Section title</a> |
02-19-2022, 04:16 PM | #35 |
Addict
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
Perhaps you could do that with CSS counters. They aren't universally supported AFAIK, but I don't guess that matters so long as they're supported by whatever device you're using.
|
02-19-2022, 05:11 PM | #36 | |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
|
|
02-20-2022, 05:00 PM | #37 |
Evangelist
Posts: 425
Karma: 77256
Join Date: Sep 2011
Device: none
|
Incremental IDs plugin
Maybe I’m missing something but not sure how that’d work. E.g. H3+ after the first H2 numbered sec1.1 1.2 1.2.1 1.2.1 1.3 etc. then next set after second H2 sec 2.1 2.1.1 etc.
I’m ok with CSS counters but not sure how I’d code the links such that they’d include the number and header text would be outside. Maybe possible but haven’t found it yet. |
02-20-2022, 05:57 PM | #38 |
Addict
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
|
I would try first pulling the title text out of the <a> tags via regex, leaving you with static text following an unlabeled link, then add the counter via a::before.
Code:
<a href='#target'></a>My Informative Title Code:
a::before { content: counter(heading) '.' counter(subheading) ': '; } Last edited by phillipgessert; 02-21-2022 at 01:20 PM. Reason: added ::before pseudo element, I don't think it'd work the way I originally had it. |
02-21-2022, 02:00 PM | #39 | ||
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
I've created a proof-of-concept epub3 book with CSS counters based on a StackOverflow post that you could use for testing. (CSS counters work in KF8 and KFX books, however, according to the Amazon Kindle Publishing Guidelines, you can't use them in Kindle books.) |
||
07-10-2022, 12:16 PM | #40 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
I used this plugin to interlink between sections of two xhtml files in an epub, then I split the files with sigil's split marker, and it didn't update the links to the new names of the xhtml files. Don't know whether this is an issue with Sigil or with the Plugin. I'm using an old version of sigil, the last one with "book view".
Anyway awesome job |
07-10-2022, 01:16 PM | #41 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Working links are updated (href, src, etc) but ids are not changed as they must be unique strings in any one file so splitting them will not impact that uniqueness.
Last edited by KevinH; 07-10-2022 at 01:18 PM. |
07-11-2022, 12:59 AM | #42 | |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Please validate your epub book with my EpubCheck plugin before and after using the AddIDs plugin. (You can also check links in your book with Tools > Reports > Links.) If either tool reports broken links after using the AddIDs plugin, you most likely didn't use the plugin correctly. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The new PaperWhite snuck out! Incremental update | mewmartigan | News | 192 | 09-13-2013 07:28 AM |
search and replace with incremental number | pimpoum | General Discussions | 4 | 07-08-2011 02:41 PM |
Developers, please implement an incremental update feature | usedtowork | Calibre | 7 | 03-21-2011 06:58 PM |
Can we at least have an incremental firmware upgrade? | mwlcarter | Kobo Reader | 2 | 05-23-2010 02:35 PM |