Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2023, 05:07 PM   #16
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,156
Karma: 4917718
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by BeckyEbook View Post
Identifiers are added only to those headers that are in the same file. And that's a very good thing.
Yes, a single header does not need an ID, but subsequent headers in the same xhtml file will need one.

I think @stumped is under the mistaken idea that the TOC needs ID's to work, which is not the case for a single header, as far as I understand it.
Karellen is online now   Reply With Quote
Old 07-25-2023, 05:11 PM   #17
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
On generating a Table of Contents + "Chapter Images"... also see:

That's the last time I remember it was all discussed.

It gave examples, details, and why it's also not that great of an idea to have images-as-chapter-headings.

Similarly, we also discussed "Discworld" and similar "entire book has no chapters, so how do I deal with it?" situations:

Quote:
Originally Posted by Karellen View Post
I wonder if @Turtle91 would like to comment. Haven't seen him around for a while...
Yes, I'm thinking the same thing. I think I sense a ghostly presence in this thread though!

Quote:
Originally Posted by BeckyEbook View Post
Surely this is the situation:

[...]

Identifiers are added only to those headers that are in the same file. And that's a very good thing.
Yep. Exactly how I read it too.

Quote:
Originally Posted by Karellen View Post
I think @stumped is under the mistaken idea that the TOC needs ID's to work, which is not the case for a single header, as far as I understand it.
Correct. In many cases, Sigil will just point to the very beginning/top of the file:

Code:
<p class="tocone"><a href="../Text/Chapter01.xhtml">Chapter 1</a></p>
That points straight to the Chapter01 file, so there's no need for a specific ID.

Last edited by Tex2002ans; 07-25-2023 at 05:23 PM.
Tex2002ans is offline   Reply With Quote
Advert
Old 07-25-2023, 06:00 PM   #18
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
@DiapDealer.

Surely this is the situation:

Code:
  <h1>Chapter 1</h1>
  <p>Blah, blah, blah</p>
  <h2>Subchapter A</h2>
  <p>Blah, blah, blah</p>
  <h2>Subchapter B</h2>
  <p>Blah, blah, blah</p>
  <h2>Subchapter C</h2>
  <p>Blah, blah, blah</p>
After creating TOC/NCX:

Code:
  <h1>Chapter 1</h1>
  <p>Blah, blah, blah</p>
  <h2 id="sigil_toc_id_1">Subchapter A</h2>
  <p>Blah, blah, blah</p>
  <h2 id="sigil_toc_id_2">Subchapter B</h2>
  <p>Blah, blah, blah</p>
  <h2 id="sigil_toc_id_3">Subchapter C</h2>
  <p>Blah, blah, blah</p>
Identifiers are added only to those headers that are in the same file. And that's a very good thing.
Yes. That makes sense. I read his post wrong, I guess. If there's only one header, there's no need for an id. The toc goes to the top of the file in that case.
DiapDealer is offline   Reply With Quote
Old 07-25-2023, 11:56 PM   #19
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
That's it.
It's all about tricking sigil to add incremental ids to new h3 tags
I did not invent that 2014 recipe, I just used it. Doitsu was the author I think

I should also have added, that after creating all temporary h2 lines, I used calibre with structure detect to split the book into lots of html files, one per chapter.
Only then do I regenerate toc in sigil.
stumped is offline   Reply With Quote
Old 07-26-2023, 07:45 AM   #20
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by stumped View Post
That's it.
It's all about tricking sigil to add incremental ids to new h3 tags
I did not invent that 2014 recipe, I just used it. Doitsu was the author I think

I should also have added, that after creating all temporary h2 lines, I used calibre with structure detect to split the book into lots of html files, one per chapter.
Only then do I regenerate toc in sigil.
You can also use Sigil to split a really long file into smaller ones. Continuing with your current example:

Code:
Find: 
<p class="textbreak"><span class="dropcap"><span><img src="../images/00003.jpeg" alt="" class="calibre7"/></span></span></p>

Replace: 
<hr class="sigil_split_marker" />
<p class="textbreak"><span class="dropcap"><span><img src="../images/00003.jpeg" alt="" class="calibre7"/></span></span></p>

Select: edit, split at markers (F6)
Then continue with the steps I posted previously.
Turtle91 is offline   Reply With Quote
Advert
Old 07-26-2023, 07:58 AM   #21
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,512
Karma: 129668758
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
You can also use Sigil to split a really long file into smaller ones.
It would be nice to be able to see what the sizes of the file resulting files will be before they are split. That makes it a lot easier to find a place to split if it's not at a chapter start.

A good example is Discworld. No chapters and I've seen some of the eBooks not properly split.
JSWolf is offline   Reply With Quote
Old 07-26-2023, 08:24 AM   #22
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
If there isn’t at least some separator indication (ie just continuous paragraphs) then, in Sigil, you would just manually insert the split marker wherever (after every x number of paragraphs). You could then run a report which would tell you how many KBs are in each file; then add an additional split if files are too large. This is an (outdated?) concern, as most readers/devices don’t have that old file size limit anymore.

However, the point I think you are trying to make is that Calibre has a splitting-on-size function.
Turtle91 is offline   Reply With Quote
Old 07-26-2023, 10:48 AM   #23
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,930
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I just scroll down n (of typical dialog) lines in the editor, find a natural looking place to break (usually a scene or POV change)
theducks is offline   Reply With Quote
Old 07-26-2023, 11:07 AM   #24
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
Quote:
Originally Posted by Karellen View Post
Yes, a single header does not need an ID, but subsequent headers in the same xhtml file will need one.

