Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2013, 04:47 PM   #31
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
So just a few things then

The ability to search "just down" or "just up" is basically searching without wrapping. And as it happens the next version will have a wrap/no-wrap option for Find & Replace.

There isn't any way to do counters in regex that I know of - but if there is I'd be glad to here about it. I've been wondering about a special search tool that could handle counters - but haven't worked out exactly what to do. Having specific examples of where something like this would be useful starting place. Usually the problem is that the counter needs to be updated identically in more than one place. I doubt it would do Roman numerals though

But what are you actually doing with the changes. Just updating the heading ids? Updating the ids to match the heading text or title. Do you have some specific before and after examples?
meme is offline   Reply With Quote
Old 01-30-2013, 05:37 PM   #32
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,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Great news on the wrap/no wrap!
I suppose I could make a REALLY LONG saved group for the roman numerals....

I was inserting id's to match the heading text in a condensed format. "Ch_1" for "Chapter 1", "Pt_2" for "Part 2", etc. I thought that would provide a more intuitive meaning than a generic sequence number when I review links - especially in other files.

example:
original headings
<h2>Part 1</h2>
<h3>1</h3>
<h3>2</h3>
<h3>3</h3>
<h2>Part 2</h2>
<h3>1</h3>
<h3>2</h3>
<h3>3</h3>
yadda, yadda

Replace Part headers: Find <h2>Part (.*?)</h2> Replace <h2 id="Pt_\1">Part \1</h2>
Replace Chapter headers: Find <h3>(.*?)</h3> Replace <h3 id="Ch_\1">\1</h3>

gives <h2 id="Pt_1">Part 1</h2> <h3 id="Ch_3">Chapter 3</h3>

