![]() |
An ePub is a zip, so just extract the file you want to modify, change it with vim (or your preferred editor), and zip it back.
|
Doh! I should have thunk of that! Thanks!! By the way I got to the end of my first tutorial with Vim. I can now say I performed my first "yank and put". Pretty neat editor. I have tried to make the ¬ character in Vim but it doesn't work as it does in this message. (alt-170). Can you tell me how to make it in Vim?
update: well it works as you said, sweet! I just copied the "¬" but I still would like to learn how to make it in Vim. Thanks. |
I use ¬ because I can easily input it with my keyboard layout (Spanish): AltGr+6. Use whatever symbol you can find in your keyboard that's not used elsewhere: #, ~, @...
|
Quote:
<ctrl-v>uac<esc> In human language, this means: hold down the "ctrl" key and press v, release both, type uac, then tap the "esc" key. The "ctrl-v" says a multi-keystroke character follows, "u" means it is UTF, "ac" is the hex code for the "not" symbol, and "escape" ends the sequence. Having said all that, it is a lot easier to just use some other seldom-used character that appears on your keyboard, such as "@", instead of the "not" character. |
Thanks, you are right, simple is better :)
|
First thanks for everyones help here. While I haven't posted for help the answers to other peoples problems has helped me as well when I had similar questions. however I have a question that I don't see an answer to.
I am trying to remove a start and end div tag. These span an entire chapter. Code:
<body>FIND Code:
<div class="story" id="part-\d+">(.*?)</div>Code:
<div class="story" id="part-\d+">(.*)</div>EDIT: Ok it seems that the regex was fine, it just doesn't work in 0.5.902 but does work in 0.5.3 which I don't like using much for finding/replacing because over half the time I get left with a literal \1 instead of the actual text. Which of course I have to UNDO, FIND, REPLACE for each. Easy enough when it's a large block of text, not so easy when it's a word or sentence forcing me to do another FIND for any 1< instances. A REPLACE ALL is just a nightmare if you don't have a backup. |
Quote:
Code:
<div class="story" id="part-[0-9]+">(.*?)</div> |
Quote:
|
Help with regex and chapters
I have a book I'm fixing where the chapters are named:
Code:
<p class="calibre4">1</p>How can I change these occurences with, for instance Code:
<h3>Chapter 1</h3>I've tried all the combinations I know of but can't seem to get it done. Many thanks ! Paul |
I suck at regular expressions, but this should work in Sigil 0.5.3:
Find: <p class="calibre4">(\d+)</p> Replace: <h3>Chapter \1</h3> |
@Danger: In most regex flavors dot(.) does not match newline characters by default. Your case requires the dot to match newlines. In Sigil either select Regex Dotall from the mode listbox(beta version does not have that mode iirc), or append (?s) in front of your find pattern. Example:
Code:
(?s)<div class="story" id="part-\d+">(.*)</div> |
Quote:
It definitely worked ! :thumbsup: |
Quote:
|
Quote:
Code:
(?sm)<div class="story" id="part-\d+">(.*?)</div> |
I would like to change the capitalization a particular phrase across a book e.g. chapter one to Chapter One. I can detect the instances using (\D+) (\D+) and know the replacement would be \1 \2, but not how to change the capitalization.
|
| All times are GMT -4. The time now is 07:52 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.