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 08-12-2013, 12:29 PM   #1
automa
Connoisseur
automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.
 
automa's Avatar
 
Posts: 90
Karma: 972092
Join Date: Jan 2012
Device: iPhone
Automation function in Sigil to save a lot of labor?

Is there a setting or certain programming technology by which you could delete all the lines of useless text that are inserted in the book that includes certain words?

What about automating the task of inputting separation lines between the chapters instead of putting them one by one with CTRL SHFT TAB ENTER while scrolling down a long book, which can be a time consuming and tedious process.
automa is offline   Reply With Quote
Old 08-12-2013, 12:39 PM   #2
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: 8,301
Karma: 36122446
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
Since "chapter" has very little definitive meaning in an epub, how would you propose to automate it in a way that would accomodate everyone? Besides, if you have a specific element (or class of element) you want a chapter-break to precede (or follow), then you can automate the process yourself with "Find & Replace." And save it for later use.

Last edited by DiapDealer; 08-12-2013 at 12:42 PM.
DiapDealer is offline   Reply With Quote
 
Enthusiast
Old 08-12-2013, 12:42 PM   #3
automa
Connoisseur
automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.
 
automa's Avatar
 
Posts: 90
Karma: 972092
Join Date: Jan 2012
Device: iPhone
If the Chapter heading section begins with the letter Chapter that would be good enough. Is there a way you can apply heading 1 on all of those paragraphs that begins with the word Chapter? Thank you about the chapter-break idea.
automa is offline   Reply With Quote
Old 08-12-2013, 02:44 PM   #4
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: 8,301
Karma: 36122446
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
Quote:
Originally Posted by automa View Post
Is there a way you can apply heading 1 on all of those paragraphs that begins with the word Chapter?
Regex is your friend here. You should learn the basics of it if you want to start automating stuff to your advantage.

Please don't use this blindly without having good backups (and I'm sure someone will find a more effective/safe way--that's the beauty of regex ) but something like:
Code:
<p([^>]+)>(.*?)Chapter(.*?)</p>
replaced with:
Code:
<h1\1>\2Chapter\3</h1>
might work. It will retain any ids/classes the paragraph might have, as well as any elements that may be in front of/behind "Chapter." Without seeing the code in question, it's always a bit of a crapshoot. Make sure you're in regex S&R mode and have the "DotAll" option checked and the "Minimum Match" option unchecked.

Even so, any legitimate paragraph with the word "Chapter" in it is going to get caught up as well.

If there's a question of case (chapter, Chapter, CHAPTER), simply tell regex to ignore case by preceding the expression with (?i):
Code:
(?i)<p([^>]+)>(.*?)Chapter(.*?)</p>

Last edited by DiapDealer; 08-12-2013 at 02:51 PM.
DiapDealer is offline   Reply With Quote
Old 08-12-2013, 03:02 PM   #5
automa
Connoisseur
automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.
 
automa's Avatar
 
Posts: 90
Karma: 972092
Join Date: Jan 2012
Device: iPhone
Thank you. And then after that, is there a way to automate the inserting of split marker right before all the heading 1s?
automa is offline   Reply With Quote
Old 08-12-2013, 03:23 PM   #6
RbnJrg
Addict
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 371
Karma: 255494
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by automa View Post
Thank you. And then after that, is there a way to automate the inserting of split marker right before all the heading 1s?
With Find & Replace:

1. In the "Find" field, write "<h1" (if the heading tag is <h1>; if the heading tag would be -for example- <h2> then you should write "<h2" -no quotes-)
2. In the "Replace" field write "<hr class="sigil_split_marker" />\n\n<h1" (no quotes)

After that press the button "Replace All".

To finish, press the key F6 (or select the menu "Edit" and execute the command "Split at Markers").

Rubén
RbnJrg is offline   Reply With Quote
Old 08-12-2013, 03:27 PM   #7
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: 8,301
Karma: 36122446
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
Quote:
Originally Posted by automa View Post
Thank you. And then after that, is there a way to automate the inserting of split marker right before all the heading 1s?
What am I... the regex store?

