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 02-18-2013, 08:14 PM   #1
pete6055
Connoisseur
pete6055 began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Nov 2012
Device: none
Sigil 7.0 and the fix for issue 1961

Hello:

The fix in 7.0 for issue 1961 has removed one of my favorite tricks in regex.

Suppose your xhtml had <h1>CHAPTER ONE</h1> but you wanted
<h4 title="Chapter 1">1</h4>.

You could always:
1. just select the Chapter files
2. replace <body> with <body>\n<h4 title="Chapter "></h4>
3. generate the TOC to get the sigil_toc_id_#
4 replace <h4 id="sigil_toc_id_([0-9]+)" title="Chapter "></h4> with
<h4 id="sigil_toc_id_\1" title="Chapter \1">\1</h4>

Simple and quick with 2 passes.

But now that sequence numbered ids are no longer generated if they point to
file names, how do I convert my chapters so easily?

Thanks...

Last edited by pete6055; 02-19-2013 at 04:15 PM.
pete6055 is offline   Reply With Quote
Old 02-19-2013, 12:43 PM   #2
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
I'm not aware of any way to generate a sequence of numbers using Regex.

I've been considering providing a tool or search option that allows this, for chapters and endnotes, so I'll put it on the Issues log as a request. It would probably be fairly simple though. Prompt you for a starting number and text to replace (e.g. "SEQUENCE#" or whatever text you type). Then it would just start from the first file and replace each occurrence with the number then increment, or possibly start from where you are in Code View to the end (no wrapping). You would have to convert all the text needing numbers to use "SEQUENCE#" or similar first - and in your case, run this twice since you use the number twice. I'd probably add Roman numerals as an option as well.
meme is offline   Reply With Quote
Advert
Old 02-19-2013, 01:03 PM   #3
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
That sounds like a useful idea, especially for technical work. If it were easy enough, perhaps it would keep people from using ordered lists, which are the devil's spawn!

You might add an option for abcd or ABCD and ) or not ).
mrmikel is offline   Reply With Quote
Old 02-19-2013, 04:13 PM   #4
pete6055
Connoisseur
pete6055 began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Nov 2012
Device: none
Thanks very much for the reply. The enhancement that you're thinking about sounds great.

It seems similar to the way the file remaming function presently works, so I'm wondering if we could pass a number in the file name via a storable variable into an id, or if the id generator can have an option to replace numbers in sequence in selected files?

This is how I used the TOC generator to get around the regex limitation in the first place, so it might be easier to let us configure sigil_toc_# in preferences -- to either emulate the behavior found in version 7.0 or 6.2. You have the old code so branching logic may save the time and effort of developing something new.

If, however, you decide to develop a new tool, I have some thought on that too, so please let me know if I can be of service.
pete6055 is offline   Reply With Quote
Old 02-20-2013, 03:15 PM   #5
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
Just post your suggestions here.
meme is offline   Reply With Quote
Advert
Old 02-22-2013, 06:14 PM   #6
pete6055
Connoisseur
pete6055 began at the beginning.
 
Posts: 66
Karma: 10
Join Date: Nov 2012
Device: none
Ok...

Math/Science Module: Generally, you can't do math functions in regex, so a module for that would be very helpful for technical writers. Right now, cut & paste from an external program is your best option, but not every program will let you save in appropriate html format, so clean-up can be difficult and time-consuming.

File Naming: Give us the option to add both prefix and suffix numbers independently, ideally in one pass, but at least in two. I'm thinking of a file name sequence such as:
00_Title_Page.xhtml
01_Part1.xhtml
02_Chapter_1.xhtml
03_Chapter_2.xhtml

Also give us the ability to pass the existing file name or wild cards in the file name generator. A storable variable could do the trick for the naming features.

As always, I greatly appreciate your team's willingness and effort to constantly refine Sigil. You do such a great job!

Last edited by pete6055; 02-22-2013 at 06:21 PM.
pete6055 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
Easy way to fix font on Sigil? cupidmissed Sigil 3 07-31-2012 05:53 PM
Kobo cannot fix my issue, can you? misticaleclipse Kobo Reader 12 10-09-2011 04:45 PM
Rooted and Cover issue fix (for me) jhempel24 Nook Color & Nook Tablet 0 05-18-2011 12:02 AM
MS Fix for Sigil 3.0 crutledge Sigil 3 09-26-2010 03:56 AM
1961 Kumabjorn General Discussions 13 09-17-2010 11:20 PM


All times are GMT -4. The time now is 09:24 AM.


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