Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-11-2022, 05:41 AM   #16
lonly
Member
lonly began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2012
Location: Bellow the Sky
Device: Laptop
Quote:
Originally Posted by theducks View Post
You really need to learn basic REGEX. It will be worth the effort

I have a snippet for my replace. \1 is the REGEX Captured
Code:
<h3 class="chapno">\1</h3>
The search is done on the fly, based upon what is there and what I want:
Note I only work in code view, so I highlight the entire Chapter-title block.,Ctrl-F (that puts it into the find)
eg Original
Code:
<p class="calibre_12"><span class="calibre3"><span class="bold"><span><span class="calibre27">Chapter 4</span></span></span></span></p>
Adjusted Search:
Code:
<p class="calibre_12"><span class="calibre3"><span class="bold"><span><span class="calibre27">(Chapter \d+)</span></span></span></span></p>
In this case, I am looking ONLY for a block that contains Chapter followed by a space and 1 0r more DIGITS. This will not affect any other similarly styled block (Prologue|Epilogue|Forward...)

Check out our Wiki entry
https://wiki.mobileread.com/wiki/Cal...n_introduction
Dear i cannot understand i am not converting book in calibre i have epub book which i need to reconstruct in calibre editing tool

so my book have this one exact line of chapters
e g
<p>Chapter One: introduction</p>
<p>Chapter Two: what is learning</p>
<p>Chapter Three: how to start </p>

i want to use this tag in all these lines <h3> </h3>

so can you please write here exact code which will find out all chapter block lines and put that tag on it
lonly is offline   Reply With Quote
Old 01-11-2022, 08:16 AM   #17
lomkiri
Enthusiast
lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.lomkiri is fluent in JavaScript as well as Klingon.
 
Posts: 40
Karma: 4656
Join Date: Jul 2021
Device: N/A
You can put the cursor on the line you want to transform and hit Ctrl-3

Or you can make a search:
<p>(Chapter\s[^<]+)</p>
replace:
<h3>\1</h3>

If you choose "replace all", check the result at the end.
All paragraphes begining with <p>Chapter will be targeted. If that's a problem, it is possible to refine and target the latter but with a colon inside the text:
<p>(Chapter\s[^:]+:[^<]+)</p>


As advised, you probably want to learn the basis of the regexes, then you'll be able to create your own searches, it's very usefull. This one, for example, is a very basic one with no special difficulties.

Last edited by lomkiri; 01-11-2022 at 08:24 AM.
lomkiri is offline   Reply With Quote
Old 01-11-2022, 09:05 AM   #18
lonly
Member
lonly began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2012
Location: Bellow the Sky
Device: Laptop
Quote:
Originally Posted by lomkiri View Post
You can put the cursor on the line you want to transform and hit Ctrl-3

Or you can make a search:
<p>(Chapter\s[^<]+)</p>
replace:
<h3>\1</h3>

If you choose "replace all", check the result at the end.
All paragraphes begining with <p>Chapter will be targeted. If that's a problem, it is possible to refine and target the latter but with a colon inside the text:
<p>(Chapter\s[^:]+:[^<]+)</p>


As advised, you probably want to learn the basis of the regexes, then you'll be able to create your own searches, it's very usefull. This one, for example, is a very basic one with no special difficulties.
Thank you for this
is that possible to add some css code related to this and all these lines will be in h1 tag
if its possible then what code i have to add in css file ?
lonly is offline   Reply With Quote
Old 01-11-2022, 12:39 PM   #19
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 26,976
Karma: 41959192
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by lonly View Post
Dear i cannot understand i am not converting book in calibre i have epub book which i need to reconstruct in calibre editing tool

so my book have this one exact line of chapters
e g
<p>Chapter One: introduction</p>
<p>Chapter Two: what is learning</p>
<p>Chapter Three: how to start </p>

i want to use this tag in all these lines <h3> </h3>

so can you please write here exact code which will find out all chapter block lines and put that tag on it
And that is HOW I answered: Using the editor.
you don't NEED a CSS entry IF you are willing to accept the (devices) default for H3 (or any other block type tag) The Middle S is STYLE (as in YOUR preference)
And FWIW my original answer was 95% there. You just needed to wrap the search pattern in <p> tags
theducks is offline   Reply With Quote
Old 01-12-2022, 04:15 PM   #20
Turtle91
A Hairy Wizard
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: 2,374
Karma: 14341913
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
Hi Lonly,

I don't mean to be rude, but I feel I need to be a little blunt, not just for you, but for others on MR who have the same types of questions as you.

