Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-06-2023, 12:25 AM   #1
vr8ce
Enthusiast
vr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchfork
 
vr8ce's Avatar
 
Posts: 33
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
Turn off auto-formatting of CSS?

Is there a way to stop the calibre editor from messing with the CSS formatting? It's formatting choices are odd, not the ones I want, and too many things other than "Beautify" result in a autoreformat (e.g. "Organize into folders"?!?).

I have read and searched through the editor documentation, the editor Settings, and done some other web searches and not turned up anything.

If there is not a way, please consider an Editor setting to leave CSS formatting alone. If there is a way, a pointer would be greatly appreciated.

Thanks!
vr8ce is offline   Reply With Quote
Old 03-06-2023, 12:48 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Are you referring to the code in the stylesheet.css?

What exactly is being changed? I've never noticed the editor change anything my my stylesheets.
Karellen is offline   Reply With Quote
Advert
Old 03-06-2023, 03:28 AM   #3
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: 31,041
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Karellen View Post
Are you referring to the code in the stylesheet.css?

What exactly is being changed? I've never noticed the editor change anything my my stylesheets.
I was surprised about the word 'odd'. Except for the quirky coloring of the first 2 lines, it seemed to be pretty standard code styled.
theducks is offline   Reply With Quote
Old 03-06-2023, 04:12 AM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
Except for the quirky coloring of the first 2 lines, it seemed to be pretty standard code styled.
Umm, did I miss something?
Where do you see coloured lines and standard code styling?

Last edited by Karellen; 03-06-2023 at 04:15 AM.
Karellen is offline   Reply With Quote
Old 03-06-2023, 05:16 AM   #5
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: 79,713
Karma: 145864619
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 vr8ce View Post
Is there a way to stop the calibre editor from messing with the CSS formatting? It's formatting choices are odd, not the ones I want, and too many things other than "Beautify" result in a autoreformat (e.g. "Organize into folders"?!?).

I have read and searched through the editor documentation, the editor Settings, and done some other web searches and not turned up anything.

If there is not a way, please consider an Editor setting to leave CSS formatting alone. If there is a way, a pointer would be greatly appreciated.

Thanks!
I don't get where you are coming from and what you are doing. The editor never changes the CSS code. I'd edited many many eBooks and not a single time has the editor changed the CSS.
JSWolf is offline   Reply With Quote
Advert
Old 03-06-2023, 05:45 AM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,715
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Perhaps the OP is referring to calibre changing the manner in which the content of CSS files is presented, not changing the actual text within them. e.g: changing:

Code:
p {font-family: verdana; font-size: 20px;}
to:

Code:
p {
  font-family: verdana;
  font-size: 20px;
}
BR
BetterRed is offline   Reply With Quote
Old 03-06-2023, 05:59 AM   #7
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: 79,713
Karma: 145864619
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 BetterRed View Post
Perhaps the OP is referring to calibre changing the manner in which the content of CSS files is presented, not changing the actual text within them. e.g: changing:

Code:
p {font-family: verdana; font-size: 20px;}
to:

Code:
p {
  font-family: verdana;
  font-size: 20px;
}
BR
If that is the case, then I'm thinking that "Beautify individual file automatically when they are opened". is selected If that is the case, then Edit > Preferences > Editor settings is where that setting is found and can be turned off.

It's also possible that the OP has "Update metadata in the book when opening selected". That can be turned off via Edit > Preferences > Integration with calibre.

Last edited by JSWolf; 03-06-2023 at 06:02 AM.
JSWolf is offline   Reply With Quote
Old 03-06-2023, 10:41 AM   #8
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: 31,041
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Karellen View Post
Umm, did I miss something?
Where do you see coloured lines and standard code styling?
Colored Code (not lines)

Code styling = indented
Attached Thumbnails
Click image for larger version

Name:	CSSstyle.JPG
Views:	108
Size:	42.5 KB
ID:	200152  
theducks is offline   Reply With Quote
Old 03-06-2023, 10:44 PM   #9
vr8ce
Enthusiast
vr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchfork
 
vr8ce's Avatar
 
Posts: 33
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
I said nothing about changing the CSS itself, I said the CSS formatting, i.e. the way it looks. I also said it had nothing to do with Beautify, and gave an example of a thing that reformats the CSS. "Beautify individual files on open" is not selected, and neither is "Update metadata in the book…"
vr8ce is offline   Reply With Quote
Old 03-06-2023, 11:28 PM   #10
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by vr8ce View Post
I said nothing about changing the CSS itself, I said the CSS formatting, i.e. the way it looks.
Nor did I. But I did ask you to specify exactly what is changing.
Is it too hard to provide a before/after example?

Like I said, I have never seen anything change in my css files.
I guess that is because I create them exactly as Calibre expects.
Karellen is offline   Reply With Quote
Old 03-07-2023, 01:11 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, there's no way to do that. Organize into folder causes file paths to change, changing file paths means url resources in CSS sheets potentially have to be re-written, which means they have to be parsed and serialized. And no, I dont have any interest in writing my own CSS parser/serializer that preserves original formatting.
kovidgoyal is offline   Reply With Quote
Old 03-07-2023, 04:25 AM   #12
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: 79,713
Karma: 145864619
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 vr8ce View Post
I said nothing about changing the CSS itself, I said the CSS formatting, i.e. the way it looks. I also said it had nothing to do with Beautify, and gave an example of a thing that reformats the CSS. "Beautify individual files on open" is not selected, and neither is "Update metadata in the book…"
Organize into folders is something you are doing. So it's you that are causing the changes, not Calibre. You chose to do that.
JSWolf is offline   Reply With Quote
Old 03-07-2023, 09:44 PM   #13
vr8ce
Enthusiast
vr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchfork
 
vr8ce's Avatar
 
Posts: 33
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
Kovid, what third-party (I assume?) library/code/whatever are you using to parse/serialize the CSS?
vr8ce is offline   Reply With Quote
Old 03-07-2023, 09:58 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,337
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by vr8ce View Post
Kovid, what third-party (I assume?) library/code/whatever are you using to parse/serialize the CSS?
css_parser
kovidgoyal is offline   Reply With Quote
Old 03-08-2023, 12:59 PM   #15
vr8ce
Enthusiast
vr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchforkvr8ce can load mercury with a pitchfork
 
vr8ce's Avatar
 
Posts: 33
Karma: 48958
Join Date: May 2017
Device: iPad Pro 9.7"
Thanks, I'll look into that more.

Without knowing what else (other than beautify and folders) rewrites (and thus reformats) the CSS, is it possible/practical in the folders case to just have it not rewrite the file if there were no changes? IOW, A is original, B is parsed, C is after folder changes, if B=C, then don't overwrite A.
vr8ce is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to turn off auto-hyphenation? kytrid Boyue 9 09-21-2020 03:17 PM
Stand and auto page turn Lima7 Kobo Reader 2 09-07-2018 02:58 PM
Auto turn pages maac2212 Kindle Developer's Corner 3 05-19-2016 08:19 AM
permanently turn off auto rotate xxtraloud Kindle Developer's Corner 1 04-25-2014 01:03 AM
iPod How to turn off auto rotate? Ea Apple Devices 5 09-23-2010 03:56 AM


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


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