![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
|
Sigil Proper Case Setting
I understand someday Sigil will have a feature where sentences can be converted to uppercase, lowercase and propercase, just like we can do now to make text bold, or italic.
I had found a free "cut and paste" utility that would allow me within Sigil to change text case. Now I cannot find it and I am hoping someone here would remember it. I am not familiar with Regex everyone mentions. I have a book with lot of subheadings that are in Upper case and I wish to change them to upper and lower. The utility I referenced above would cut the text via control -x and then put in back with control -v, but now in proper case. Anyone remember or see that utility? Tom |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Not really Sigil related, but perhaps it's one of the ones listed in this Best Free Clipboard Replacement Utility review site?.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 133
Karma: 998
Join Date: Apr 2010
Device: Nook
|
Thank you. I saw those, though it didn't seem any automatically would change the case, but instead would use an editor. I did find one that works rather well. CaseChanger.
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,895
Karma: 464403178
Join Date: Feb 2010
Location: 33.9388° N, 117.2716° W
Device: Kindles K-2, K-KB, PW 1 & 2, Voyage, Fire 2, 5 & HD 8, Surface 3, iPad
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#5 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,202
Karma: 34984330
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
I have a little autohotkey script I made that works in most any text editor, including Sigil (not in Word or any other app that has that feature built-in).
I wrote it to do Case changes on selected text with double-tap of CapsLock Key, use hotkeys to add curly quotes around selected text, add certain code tags around selected text, double-right-click to copy, triple-right-click to paste. (lots more too). It runs in the background, accessed from the system tray. I've only ever used it in XP SP3, but if anybody is interested, I can upload it. I can even compile it into a tiny exe file, if that is preferred. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
The Sigil PCRE library already supports conversion to upper case and lower case with \U, \u, \L and \l back references.
For example: Find: <p>(.*?)</p> Replace: <p>\U\1\E</p> Before: Code:
<p>This is a test sentence.</p> Code:
<p>THIS IS A TEST SENTENCE.</p>
Replace: <h3>\1\L\2 Before: Code:
<h3>CHAPTER 1</h3> Code:
<h3>Chapter 1</h3>
Replace: <p>\u\1</p> Before: Code:
<p>this is a test sentence.</p> Code:
<p>This is a test sentence</p>
Find: ([[:upper:]]{2,}) Replace: <i>\L\1\E</i> Before: Code:
<p>This should be in ITALICS.</p> Code:
<p>This should be in <i>italics</i>.</p>
Last edited by Doitsu; 09-26-2012 at 04:03 AM. |
![]() |
![]() |
![]() |
#7 |
Jr. - Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Nice catch. I updated the replace string in the first example. And yes, I know that the second search string isn't textbook either, but I wanted to keep it simple.
Last edited by Doitsu; 05-23-2012 at 03:53 PM. |
![]() |
![]() |
![]() |
#11 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#12 | |
Jr. - Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
|
Quote:
Just used it to change chapter headers from "CHAPTER ONE / CHAPTER THIRTY-FOUR" to "Chapter One / Chapter Thirty-Four". Three step process but fast and easy. This is what you call instant gratification. ![]() Regards - John |
|
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2013
Device: Android Smartphone
|
how do I capitalise more than two words in a string
I have a very long list of words that are all in capitals and it is necessary to change them to title case. For instance:
Code:
<li>DOG HOUSE</li> Code:
<li class="small-caps">Dog House</li> Code:
<li>([A-Z])([A-Z]*)</li> Code:
<li>DOG</li> <li>CAT</li> <li>BIRD</li> Code:
<li class="small-caps">\1\L\2</li> |
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You can try:
search: <li>(.*?)</li> replace: <li class="small-caps">\1</li> |
![]() |
![]() |
![]() |
#15 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
@dwlamb: You could try the following: search: <li>([[:upper:]| ]+)</li> replace: <li>\L\1</li> This will change all upper case list items to lower case, and if you're using a Webkit based ebook app (Kindle, iBooks etc.), you could fix the capitalization issue by applying a text-transform style to the <li> element and/or add text-transform: capitalize; to your small-caps style. Code:
li {text-transform: capitalize; font-variant: small-caps;} |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil 0.4.1 : unwanted span added by Sigil | Bertrand | Sigil | 0 | 09-02-2011 05:28 AM |
Sigil 0.3.4 / Sigil 0.4.0 RC1 / Cover in Nook Color | Bertrand | Sigil | 13 | 08-06-2011 04:06 AM |
Sigil 0.3.4 / Problème CSS entre Sigil et iPad | Grivels | Software | 10 | 07-03-2011 09:06 AM |
Proper Use of Kobo?? | strawfordt | Kobo Reader | 7 | 06-03-2010 11:40 PM |
A proper introduction | Seabound | Introduce Yourself | 6 | 09-26-2008 02:24 AM |