There are MANY people here who are more than happy to help you when you get stuck on a particular aspect of making eBooks. But the idea is to help YOU to learn to do it. It is not to do it FOR you. If you want someone to do it for you because you are unwilling or unable to do it, then there are also professional eBook makers you can take your project to.

When you ask for specific steps to fix one minor issue - multiple times - it seems that you are just asking for us to do the work for you.

There have been several recommendations on how/where you can educate yourself on the whole process:

* Learn html/css
* Learn regex
* Read the Calibre users guide / or the Sigil users guide

There are some decent tutorials on MR's Wiki page, although they may be slightly old.

It really doesn't take more than a few hours to get a basic grasp of the items listed above...once you understand the basics it's much easier to understand how to apply the answers that you've already been given.

Cheers!
Turtle91 is offline   Reply With Quote
Old 01-14-2022, 04:32 AM   #21
lonly
Member
lonly began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Nov 2012
Location: Bellow the Sky
Device: Laptop
Quote:
Originally Posted by Turtle91 View Post
Hi Lonly,

I don't mean to be rude, but I feel I need to be a little blunt, not just for you, but for others on MR who have the same types of questions as you.

There are MANY people here who are more than happy to help you when you get stuck on a particular aspect of making eBooks. But the idea is to help YOU to learn to do it. It is not to do it FOR you. If you want someone to do it for you because you are unwilling or unable to do it, then there are also professional eBook makers you can take your project to.

When you ask for specific steps to fix one minor issue - multiple times - it seems that you are just asking for us to do the work for you.

There have been several recommendations on how/where you can educate yourself on the whole process:

* Learn html/css
* Learn regex
* Read the Calibre users guide / or the Sigil users guide

There are some decent tutorials on MR's Wiki page, although they may be slightly old.

It really doesn't take more than a few hours to get a basic grasp of the items listed above...once you understand the basics it's much easier to understand how to apply the answers that you've already been given.

Cheers!

thanks for your advise Dear
a lot of things i learn myself but if i stuck anywhere i spend many hours to learn myself and trying to fix but if i cannot get success then i ask help here and if someone help me here that doesn't mean i am not learning from his/her help. my first priority is always to learn myself
lonly is offline   Reply With Quote
Old 01-14-2022, 01:19 PM   #22
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: 9,539
Karma: 130607609
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by lonly View Post
thanks for your advise Dear
a lot of things i learn myself but if i stuck anywhere i spend many hours to learn myself and trying to fix but if i cannot get success then i ask help here and if someone help me here that doesn't mean i am not learning from his/her help. my first priority is always to learn myself
Oh, please. Everything--everything--you've asked about here, other than the regex, is eBookmaking 101. If you'd done any learning on your own, you'd have known all the answers to the questions that you submitted to start this thread.

We've all been there; we all taught ourselves. Don't bullshit the bullshitters.

Hitch
Hitch is offline   Reply With Quote
Old Yesterday, 02:50 PM   #23
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 26,976
Karma: 41959192
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by lonly View Post
thanks for your advise Dear
a lot of things i learn myself but if i stuck anywhere i spend many hours to learn myself and trying to fix but if i cannot get success then i ask help here and if someone help me here that doesn't mean i am not learning from his/her help. my first priority is always to learn myself
When I started here in 2010, I had only done simple HTML3 back in the 90's .
No REGEX (OMG it was so confusing)
No CSS (HTML3 did not have that. You took what you got).

With the help of pointers, tutorials, I started .
As to CSS, I created a 'Sampler' of things (effects) to do (mostly to make headings less plain) to learn what does what (and what you can't do ).

Then, listening to the folk who do this for a living, what should NOT be done, because it LIMITS your market only to devices that support that mode.

to the various MR members who pointed me in the right direction, and even provided snippets of code for some more exotic tasks I was trying to accomplish.
theducks is offline   Reply With Quote
Old Yesterday, 02:59 PM   #24
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 64,484
Karma: 104254653
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
I learned a lot by diving into ePub code and using the Internet to look things up, asking some questions here, and taking note of some things I've read here. Most of what I've learned, I did so on my own.
JSWolf 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
Editing epub in Calibre milest Editor 6 09-17-2021 02:49 PM
Editing an epub file steveredshaw Workshop 3 12-29-2019 12:56 PM
Editing ePub rajadevotta Editor 3 06-18-2015 12:56 PM
Editing epub's style.css when converting to epub Pros Calibre 0 02-02-2012 02:13 PM
ePub editing tool cyberbaffled ePub 22 10-16-2009 01:16 PM


All times are GMT -4. The time now is 02:18 AM.


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