| 
			
			 | 
		#31 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				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 03:24 AM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#32 | 
| 
			
			
			
			 Evangelist 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 441 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#33 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,891 
				Karma: 207182180 
				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?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#34 | 
| 
			
			
			
			 Evangelist 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 441 
				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>  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#35 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 324 
				Karma: 3200000 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#36 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				Join Date: Dec 2010 
				
				
				
				Device: Kindle PW2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#37 | 
| 
			
			
			
			 Evangelist 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 441 
				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.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#38 | 
| 
			
			
			
			 Addict 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 324 
				Karma: 3200000 
				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 02:20 PM. Reason: added ::before pseudo element, I don't think it'd work the way I originally had it.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#39 | ||
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				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.)  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#40 | 
| 
			
			
			
			 Groupie 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 173 
				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  
		 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#41 | 
| 
			
			
			
			 Sigil Developer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,072 
				Karma: 6361556 
				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 02:18 PM.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#42 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				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 08:28 AM | 
| search and replace with incremental number | pimpoum | General Discussions | 4 | 07-08-2011 03:41 PM | 
| Developers, please implement an incremental update feature | usedtowork | Calibre | 7 | 03-21-2011 07:58 PM | 
| Can we at least have an incremental firmware upgrade? | mwlcarter | Kobo Reader | 2 | 05-23-2010 03:35 PM |