Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-03-2023, 05:59 PM   #136
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: 35,733
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Turtle91 View Post
Code:
<h3>Chapter 1 <span>This is the title of the chapter</span></h3>
The CSS would look something like this:
Code:
h3 {font-weight:bold; text-align:center; font-size:1.2em}
h3 span {display:block; font-weight:normal; font-size:.8em; font-style:italic; font-family:serif}
This very specifically defines which <span> is being styled (any <span> within an <h3>). It also minimizes code bloat (no need to say <span class="chaptertitle"> on every chapter).

It is certainly not required to do it this way...you can add extensively defined spans to every letter if you want...but having an empty naked <span> does not automatically mean it is wrong.
What I was seeing in the ebook where removing the naked spans caused very noticeable changes was the author/publisher using a span following a p to define the dropcap class, 3 flavours of h1, h2 and h3 with a span defined in the stylesheet, etc., all without using names.

My personal preference is to give these classes names just to make it easier for me to follow later. <p><span>A</span> is a bit harder to follow than <p><span class="dropcap1">A</span> when you come back to it a few months later.
DNSB is offline   Reply With Quote
Old 05-03-2023, 07:01 PM   #137
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Quote:
Originally posted by DNSB
"My personal preference is to give these classes names just to make it easier for me to follow later. <p><span>A</span> is a bit harder to follow than <p><span class="dropcap1">A</span> when you come back to it a few months later. "
I really don't understand why you don't properly format those spans correctly as you go instead of using those empty spans as markers that you can go back to later. Sorry but I don't regard that as a good enough reason to prevent automatic empty span removal in the plugin.

Last edited by slowsmile; 05-03-2023 at 07:09 PM.
slowsmile is offline   Reply With Quote
Old 05-03-2023, 07:01 PM   #138
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: 7,675
Karma: 5433388
Join Date: Nov 2009
Device: many
CSS combinator selectors appears to be an "in" thing to do to prevent the need to create and use css classes in your html/xhtml even though class names can actually be chosen to mean something!

That said ... they are not naked spans and should not be removed.

Last edited by KevinH; 05-03-2023 at 07:04 PM.
KevinH is online now   Reply With Quote
Old 05-03-2023, 07:19 PM   #139
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
KevinH and @DiapDealer...In that case -- if removing empty spans really does effect the formatting as you say -- I will add another option for empty span removal in the plugin. This also means that I will have to create another separate user options dialog, since the current user options dialog window's height is now excessive.

Last edited by slowsmile; 05-03-2023 at 07:22 PM.
slowsmile is offline   Reply With Quote
Old 05-03-2023, 07:21 PM   #140
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: 27,568
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
That said ... they are not naked spans and should not be removed.
Certainly not silently and/or without the ability to opt out of any such potentially damaging deletion, in my opinion.
DiapDealer is offline   Reply With Quote
Old 05-03-2023, 07:38 PM   #141
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Quote:
Originally posted by DiapDealer
"Certainly not silently and/or without the ability to opt out of any such potentially damaging deletion, in my opinion."
I'm not quite sure why removing empty spans i.e. span tags containing nothing -- would cause any problems. If it does cause major problems, as you say, then perhaps it's best that I should just remove it altogether from the plugin(with no selectable option in the user dialog). Thoughts?
slowsmile is offline   Reply With Quote
Old 05-03-2023, 07:41 PM   #142
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: 27,568
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by slowsmile View Post
This also means that I will have to create another separate user options dialog, since the current user options dialog window's height is now excessive.
For what it's worth... the current dialog can't be expanded wide enough to see all of the text on my highdpi monitors. But there's plenty of room for the height to be increased.

I'd recommend multiple columns or even tabs, but then it is tkinter. So everything is easier said than done. I ultimately had to get away from using it (Tk/TKinter). Made my head hurt something fierce!
DiapDealer is offline   Reply With Quote
Old 05-03-2023, 07:53 PM   #143
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: 27,568
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by slowsmile View Post
I'm not quite sure why removing empty spans i.e. span tags containing nothing -- would cause any problems. If it does cause major problems, as you say, then perhaps it's best that I should just remove it altogether from the plugin(with no selectable option in the user dialog). Thoughts?
Sorry for the confusion. I have no opinion on removing spans that contain no text between the opening and closing span tags. I'm not certain why they'd be there in the first place, but removing them should change nothing. I've been referring to spans that contain text, but whose tags have no attributes. Removing those can change how things render (as others have already illustrated).

