Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-05-2024, 04:57 PM   #1
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Feature request: Semantic italics/spans

As accessibility standards become more pressing, I find myself having to change <i> to <em> or <cite> a lot more often, or to apply one of those where there currently isn't anything. We're also having to create spans with language tags when there's a second language in the ebook.

It's all on a word-by-word basis, per editorial judgment, so there's no way to do it with global operations. Is there a way the formatting bar at upper left (B I U ...) could be made to help with any of this?

Thank you!

Last edited by noteon; 03-05-2024 at 05:09 PM.
noteon is offline   Reply With Quote
Old 03-05-2024, 05:21 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
You could use the clip bar for this. I explained how to do this in this old post.
Doitsu is offline   Reply With Quote
Old 03-05-2024, 05:54 PM   #3
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: 76,470
Karma: 136564766
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 noteon View Post
As accessibility standards become more pressing, I find myself having to change <i> to <em> or <cite> a lot more often, or to apply one of those where there currently isn't anything. We're also having to create spans with language tags when there's a second language in the ebook.

It's all on a word-by-word basis, per editorial judgment, so there's no way to do it with global operations. Is there a way the formatting bar at upper left (B I U ...) could be made to help with any of this?

Thank you!
If you are changing <i>, just add in <i> and you can search/replace the <i> to <em> or <span>.

As for <cite>, you could use <u> for that and then the the search/replace.
JSWolf is offline   Reply With Quote
Old 03-05-2024, 06:01 PM   #4
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Quote:
Originally Posted by Doitsu View Post
You could use the clip bar for this. I explained how to do this in this old post.
Hey, look at that! Thank you.
noteon is offline   Reply With Quote
Old 03-05-2024, 06:07 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Jon, I think the problem is that the ePub he is editing used only <i> or <em> and they now need to use <i> for visual, <em> for emphasis and <cite> for citations, all of which render as italic by default.

I've done that dance a couple of times and it required a good chunk of manual effort since there other than some of the citations where I could do some automation, it required the mark one eyeball to distinguish which was needed. The actual typing of <em> or <cite> was not the issue as that was done using the clip bar.

Last edited by DNSB; 03-05-2024 at 06:10 PM.
DNSB is offline   Reply With Quote
Old 03-05-2024, 06:09 PM   #6
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
If I want to start with

<i.*?>(.+?)</i>

and end up with

<em>\1</em>

is there a way to do it with the clip bar? Or do I need to end up with

<i><em>\1</em></i>

And then globally search/replace to get the <i> tags out of there?
noteon is offline   Reply With Quote
Old 03-05-2024, 06:13 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Your second example is what I used. It was quick and dirty which is what I was looking for. so the replacement string would be <i><em>\1</em></i> or <i><cite>\1</cite><i> and then global search/replace.
DNSB is offline   Reply With Quote
Old 03-05-2024, 06:27 PM   #8
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,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Use my TagEditor plugin for bulk changing from one tag to another. Especially if the possibility of nested tags is real. That's specifically why I made it. You can drill down on matches from all naked tags (no attributes), to specific values for specific attributes, to matching the whole attribute string using regex. You can also choose to maintain the existing attribute string or modify it (or eliminate it).

Last edited by DiapDealer; 03-05-2024 at 06:32 PM.
DiapDealer is offline   Reply With Quote
Old 03-05-2024, 10:17 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I was not aware of the existence of a TagEditor plugin. If this was a reference to TagMechanic, given the OP needs to choose which <i> tags stay as <i> or change to <em> or <cite>, I was not aware that TagMechanic could do more than a wholesale change.
DNSB is offline   Reply With Quote
Old 03-05-2024, 10:59 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
I typically use regular expression search to capture all i tags and then use the new replacement table find and replace tool the with a large context set. I can use a quick delete of table rows where I do not want the replacements to be made.

But using the clips bar and stepping through the searches one by one works to replace only where needed works too.
KevinH is offline   Reply With Quote
Old 03-06-2024, 07:28 AM   #11
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,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by DNSB View Post
I was not aware of the existence of a TagEditor plugin. If this was a reference to TagMechanic, given the OP needs to choose which <i> tags stay as <i> or change to <em> or <cite>, I was not aware that TagMechanic could do more than a wholesale change.
If there's no named attributes that can determine which i tags should stay as i tags, then yes, TagMechanic probably won't help much. But it's certainly possible to do less than a wholesale change with TagMechanic when the attribute strings--like the class name--offer delineating criteria.The plugin can operate on only naked tags (no attributes), or only on tags with particular attribute values, or only on tags whose attribute strings match a particular regexp. It's not a blunt, whammy-all-or-nothing instrument (though it certainly can be used that way too).

Last edited by DiapDealer; 03-06-2024 at 07:41 AM.
DiapDealer is offline   Reply With Quote
Old 03-06-2024, 07:49 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
What I meant was that when all the tags I'm interested are currently naked <i> tags or <i> tags with identical classes, TagMechanic does not allow to me step though one at time so I can decide if <i>, <em> or <cite> is the correct replacement. I ended searching for <i> and selecting the replacement which allowed the mark one eyeball to be used to make the choice. I considered this the price to pay for adding semantics after the fact.
DNSB is offline   Reply With Quote
Old 03-06-2024, 11:30 PM   #13
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,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
That is correct. TagMechanic won't let you step through and approve each replacement. But like Kevin, I find the new table-based replacement tool much more pleasant to use when deciding which--of many--possible replacements to skip.
DiapDealer is offline   Reply With Quote
Old 03-07-2024, 10:13 AM   #14
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,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by DiapDealer View Post
That is correct. TagMechanic won't let you step through and approve each replacement. But like Kevin, I find the new table-based replacement tool much more pleasant to use when deciding which--of many--possible replacements to skip.
Just in case any are unclear on this: that's holding the shift key down while clicking the Replace All button. That brings up a table of results that you can then choose (individually or in multiples ) to skip. Used in conjunction with the "Dry Run" feature (shift+count all button), it makes things a lot less menial and repetitive (for me anyway). As Kevin already mentioned, you can increase the context included before and after each instance to help decide what stays and what goes.

Last edited by DiapDealer; 03-07-2024 at 10:28 AM.
DiapDealer is offline   Reply With Quote
Old 03-08-2024, 03:26 AM   #15
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,579
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
And it has been a very handy feature for me on multiple occasions though I often use it on current or selected files just to keep the number of search results manageable.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request? RobSys52 Library Management 4 03-12-2019 05:34 AM
yet another feature request arslonga Marvin 0 11-15-2014 02:41 AM
Feature request Funslinger Calibre 0 06-05-2012 12:25 PM
Feature Request LesWilk Calibre 2 01-03-2012 08:26 AM
Feature Request PermaTourist Calibre 9 03-26-2011 11:35 PM


All times are GMT -4. The time now is 10:42 AM.


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