View Single Post
Old 03-05-2021, 10:15 PM   #163
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Coleccionista View Post
On the topic of Saved Searches I'd love to see in Sigil or in a Sigil plugin something that would not rely on a static list of entries. I sometimes find myself working with an ebook that let's say has 100s of <i class="xx">...</i> but I cannot expect to know beforehand the contents.
I've been thinking of similar for a while.

There's portions of these things that exist, but nothing that combines them all into one super power user tool! :P

1. Replacing <i class="xyz"> -> <em>

It doesn't let you see the inner HTML, and you still have to do one-by-one cleanup (but it has regex capabilities for class names).

But the Sigil/Calibre plugins exist:
  • DiapDealer's "TagMechanic" (Sigil)
  • "Diap's Editing Tools" (Calibre)

I wrote a tutorial here:

(These 2 plugins are incredibly high up in my workflow.)

It would be nice to be able to apply this in a nice list, then batch convert... but for that, see #2 below.

2. Style Mapping

This is a nice menu where you could see all current Styles, then you could assign them an equivalent HTML + class in the output.

InDesign and some of the Word->InDesign import tools have this.

For example, being able to say:
  • Change my "Heading-2" InDesign style -> <h2 class="ABC"> in the EPUB.
  • Change my "Heading-2" Word style -> "XYZ" InDesign style.

This is a video showing off InDesign's Style Mapping. And here are two Adobe pages explaining it in more detail:

Also see lots of my links/posts in these two threads:

This would be an absolutely fantastic functionality to have in Calibre while converting... although I currently don't feel it fits within the scope of Sigil. (But I could be wrong!)

Partial Functionality: If the full-blown Style Mapper is too much, I'm imagining something similar to Tools > Delete Unused Stylesheet...

Maybe a "Consolidate Stylesheet", where you could map nearly redundant classes into each other (like those Word/InDesign CSS where dozens of classes are almost exact duplicates, with only a minuscule difference).

You could check a box (or map) "calibre1", "calibre2", "calibre10", then have it consolidate all those into a single "Clean1". :P

And similar to InDesign, it would be nice to have a little window below that showed you:
  • the current class's CSS
  • vs. the expected class's CSS

when you click on each Style.

3. "Spellcheck List" for Search

I also wrote about something similar last year:

Past few years, I've "secretly" been using this concept of "Italic Lists" to catch typos/errors.

Quote:
Originally Posted by Tex2002ans View Post
For example, ripping every single <i> out and sorting into an alphabetical list:

Code:
<i>Enciclopedia Italiana</i>
<i>New York Times</i>
<i>Volksgemeinschaft</i>
<i>Wall Street Journal</i>
<i>Washington Post</i>
<i>individual</i>
<i>laissez-faire</i>
<i>negative</i>
From a glance, you can usually tell which ones are meant to be <i> (newspapers, book titles, foreign words/terms) and which ones are <em> (individual words).

[...]
Splitting ALL italics, then sorted alphabetically + uniques... opens up a whole new class of previously missed errors.

Code:
<i>Wall Street Journal</i>
<i>Wa11 Street Journal</i>
right next to each other stands out like a sore thumb.

Having everything displayed beautifully in a "Sigil/Calibre Spellcheck List"-form would be super icing on top.

If there's some sort of editor out there that lets you mass search text/HTML + display similar to Sigil's Spellcheck List... I'd be EXTREMELY interested.

Note: Notepad++'s "Find All" displays in a chronological list form, although it displays the entire line. When working with long paragraphs, many times the hit is going to display off screen:

Click image for larger version

Name:	Notepad++.-.Find.All.png
Views:	452
Size:	37.4 KB
ID:	185761

And there is an (unreleased) Sigil Plugin that let you search using Regex. The hits appear chronologically in the Validation Results, then you could double-click to jump to its exact location:

Click image for larger version

Name:	Sigil.Plugin.Regex.Search.png
Views:	234
Size:	29.6 KB
ID:	185758

Helpful, but nowhere near as nice as Spellcheck Lists!

4. Marking Lang

I wrote a few non-standard ways you could hackishly use the Spellcheck Lists to accomplish this:

Sure, nothing as easy/fancy... but it "works".

But yeah... more extremely powerful "Spellcheck List"-like interfaces... ten thumbs up from me.

- - -

I think the Style Mapper is the core to most of this.

Once that functionality gets introduced, I think the potential for the power tools like the "Lang Mapper" or "HTML+Class Mapper" or "Mass Replace Mapper" would follow.

Last edited by Tex2002ans; 03-06-2021 at 01:17 PM.
Tex2002ans is offline   Reply With Quote