01-30-2013, 04:47 PM | #31 |
Sigil developer
Posts: 1,274
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? |
01-30-2013, 05:37 PM | #32 |
A Hairy Wizard
Posts: 3,119
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
|
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 |
Advert | |
|
01-30-2013, 05:42 PM | #33 | |
The Grand Mouse 高貴的老鼠
Posts: 71,624
Karma: 306652114
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
Kind: Application (Intel) Size: 77.7MB [...] Version: 0.6.2 |
|
01-30-2013, 06:25 PM | #34 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
My editor (epp) has a counter which will number a list sequentially. <h2 id="Ch_%MATCH%"> Perhaps there is something similar in Sigil. |
|
01-30-2013, 07:23 PM | #35 | |
Resident Curmudgeon
Posts: 74,585
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Last edited by Jellby; 02-01-2013 at 08:21 AM. Reason: fixed markup |
|
Advert | |
|
01-30-2013, 09:00 PM | #36 |
A Hairy Wizard
Posts: 3,119
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
|
|
01-30-2013, 09:01 PM | #37 |
A Hairy Wizard
Posts: 3,119
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
|
Doesn't Sigil automatically generate a sequenced id for any TOC entries that DON'T have an id??
|
01-30-2013, 09:31 PM | #38 |
Well trained by Cats
Posts: 29,965
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
01-30-2013, 09:46 PM | #39 |
Resident Curmudgeon
Posts: 74,585
Karma: 130140792
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
01-31-2013, 03:13 AM | #40 |
Sigil developer
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
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. |
01-31-2013, 07:09 AM | #41 |
A Hairy Wizard
Posts: 3,119
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
|
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.
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! |
01-31-2013, 09:16 AM | #42 | |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
TOC / id=
Quote:
Last edited by Jellby; 02-01-2013 at 08:22 AM. Reason: fixed markup |
|
01-31-2013, 09:20 AM | #43 | |
Well trained by Cats
Posts: 29,965
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
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 |
|
01-31-2013, 10:00 AM | #44 | |
A Hairy Wizard
Posts: 3,119
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:
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 |
|
01-31-2013, 04:06 PM | #45 | |
Sigil developer
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
|
Quote:
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. |
|
|
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 |