I think @stumped is under the mistaken idea that the TOC needs ID's to work, which is not the case for a single header, as far as I understand it.
Nol it's that I need sequential tocds so that I can rexex the numbers into my headers.
I see no other way to generate chapter numbers across 144 files. My example has 144 chapters, too many to number them manually
E.g. find <h2 toc_id(\d+) >placeholder
Replace <h2 > \1
stumped is offline   Reply With Quote
Old 07-26-2023, 12:50 PM   #25
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by stumped View Post

I see no other way to generate chapter numbers across 144 files. My example has 144 chapters, too many to number them manually
E.g. find <h2 toc_id(\d+) >placeholder
Replace <h2 > \1
Did you see my responses above??

I’m starting to think you have my posts blocked… lol
Turtle91 is offline   Reply With Quote
Old 07-26-2023, 02:16 PM   #26
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by stumped View Post
It's all about tricking sigil to add incremental ids to new h3 tags
I did not invent that 2014 recipe, I just used it.
You keep on mentioning this mythical "2014 post" or instructions. Can you link us to the exact post, so we can see what the heck you are talking about?

And why keep using the 2014 method, when multiple people have explained alternate and much better/easier/faster—2023—methods.

Quote:
Originally Posted by stumped View Post
I should also have added, that after creating all temporary h2 lines, I used calibre with structure detect to split the book into lots of html files, one per chapter.
Only then do I regenerate toc in sigil.
So your ultimate goal is to SPLIT the HTML files based on chapters/headings?

Then just use Sigil's:
  • Edit > Split at Markers (F6)

You can use Search/Replace (or Regular Expressions) to insert this code:

Code:
<hr class="sigil_split_marker" />
wherever you want Sigil to split an HTML file for you:


Code:
<hr class="sigil_split_marker" /><h2>Chapter 1</h2>

<hr class="sigil_split_marker" /><h2>Chapter 2</h2>

<hr class="sigil_split_marker" /><h2>Chapter 3</h2>
Then you press that shortcut, and boom... Sigil splits the HTML files exactly where that <hr> code existed.

I think it's WAY easier than Calibre's Xpath stuff.

- - -

I explained step-by-step instructions for Sigil's "Split Markers" multiple times:

- - -

Quote:
Originally Posted by Turtle91 View Post
Quote:
Originally Posted by stumped View Post
I see no other way to generate chapter numbers across 144 files. My example has 144 chapters, too many to number them manually
E.g. find <h2 toc_id(\d+) >placeholder
Replace <h2 > \1
Did you see my responses above??

I’m starting to think you have my posts blocked… lol
lol. I sense another ghostly turtle-shaped presence!
Tex2002ans is offline   Reply With Quote
Old 07-26-2023, 03:05 PM   #27
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Who's this Turtle-person everyone keeps mentioning?
DiapDealer is offline   Reply With Quote
Old 07-26-2023, 03:20 PM   #28
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,406
Karma: 145748708
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Tex2002ans View Post
You keep on mentioning this mythical "2014 post" or instructions. Can you link us to the exact post, so we can see what the heck you are talking about?
I suspect the thread being referred to is: Mass find and replace for chapter numbers, especially message #5 in the thread.

Quote:
Originally Posted by Tex2002ans View Post
And why keep using the 2014 method, when multiple people have explained alternate and much better/easier/faster—2023—methods.
Baby duckling syndrome?
DNSB is online now   Reply With Quote
Old 07-27-2023, 12:13 PM   #29
stumped
Wizard
stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.stumped ought to be getting tired of karma fortunes by now.
 
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
Quote:
Originally Posted by DNSB View Post
I suspect the thread being referred to is: Mass find and replace for chapter numbers, especially message #5 in the thread.



Baby duckling syndrome?

this is getting somewhat confusing and insulting

for the record
1. i created the thread, but after 2 days there was no posted help
2. so I went searching and found the infamous/ inefficient/bad solution which I used successfully, and partially quoted, to help anyone else searching for similar help.

3. sometime after that , the cavalry arrived with various smart solutions

4.but there was also one person querying my posted code so i posted more, trying to explain what I had already done, step by step ( note: past tense, already done, before any advice got posted - only to get accused of ignoring the help and of promoting an outdated, poor quality solution


this baby duckling, however, still flounders on" what it the elegant solution to generating non existent incremental chapter NUMBERS and getting those into the code & the toc"
[ without using a plug in]

the smart help seems more focussed on how to split one file into separate chapters using sigil not calibre, and on ridiculing the only solution that google search was able to find for me, but not on a smarter way to conjure up 144 chapter numbers out of this air

Last edited by stumped; 07-27-2023 at 12:18 PM.
stumped is offline   Reply With Quote
Old 07-27-2023, 12:25 PM   #30
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,117
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Sorry, no.

1. BeckyEbook posted an answer to your question within 2 HOURS...not days.

2. Also, you never said [without using a plugin] until just now... If you don't want to use a plugin, that's fine, but that is how we are telling you to "elegantly solve your problem."

3. It appears you have several of the people on this thread 'blocked', or you just refuse to read their posts...that, I'm afraid, is on you.

4. You probably won't be able to read this thread either so

Turtle91 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating hidden or invisible page numbers jmurphy Workshop 9 03-10-2023 02:49 PM
Remove Chapter Numbers Rahm Conversion 3 11-04-2021 01:39 PM
Free (nook/Kindle/iTunes/ePub) Elegant Solution [Xtian 1720s Mathematical Thriller] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 1 01-27-2015 10:43 AM
Regex Solution to hidden href search? MizSuz Sigil 16 09-29-2012 07:40 PM
chapter numbers are graphical alansplace Sigil 6 07-04-2011 10:10 AM


All times are GMT -4. The time now is 07:29 PM.


MobileRead.com is a privately owned, operated and funded community.