This results in duplicate Chapter id's so I go to the beginning of each part and replace to the end (without wrap):
Find id="Ch_(.*?)"> Replace "Ch_1-\1">
/* which changes ALL the chapter headings but still have duplicates.

Then go to part 2
Find id="Ch_1-(.*?)"> Replace "Ch_2-\1">
/* which changes ALL the chapter remaining headings EXCEPT part 1

Then go to part 3
Find id="Ch_2-(.*?)"> Replace "Ch_3-\1">
/* which changes ALL the chapter remaining headings EXCEPT part 1 and part 2

etc, until the end of the file
Turtle91 is offline   Reply With Quote
Advert
Old 01-30-2013, 05:42 PM   #33
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by mibtp View Post
Hi, I also have Mac OS x 10.6.8 and this version will not launch on my system. There is a slash though the icon.

Any other versions I should look into?

Thanks.
Patrice
How odd. Perhaps your download has got corrupted in some way. If you do a Get Info on it, it should say:

Kind: Application (Intel)
Size: 77.7MB
[...]
Version: 0.6.2
pdurrant is offline   Reply With Quote
Old 01-30-2013, 06:25 PM   #34
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by Turtle91 View Post
I would like a "just down" or "just up" option if it's possible.

As an example:
Sometimes the books I edit have different "parts", Part 1, Part 2, etc.

Each Part's chapters restart numbering from chapter 1 instead of being continuous through the whole book.

So when I use a search replace to create an id for the chapter head I begin at the new Part and replace all following chapters with the part number and chapter...then do that again with the next part. so I get id="Ch_1-1", id="Ch_1-2"..., id="Ch_2-1", id="Ch_2-2"...etc. Some of these books have > 100 chapters.

If it circles back and replaces the parts that I've done already then it wastes the effort.

Having said that:
There is probably some more elaborate regex I could create to check for the existence of the "-" in an id, I just haven't figured it out.

Ideally, there would be some process where I could use a counter when replacing, so I could just use id="Ch_1" to id="Ch_100"...does anyone know if there is such a "counter"??

And if there is a counter...can I shoot for the moon and get a function that will insert roman numerals??!!?? (id="Ch_69" title="LXIX")
I'm not familiar with the Sigil version of RegEx.

My editor (epp) has a counter which will number a list sequentially.

<h2 id="Ch_%MATCH%">

Perhaps there is something similar in Sigil.
crutledge is offline   Reply With Quote
Old 01-30-2013, 07:23 PM   #35
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: 73,660
Karma: 127838196
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
So when I use a search replace to create an id for the chapter head I begin at the new Part and replace all following chapters with the part number and chapter...then do that again with the next part. so I get id="Ch_1-1", id="Ch_1-2"..., id="Ch_2-1", id="Ch_2-2"...etc. Some of these books have > 100 chapters.
You don't actually need an ID. Each chapter should be a separate XML file. The ToC would just point to the file. No need to point to the ID just to go to the start of a given chapter. if I am modifying the code, IDs that are not needed do have to go.

Last edited by Jellby; 02-01-2013 at 08:21 AM. Reason: fixed markup
JSWolf is offline   Reply With Quote
Advert
Old 01-30-2013, 09:00 PM   #36
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,069
Karma: 18727053
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 crutledge View Post
I'm not familiar with the Sigil version of RegEx.

My editor (epp) has a counter which will number a list sequentially.

<h2 id="Ch_%MATCH%">

Perhaps there is something similar in Sigil.
hmmmm...I'll have to look to see what flavor of regex the two are. Thanks!
Turtle91 is offline   Reply With Quote
Old 01-30-2013, 09:01 PM   #37
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,069
Karma: 18727053
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 JSWolf View Post
You don't actually need an ID. Each chapter should be a separate XML file. The ToC would just point to the file. No need to point to the ID just to go to the start of a given chapter. if I am modifying the code, IDs that are not needed do have to go.
Doesn't Sigil automatically generate a sequenced id for any TOC entries that DON'T have an id??
Turtle91 is offline   Reply With Quote
Old 01-30-2013, 09:31 PM   #38
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,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Turtle91 View Post
Doesn't Sigil automatically generate a sequenced id for any TOC entries that DON'T have an id??
That is what I see

I use 1 chapter per file for my final save
theducks is offline   Reply With Quote
Old 01-30-2013, 09:46 PM   #39
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: 73,660
Karma: 127838196
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
Doesn't Sigil automatically generate a sequenced id for any TOC entries that DON'T have an id??
I remove those too.
JSWolf is offline   Reply With Quote
Old 01-31-2013, 03:13 AM   #40
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by JSWolf View Post
I remove those too.
Interesting. Since Generate TOC points to the filename for headings near the top of a file it does not actually use the id in the TOC.

So there is no reason why we can't skip creating a Sigil-generating id for the heading if its not used by the TOC because its at the top of the file. We already skip creating an id if a heading is marked as not included in the TOC.

And if you do want an id for the heading, you can always manually enter one. Its only the Sigil-generated ids that get removed when they aren't used.
meme is offline   Reply With Quote
Old 01-31-2013, 07:09 AM   #41
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,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I hadn't really thought of not putting id's in my chapter headers. I suppose that comes from making single page HTML For the last several years - its become a habit. But you are right. It certainly isn't needed.

Quote:
Originally Posted by meme View Post
So there is no reason why we can't skip creating a Sigil-generating id for the heading if its not used by the TOC because its at the top of the file. We already skip creating an id if a heading is marked as not included in the TOC.
In older versions of Sigil I noticed it would auto generate id's if a heading was not used in the TOC. I used to use <h6> as a scene break but got tired of seeing the "id=sgc not used" popping up so I switched to <p class="scenebreak">. I haven't looked for that in the recent version, but if Sigil got away from inserting those unnecessary tags that's awesome!
Turtle91 is offline   Reply With Quote
Old 01-31-2013, 09:16 AM   #42
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
TOC / id=

Quote:
Originally Posted by JSWolf View Post
Quote:
Originally Posted by Turtle91 View Post
You don't actually need an ID. Each chapter should be a separate XML file. The ToC would just point to the file. No need to point to the ID just to go to the start of a given chapter. if I am modifying the code, IDs that are not needed do have to go.
Is that the virtual TOC created by Sigil? If I have an actual, hyperlinked TOC, I still need id="chapter01" or whatever, right?

Last edited by Jellby; 02-01-2013 at 08:22 AM. Reason: fixed markup
Notjohn is offline   Reply With Quote
Old 01-31-2013, 09:20 AM   #43
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,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by meme View Post
Interesting. Since Generate TOC points to the filename for headings near the top of a file it does not actually use the id in the TOC.

So there is no reason why we can't skip creating a Sigil-generating id for the heading if its not used by the TOC because its at the top of the file. We already skip creating an id if a heading is marked as not included in the TOC.

And if you do want an id for the heading, you can always manually enter one. Its only the Sigil-generated ids that get removed when they aren't used.
Consistancy!
If you use id's, then use them all places.
I know I when my REGEX fails to find some headings, only to discover some have a different orginazation: IN THE SAME BOOK.

And since some folk like to 'Max out' file size before splitting: some will have many chapters, not just one
theducks is offline   Reply With Quote
Old 01-31-2013, 10:00 AM   #44
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,069
Karma: 18727053
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 Notjohn View Post
Is that the virtual TOC created by Sigil? If I have an actual, hyperlinked TOC, I still need id="chapter01" or whatever, right?
No, you don't "need" an id if the header is at the top of the file....as it is when you split your book into different files for each chapter. Opening a link to a file automatically displays the top/beginning of the file unless another location is specified.

The link for going to the beginning of my Ch_4.html file is:

href="Ch_4.html"

If you had an id="Ch_4" for the header (or if you want to go to a sub-heading somewhere within the file) that link would look like

href="Ch_4.html#Ch_4" or href="Ch_4.html#sub-head_3"

Last edited by Jellby; 02-01-2013 at 08:22 AM. Reason: fixed markup
Turtle91 is offline   Reply With Quote
Old 01-31-2013, 04:06 PM   #45
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by theducks View Post
Consistancy!
If you use id's, then use them all places.
I know I when my REGEX fails to find some headings, only to discover some have a different orginazation: IN THE SAME BOOK.

And since some folk like to 'Max out' file size before splitting: some will have many chapters, not just one
The issue is that Generate TOC creates ids for headings that it needs. It does not current generate ids for headings that are excluded from the TOC (like it used to before 0.6.x). Since Generate TOC only links to the filename for the heading at the top of a file, it does not use an id for that heading. So it should not create an id that it doesn't need to use. So I've modified the code to stop creating the unnecessary ids. We did try linking to just the id instead of the filename for the heading at the top, but that didn't go well as it broke some situations.

Of course, if you add ids to any headings manually, then they'll still be there. And now if you want to link directly to the ids, you can just use the new Edit TOC function.
meme is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil 0.6.0 Released user_none Sigil 93 11-24-2012 06:50 PM
Sigil 0.5.3 Released user_none Sigil 85 05-13-2012 05:29 AM
Sigil 0.4.2 Released user_none Sigil 41 10-26-2011 06:03 AM
Sigil 0.4.1 Released user_none Sigil 50 09-01-2011 04:58 PM
Sigil 0.4.0 and FlightCrew 0.7.2 Released user_none Sigil 13 08-23-2011 02:18 PM


All times are GMT -4. The time now is 02:23 AM.


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