Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-07-2024, 11:04 AM   #16
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: 28,335
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by foosion View Post
BTW, if I wanted to eliminate all <section epub:type="bodymatter chapter"> or the like, how would I set the plugin? I could use regex to add a, for example, id tag, then match the id with the plugin, but that would seem to defeat the purpose.
There'd be no need to add an id tag to then match with the plugin. What would be the point of that? You could just match the attribute string of the section tag with the plugin (one attribute and literal value pair, or some regex subset of the attribute value).

You may need to first add "epub:type" as one of the attributes to search on in the plugin's config. But that's a permanent change, not a one-time thing.

Click image for larger version

Name:	modify.jpg
Views:	114
Size:	76.9 KB
ID:	211261 Click image for larger version

Name:	delete.jpg
Views:	124
Size:	72.4 KB
ID:	211260

Last edited by DiapDealer; 10-07-2024 at 11:20 AM.
DiapDealer is offline   Reply With Quote
Old 10-07-2024, 11:27 AM   #17
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 474
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Aha. I hadn't looked at the customization carefully enough to realize you can add a type. I'm using the Calibre editor plugin BTW.

Last edited by foosion; 10-07-2024 at 11:32 AM.
foosion is offline   Reply With Quote
Advert
Old 10-07-2024, 11:32 AM   #18
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: 28,335
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by foosion View Post
Aha. I didn't realize you could add attributes in the config. The reason for adding id was that it was already on the list.
Gotcha. Yes, you can add custom attributes... as well as adding more tag choices to change things to. You can even add some new tags to search for, but you'll have to edit the preferences manually to do that. My original goal was only including nestable stuff, because unnestable stuff was fairly easy to change with regex alone, but people kept wanting more tags added.
DiapDealer is offline   Reply With Quote
Old 10-07-2024, 11:35 AM   #19
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: 28,335
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I don't use the calibre version much, so I forget the particulars, but the functionality should be the same between that and Sigil. If you need to add a tag, that's a little more of a manual process. Perhaps one of the calibre users can walk you through it. I'd have to install calibre to remember the details.
DiapDealer is offline   Reply With Quote
Old 10-07-2024, 11:48 AM   #20
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 474
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by DiapDealer View Post
I don't use the calibre version much, so I forget the particulars, but the functionality should be the same between that and Sigil. If you need to add a tag, that's a little more of a manual process. Perhaps one of the calibre users can walk you through it. I'd have to install calibre to remember the details.
I figured it out. Click customize, then at the bottom add to the list of html attributes to search for.
foosion is offline   Reply With Quote
Advert
Old 10-07-2024, 12:46 PM   #21
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,581
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by DiapDealer View Post
I don't use the calibre version much, so I forget the particulars, but the functionality should be the same between that and Sigil. If you need to add a tag, that's a little more of a manual process. Perhaps one of the calibre users can walk you through it. I'd have to install calibre to remember the details.
As far as I know, to add a tag requires to edit a plugin as they are declared as a list in the code. I don't remember if you have to touch in a couple of places. Perhaps there is an easier way, but I've used this.

Last edited by Terisa de morgan; 10-07-2024 at 12:48 PM.
Terisa de morgan is offline   Reply With Quote
Old 10-07-2024, 12:49 PM   #22
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,581
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by JSWolf View Post
What tags have you added in? I know I could use some more tags.
h4 and h5.
Terisa de morgan is offline   Reply With Quote
Old 10-07-2024, 12:57 PM   #23
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 474
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by DiapDealer View Post
I don't use the calibre version much, so I forget the particulars, but the functionality should be the same between that and Sigil. If you need to add a tag, that's a little more of a manual process. Perhaps one of the calibre users can walk you through it. I'd have to install calibre to remember the details.
Quote:
Originally Posted by foosion View Post
I figured it out. Click customize, then at the bottom add to the list of html attributes to search for.
Oops - that's to add an attribute, but not to add a tag. To make it easy to add a tag the plugin would have to be modified to have a line similar to the add attribute feature. Otherwise, as Terisa writes, edit the plugin itself.
foosion is offline   Reply With Quote
Old 10-07-2024, 02:12 PM   #24
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: 28,335
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Terisa de morgan View Post
As far as I know, to add a tag requires to edit a plugin as they are declared as a list in the code. I don't remember if you have to touch in a couple of places. Perhaps there is an easier way, but I've used this.
Hmmm... I know I made it so you could merely edit the plugin preferences in Sigil (rather than have to edit the plugin code itself). I usually try to keep the calibre and Sigil plugins in feature sync, but perhaps I missed one. I'll check it out. Having to edit the code means needing to reapply custom changes after updating the plugin. That seems a bit of a pain.
DiapDealer is offline   Reply With Quote
Old 10-07-2024, 03:28 PM   #25
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,581
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I think I haven't had to change anything in the settings but I'm not sure. In any case, that change would be appreciated (and I've checked and I've not found the way to do it in the settings).
Terisa de morgan is offline   Reply With Quote
Old 10-07-2024, 03:29 PM   #26
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: 78,914
Karma: 143098300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Terisa de morgan View Post
h4 and h5.
I would like to have an h2 tag. I would like to change <h2 class="someclasidon'twant">Chapter Title</h2> to <h2>Chapter Title</h2>.
JSWolf is offline   Reply With Quote
Old 10-07-2024, 03:43 PM   #27
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,581
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by JSWolf View Post
I would like to have an h2 tag. I would like to change <h2 class="someclasidon'twant">Chapter Title</h2> to <h2>Chapter Title</h2>.
Ah, then I added h2 and h3 too. I though they were in the original set.
Terisa de morgan is offline   Reply With Quote
Old 10-07-2024, 03:48 PM   #28
foosion
Evangelist
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 474
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by JSWolf View Post
I would like to have an h2 tag. I would like to change <h2 class="someclasidon'twant">Chapter Title</h2> to <h2>Chapter Title</h2>.
Why not just regex for that?

Find <h2 class="someclasidon'twant">(.*?)</h2>

Replace <h2>\1</h2>
foosion is offline   Reply With Quote
Old 10-07-2024, 03:50 PM   #29
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: 78,914
Karma: 143098300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by foosion View Post
Why not just regex for that?

Find <h2 class="someclasidon'twant">(.*?)</h2>

Replace <h2>\1</h2>
Because I prefer to use the plugin.
JSWolf is offline   Reply With Quote
Old 10-07-2024, 03:53 PM   #30
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: 3,291
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
That’s what I do most of the time (regex)… BUT … you need to be very careful of nested tags especially if you are searching for <span>s because that regex will pickup the first end tag not necessarily the correct one.

As Diap mentioned, his plugin actually parses the html to avoid that issue.
Turtle91 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
It's Complicated drjenkins Deals and Resources (No Self-Promotion or Affiliate Links) 13 03-06-2014 12:23 AM
I'm sure this would be complicated, but is this possible? Dullahir Calibre 5 06-03-2013 05:04 AM
Now Things Get Complicated Kris777 News 21 04-17-2010 03:25 AM
UK User - is it really this complicated?! twisticles Sony Reader 30 09-22-2008 10:46 PM


All times are GMT -4. The time now is 04:32 AM.


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