![]() |
#16 | |||||||||
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31
Karma: 1158
Join Date: Jun 2021
Device: Kindle Paperwhite (PW1 & PW3)
|
Quote:
I have an automation button that I can now press & it will "RunSavedSearchReplaceAll" 16 common dumb translation mistakes like "eat a cake and have ourselves a cake" to "have ourselves a cake & eat it too" & "in and out of itself" to "in & of itself" as well as my preferred " and " to " & ", it then finds all "<br/><br/></p> <h1" & replaces them with "</p><hr class="sigil_split_marker" /><h1", I'm still working to get the image part right but that'll be there too when I do, it then does the "SplitOnSGFSectionMarkers" command. All that is done with a single click. Having to, afterwards, find a few pages & delete them manually is less work, by far, than doing the steps manually, which would be required to use the filter results. I do see the benefit of the Filter Results & am glad I was introduced to it as I'm sure I will have use of it in the future. My whole intent is make this a quick process I can do without much thought as it will be the same for a bunch. With only 3 automations I need to find a way that be most uniform instead of what I have now with the "<br/><br/></p> <h1" which works only for the few book in a certain set, right now it's one that is most needed to me because I'm using it to read a book that I have pre-ordered from a certain publisher that gives a way to read it as it's being translated & there's a tool used to turn that into an ePub, which I can then convert to put on my kindle to read enjoyably instead of having to read it on the website. & the book is auto assembled as an ePub so it is a mess. So I have to redo it every week as the next part comes out. But this automation will most likely not work for others as I'm sure 2 line breaks, a Carriage Return, & 6 spaces is not going to be a common chapter split, especially not a Windows-style CR-LF one, but right now that's the only one I need it for. Right now I'm only working on a couple, but I'd like to have it so that I can quickly go through the 200+ Fan Translations that I have & fix the common problems. It'd also be nice to go through all the real books I have, but as it stands I have already set Calibre to replace "and" with "&" when converting to KFX & I manually unzip & flip/rescale images. Unfortunately I don't think an automation will do anything for me to make that quicker. The same applies to the SVG Wrapper, It's not that the system isn't good, I just don't see a way to automate it, meaning it's a lot of extra steps that cannot be automated. Quote:
The comment you are replying to was about SVG Images not about the wrapper. Quote:
Quote:
Quote:
& I'm specifically trying to find a way to have the automation identify & only work on images that are intended to be on their own page. I don't need them to be zoomed in if they are too small, I don't need them to be for every image, some of the ones I have dealt with have a small image at the top of each chapter, I don't want them to be on their own page & I may use the SVG Wrapper when I get to ones like that, but the tings I'm currently dealing with are all intended to, as is the other reason I shared the Professional ones, be seen on a page alone, then the text continue on the next page. Quote:
Quote:
As I've said many times, I'm not trying to split before every image, just before the ones intended to be their own page. That's why I identified that the images tend to have the word "Insert" in their name if they are intended to be their own page & I'm trying to have that work. Quote:
Just like TOR is a professional book publishing company with millions of books & most of their books are crap & poorly edited. I often joke that I believe TOR would publish a book if you sent them a manuscript that was literally typed by a room full of keyboards with a few dozen cats to make 500 pages, gave it a title & a description, & sent it to them. My intention was to indicate that it doesn't seem to be a problem to have the image on a single page like that, it doesn't have any of the problems that I keep being told will happen if I don't use an SVG Wrapper, & to indicate that the intent of the publishers for these images is to have them shown on their own page, not inline. I've very grateful for the help I've received, I greatly appreciate it, I asked why people were being so insistent on SVG Wrappers, got an answer, & decided it was not for me. But people keep insisting it's better, so I point out reasons it has problems that support my decision not to use them. Nobody has even tried to address the glaring issue of the fact that you need to have exact dimension of the image so any image scaling will cause it to break. But I'm in no way dismissing what people are telling me, they are insisting that my decision not to use them is bad or wrong & I'm giving them reasons to support my decision, that's all. Nobody has made a compelling argument to make me reconsider. Quote:
|
|||||||||
![]() |
![]() |
![]() |
#17 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31
Karma: 1158
Join Date: Jun 2021
Device: Kindle Paperwhite (PW1 & PW3)
|
Quote:
For any future searchers looking for this the working Find&Replace is: Step 1: Set [Mode] to Regex (Took me a few tries before I realized I needed to, it's obvious but easily overlooked) Step 2: Find & Replace Code:
Find: <img(.*?)insert(.*?)/> Replace: <hr class="sigil_split_marker" /><img\1insert\2/><hr class="sigil_split_marker" /> Step 3: Edit > Split at Markers ( or press F6) Step 4: Profit Obviously it can be altered however, but the initial one was just missing that Last edited by LostOnTheLine; 11-27-2022 at 02:20 PM. Reason: Formatting |
|
![]() |
![]() |
![]() |
#18 | ||
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,686
Karma: 16000001
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
|
Quote:
Quote:
I apologize for my assumption. Your earlier posts made it sound like you were familiar with the nuances of CSS. Trying to explain why the technique you consider ‘perfect’ doesn’t actually work is very difficult when you don’t understand the CSS and your understanding is that ‘they use this technique in this book I have.’ Cheers, |
||
![]() |
![]() |
![]() |
#19 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,686
Karma: 16000001
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
|
Quote:
I’m glad you got it to work! |
|
![]() |
![]() |
![]() |
#20 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23,481
Karma: 105248689
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
My opinion as someone who has read and formatted quite a few ebooks over the years is that most professional ebooks are not well formatted. One friend of mine was of the opinion that most of the "professionals" were hired not for their knowledge but for how cheaply they could be hired That situation has improved over the last decade but, in my not so humble opinion, many ebooks produced by the Big Five and most other publishers are not great teaching tools for anyone wanting to learn CSS. Considering the number that I've seen that still use the CSS reset code and that include everything that should be inherited from the parent in the child which does nothing but increase the size of the CSS file—perhaps they are unaware of what cascading style sheet means? Not to mention the number of publishers that seem to use calibre for conversion which had made me wonder if any of them are paying Kovid Goyal for commercial use of his work. |
|
![]() |
![]() |
![]() |
#21 | ||||
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31
Karma: 1158
Join Date: Jun 2021
Device: Kindle Paperwhite (PW1 & PW3)
|
Quote:
Let me try to explain it with an example. Say I formatted the eBook with the SVG Wrapper. Now say, at a later date I decide I want to make a version with smaller images because it's for a device that has a smaller screen. So I unzip the ePub & shrink all the images, or worse, I rotate an image. Then I rezip the ePub & load it onto the device. The SVG Wrapper now looks for the image insert1.jpg, it finds it. Now it goes to display the 1034x1450 image but finds an 800x1122 image instead. What happens? Now say it goes to display the 2067x1450 image, but that image is now 1450x2067... Is it not going to show the image at all? Will the image be shown half-sized because it's trying to make the end edge sit at pixel 1034 when there are only 800 pixels in the image? Will the flipped image be squished to fit the inverted dimensions? That's what I was saying nobody has addressed. I batch convert images from 20 books all at once, it takes about 5 minutes to set up & I walk away, when I come back I just rezip the books & they're done. If every image was SVG I'd instead HAVE to edit each book individually, edit each image within the Sigil editor or do a batch convert & then fix the Wrapper on each image manually. You keep talking about this as though the method used, in just about every eBook I've bought, has nothing but problems & this method has no problems & solves everything. But this thread is not even about what the best way is, it's about how to AUTOMATE it. Which is the biggest problem with the SVG Wrapper, it can't really be automated in any way. Quote:
Hint: I didn't... Ever... Nothing even close to that... I'm not blindly following anything. The technique used works. I listed the devices I use those books on & they all work WITHOUT the issues you are saying they have. To me you are telling me that the lets say "Jake On The Cube" hamburger I am currently eating, that I have eaten hundreds of times before & thousands of other people also eat regularly without issues, tastes like soap & will be guaranteed to make me sick if I eat it... But I'm currently eating it & am not sick & it doesn't taste like soap... Sure there have been people who have gotten sick after eating them & maybe somewhere there have been ones that have tasted like soap, but those are not because they are from Jake On The Cube, it's because the particular store that made them did something wrong or perhaps the user who got sick ate the burger without washing their hands or set it down on a dirty counter. The fact is that Jake On The Cube is an international franchise that sells Burgers to millions of people every day. If they had the problems that you are insisting every burger they make has, people would not be buying them, & as someone who eats them I have never gotten sick from eating them & never had one taste like soap. You are expecting me to believe your words & the words of a few other people I don't really know over my own experiences. Are Jake's Burgers the best burgers that could ever be made? No, of course not, but they are reasonably good, they are quick, & cheap, & that's all I'm looking for. If you had a suggestion for another fast food place that had a similar price & was a similar distance away, & was better I'd most likely go there instead. But instead you're suggesting that instead I make that hamburger myself, grill it on a good quality grill, using the choice cuts of meat. Or that I go to a special restaurant that is half an hour drive away. Both those things are potentially good ideas, but they don't replace the fast food I can grab on my way to work & again on a lunch break if I feel like it, & if I'm driving across country & am hungry I can find wherever I go. What I'm looking for, specifically, is something that can be done in an automation. Unless you are sharing a way to automate an SVG image replacement it will never be something I can even consider. Plain & simple. Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#22 |
Enthusiast
![]() Posts: 25
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
SVG has another drawback for me that I, in my ignorance, have not been able to solve. Imagine you have an image that is wider than high, and you want to display it alone on a page. The best method might be the SVG wrapper, because I think it's the only way to automatically centre the image vertically, as well as ensuring that the aspect ratio is respected.
But if the image has a caption, I have not been able to display it below and close to the picture. This is what I do: Code:
<figure> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 506 259" preserveAspectRatio="xMidYMid meet"> <image width="506" height="259" xlink:href="../Images/17.jpeg"/></svg> <figcaption><b>Fig. 17:</b> Paragraph with several lines of text.</figcaption> </figure> |
![]() |
![]() |
![]() |
#23 | ||||||
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,686
Karma: 16000001
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
|
Quote:
![]() You can't control whether the user rotates their device as they are reading, can you? You can't control what device/app the user reads on. The SVG wrapper technique makes all of that automatic...as you say you want. You set the image page once...and then regardless of the device dimensions, resolution, orientation, rotation....the SVG wrapper automatically puts the image in the proper configuration...no fuss, no muss....automatically....which cuts down on all this work you are making for yourself by resizing and re orienting your images over and over. Also, if you ever rename an image (font file or stylesheet), Sigil automatically updates the name throughout the book. Quote:
Quote:
Tex put a link to a thread discussing all these problems, with pictures illustrating the problems you say don't exist. Quote:
![]() Quote:
You see... I could really care less about what you do with the advice....take it or don't. ![]() Most of us here, however, are trying to improve the ebook experience for everyone. If someone comes on here and makes incorrect statements, then we try and help them to understand the error. If they are unwilling to listen then we are making the corrections for posterity and any others who come to read the answers. Quote:
IIRC you are familiar with Sigil's automation feature, at least I thought you mentioned using it earlier...that might be something you could use... if you were willing to listen to advice from people you don't know. However, since your goal is simply to use an automation without understanding what it is you are accomplishing, or desire to listen to the advice we give because you don't know us, then I'm afraid you won't get much help. Sorry. Last edited by Turtle91; 11-28-2022 at 09:20 AM. |
||||||
![]() |
![]() |
![]() |
#24 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,686
Karma: 16000001
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
|
Quote:
|
|
![]() |
![]() |
![]() |
#25 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,197
Karma: 11695105
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
I warn about using too much of HTML5-specific markup + go over all the details. Also see: where all this image+caption stuff was described in extreme detail. (With links to TONS of other threads on the topic.) Quote:
As always, I point back to my: especially the absolutely fantastic talk given by an editor from Houghton-Mifflin: Guess who gets hired to clean up the trash in the backlog? Guess who teaches lessons on how not to let crap get into your ebooks in the first place? Guess who's seen with and dealt with a lot of the junk code + had to correct it? But that's okay, don't listen to any lessons from the true experts who clean up the mess in those "professional" ebooks! ![]() Quote:
You have common crap across all 20 of your ebooks? Great, come up with some helpful list of search/replaces to help you spot+remove the junk. For an easy explanation, see the little posts I wrote a few months ago: There will never be a fully automatable, one-button press solution, because every ebook is going to have completely different innards. The best you can do is automate some of these cleanup steps, but it'll still require a close look + elbow grease. Last edited by Tex2002ans; 11-28-2022 at 02:02 PM. |
|||
![]() |
![]() |
![]() |
Tags |
automation, find and replace, sigil file splitting, split-header, split-image |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search and replace sometimes doesn't work across all files | GregTheGrate | Editor | 15 | 11-10-2021 02:49 AM |
Calibre2OPDS split tags just doesn't work | DavidTC | Related Tools | 16 | 11-04-2014 10:58 AM |
Regex Help: Find page number & Replace+Remove 2x Line Breaks in Sigil | Contre-jour | Sigil | 9 | 02-01-2013 11:47 AM |
Search & Replace doesn't work for quotes | habanr | Conversion | 11 | 04-22-2011 12:50 PM |
Find, replace, split chapter? | laelaps | Sigil | 8 | 01-20-2011 05:01 PM |