Just add Sigil's split marker code
Code:
<hr class="sigil_split_marker" />
to the front of my above Replace expression and you can do it all in one fell swoop. You have to at least try. You'll find I'm a terrible spoonfeeder.
DiapDealer is offline   Reply With Quote
Old 08-12-2013, 03:59 PM   #8
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: 8,301
Karma: 36122446
Join Date: Jan 2010
Device: Kindle Fire HD, Kindle 2
Actually, my initial expression will only match paragraphs that DO have some sort of class, id or other attribute assigned. If there are any bare paragraph elements (<p>) to be included in the match, I'd recommend changing the:
Code:
<p([^>]+)>
part of the Find expression to:
Code:
<p([^>]*?)>

Last edited by DiapDealer; 08-12-2013 at 04:02 PM.
DiapDealer is offline   Reply With Quote
Old 08-12-2013, 04:08 PM   #9
automa
Connoisseur
automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.automa ought to be getting tired of karma fortunes by now.
 
automa's Avatar
 
Posts: 90
Karma: 972092
Join Date: Jan 2012
Device: iPhone
Thank you! How do I get into Regex S&R mode?
automa is offline   Reply With Quote
Old 08-12-2013, 07:58 PM   #10
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,003
Karma: 10381859
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by DiapDealer View Post
What am I... the regex store?
Apparently.

automa:

You should look for "RegexBuddy," which is a fabulous Regex learning program, only $40.00. There's also a fabulous Regex section here in the Pinned stuff, above. There are entire websites and forums dedicated to Regex which I'm sure you'll find incredibly useful.

Hitch
Hitch is offline   Reply With Quote
Old 08-13-2013, 01:31 AM   #11
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 2,732
Karma: 2117243
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
There are also various cheatsheets around that will help you.

You are by default in regex mode. You can verify it in the S&R window.
Toxaris is offline   Reply With Quote
Old 08-13-2013, 03:15 AM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,789
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
When learning regex you just have to take into account that there are many dialects, and sometimes you need to adapt the recipes from one dialect to another.
Jellby is offline   Reply With Quote
Old 08-13-2013, 05:28 AM   #13
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 2,003
Karma: 10381859
Join Date: Apr 2010
Location: Phoenix, AZ
Device: Kindle2, iPad, KindleFire and NookColor
Quote:
Originally Posted by Jellby View Post
When learning regex you just have to take into account that there are many dialects, and sometimes you need to adapt the recipes from one dialect to another.
As is true of all HTML, XHTML and CSS, too! I usually compare trying to read someone else's HTML & CSS to knowing one dialect of Chinese and trying to read another...it's all much of a thing, isn't it? Like Regex...once you know how to say it in PCRE, you can say it somewhere else, it's just getting the "accents" right. ;-)

I always cringe when I get an email from someone who wants us to "fix their HTML," (or their INDD, etc.), usually for $5-$25 (ha!). I tell them, it's frankly faster and cheaper for us to do it from scratch, at least, most of the time. Trying to troubleshoot someone else's HTML, CSS, etc., takes more time than doing it over.

Hitch
Hitch is offline   Reply With Quote
Old 08-13-2013, 08:11 AM   #14
phossler
Addict
phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!phossler is faster than a rolling 'o,' stronger than silent 'e,' and leaps capital 'T' in a single bound!
 
Posts: 233
Karma: 50154
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
Quote:
Originally Posted by automa View Post
Thank you! How do I get into Regex S&R mode?
In the F&R area, there's usually [Normal] displayed

From that dropdown, you can select [Case Sensitive] and/or [Regular Expression]

(Doing this from memory since no Sigil on this system)

Paul

Last edited by phossler; 08-13-2013 at 08:29 AM.
phossler is offline   Reply With Quote
Old 08-20-2013, 12:19 PM   #15
Turtle91
Guru
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: 669
Karma: 3807234
Join Date: Dec 2012
Location: Shannon, Ireland today
Device: iPhone 5/iPad 1&2/Surface Pro/Kindle PW
Quote:
Originally Posted by phossler View Post
(Doing this from memory since no Sigil on this system)

BLASPHEMER!!!!!


Turtle91 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.5.3: Remarks on search function DrChiper Sigil 8 10-12-2012 01:43 PM
Is it possible to turn off all automation in Sigil? Iznogood Sigil 7 06-13-2012 04:05 AM
Sigil Save As... Fabe Sigil 5 01-20-2012 08:55 PM
0.7.1 Save to Disc function fixed? grizedale Calibre 9 06-07-2010 04:49 PM
Save to Disk Function Lady Fitzgerald Calibre 8 06-07-2010 10:06 AM


All times are GMT -4. The time now is 11:05 PM.


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