One option would be to stop removing naked (no attributes) span tags by default with the plugin. Then make it a manual preference to remove them. Those who know the risks (and know what they're doing) and want to remove them anyway, could always manually add something like a

Code:
"remove_naked_spans": true,
to the plugin's .json preferences file that the plugin could then honor.
DiapDealer is offline   Reply With Quote
Old 05-03-2023, 08:07 PM   #144
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Quote:
Originally posted by DiapDealer
"For what it's worth... the current dialog can't be expanded wide enough to see all of the text on my high dpi monitors. But there's plenty of room for the height to be increased."
Thanks for that. I am intending to split the plugin's user options dialog into two separate windows in the very near future because the plugin dialog must also be able to accommodate low rez monitors -- which is where problems might occur. And when I do the next upgrade I will also widen the dialog window to try and accommodate Linux machines as well.

Quote:
Originally posted by DiapDealer
"I'd recommend multiple columns or even tabs, but then it is tkinter. So everything is easier said than done. I ultimately had to get away from using it (Tk/TKinter). Made my head hurt something fierce! "
I think I'll take the easier route by just splitting the user options in half and using two tkinter window dialogs. I haven't really had a chance to get up to speed using Qt.

And thanks for the suggestion about using the json file for selection but unfortunately I already use the json settings to save the user dialog selection for next time you use the plugin. So I think my only option is to perhaps add it as another user option in the user options dialog window.

Last edited by slowsmile; 05-03-2023 at 08:20 PM.
slowsmile is offline   Reply With Quote
Old 05-03-2023, 08:26 PM   #145
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: 27,568
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by slowsmile View Post
I think I'll take the easier route by just splitting the user options in half and using two tkinter window dialogs. I haven't really had a chance to get up to speed using Qt.
That's fair. Qt has it's own learning curve. But since I'm already used to doing C++ Qt stuff with Sigil itself, Qt for Python just makes more sense to me. I never did fully warm up to tkinter. Nothing about it ever became intuitive for me. I had to look up online examples for everything I wanted to do with it.
DiapDealer is offline   Reply With Quote
Old 05-03-2023, 08:58 PM   #146
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Just to clarify and recap, I will make the following changes to this plugin in the near future:
  • Add a new selectable option to remove line-height from the CSS
  • Add a new selectable option to remove empty spans from the html.
  • Create a second user options dialog window.
  • Widen the dialog windows to properly accommodate Linux HD displays.
slowsmile is offline   Reply With Quote
Old 05-04-2023, 09:10 AM   #147
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: 74,246
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
How about checking the CSS and if there is no style for a naked span, then go ahead and remove them?
JSWolf is offline   Reply With Quote
Old 05-04-2023, 09:22 AM   #148
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: 27,568
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by JSWolf View Post
How about checking the CSS and if there is no style for a naked span, then go ahead and remove them?
That would be much, much, much easier said then done. Prohibitively difficult (not to mention nearly impossible to guarantee its accuracy).
DiapDealer is offline   Reply With Quote
Old 05-04-2023, 05:25 PM   #149
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: 35,733
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by slowsmile View Post
I really don't understand why you don't properly format those spans correctly as you go instead of using those empty spans as markers that you can go back to later. Sorry but I don't regard that as a good enough reason to prevent automatic empty span removal in the plugin.
It's not something I am creating. I'm editing someone else's creation. I personally do not like using combinator selectors but others seem to feel they are the greatest thing since sliced bread.

Last edited by DNSB; 05-04-2023 at 05:27 PM.
DNSB is offline   Reply With Quote
Old 05-04-2023, 06:46 PM   #150
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
Just to be absolutely clear, when I say "empty span tags" I mean span tags that have nothing inside them -- no classes, style or any other attributes. Example below:

Code:
<h1 class="heading"><span>CHAPTER 1</span></h1>
Whereas "a naked span tag" I think refers to a span tag containing perhaps some attributes as well as text on it's own line in the html that is not surrounded by any other html tags. That's my understanding of "naked spans" anyway. As well, "naked spans" surrounding text or whatever can also contain classes and other attributes.

Generally, as a rule, I always try and avoid using both "empty span tags" and "naked span tags" in my own epubs. In most instances, empty spans serve no earthly purpose and naked spans alone and on their own line(and not surrounded by <div> tags) will always give you an error whenever you run FlightCrew or Epubcheck.

Last edited by slowsmile; 05-04-2023 at 07:24 PM.
slowsmile is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 01:25 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM


All times are GMT -4. The time now is 07:56 PM.


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