Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 01-11-2024, 07:05 PM   #1
neurologkhv
Junior Member
neurologkhv began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2024
Device: none
Editing CSS by default

Привет,

Есть много книг в формате fb2.
1. В какой формат лучше конвертировать в пакетном режиме и как это сделать? EPUB?
2. Как изменить CSS по умолчанию?
3. Как добавить собственный CSS?

[Edited by mod to add:
Google Translate:

Hello,
How to change default CSS, insert custom CSS into all books?
Sincerely,
Eugene

Last edited by pdurrant; 01-12-2024 at 02:45 AM.
neurologkhv is offline   Reply With Quote
Old 01-19-2024, 07:48 AM   #2
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,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I’m not aware of software that will automatically insert text into multiple epubs. You may wish to look at .zip manipulation software and GREP ???

It also seems a fairly simple problem easily solved with a python program. You may be able to find someone to whip that up for you.
Turtle91 is offline   Reply With Quote
Old 01-19-2024, 10:04 AM   #3
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 377
Karma: 3557934
Join Date: Feb 2003
Device: Kindle Voyage, Kindle PW1, Kobo Glo HD, Nook Glowlight Plus ...
I may be misunderstanding the question, but I believe that you can set CSS to be added to each Calibre conversion by adding the required CSS to the "Styling" tab of the Look and Feel options or to the "Transform Styles" tab.
slm is offline   Reply With Quote
Old 01-19-2024, 04:24 PM   #4
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,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Create new css file. Select all xhtml files in BookBrowser and use right click to link it.
KevinH is offline   Reply With Quote
Old 01-19-2024, 04:30 PM   #5
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 10,144
Karma: 224760044
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by Turtle91 View Post
I’m not aware of software that will automatically insert text into multiple epubs.
Quote:
Originally Posted by slm View Post
I may be misunderstanding the question, but I believe that you can set CSS to be added to each Calibre conversion by adding the required CSS to the "Styling" tab of the Look and Feel options or to the "Transform Styles" tab.
Yes, you can insert custom css with calibre conversion and do it in bulk.
Sirtel is offline   Reply With Quote
Old 01-19-2024, 07:58 PM   #6
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,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
If you are trying to replace all the current CSS in an ebook with a custom version, please remember that you will have to make sure all the class names match.

For an example, in the last while, I've seen indented paragraphs using CSS classes called indent, para, CO-X04, bodyp, etc. or simply using a <p> making almost impossible to simply replace the old stylesheet with a new stylesheet that will work.
DNSB is offline   Reply With Quote
Old 01-20-2024, 07:24 AM   #7
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,161
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Sirtel View Post
Yes, you can insert custom css with calibre conversion and do it in bulk.
Indeed, but it's hardly ever of value!

You really have to view the ebook in Calibre Editor and it's usually quicker to fix the four CSS for body, first paragraph, chapter heading and images. Sometimes only body and first paragraph, sometimes also verses, quotations, scene separators.

I fixed an ebook yesterday that ONLY had divs for headings, first paragraph, colophons, body paragraph etc. Everything! Didn't take long to edit CSS and change 'div' variously to 'p' or 'h2'.
Adding my own custom CSS would have done nothing.

Also every CSS except headings had 'left' justified and 'small' font (instead of say 1em). There were 184 unused CSS removed by Calibre Editor.
Quoth is offline   Reply With Quote
Old 01-20-2024, 10:46 AM   #8
slm
Fool
slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.slm ought to be getting tired of karma fortunes by now.
 
Posts: 377
Karma: 3557934
Join Date: Feb 2003
Device: Kindle Voyage, Kindle PW1, Kobo Glo HD, Nook Glowlight Plus ...
Of course, it all depends on what you wish to accomplish. The OP seemed to want bulk changes. Calibre's conversion option works well for that. And, if you don't care about the risks of inadvertent problems, the use of the !important qualifier can make unexamined original CSS irrelevant.

I used this in the early days to convert all ebooks to bold. It overrode existing bold declarations so you couldn't see the intended emphasis, but it made it possible for me to read the text. (Now of course, ereader screens are better, you can usually select bold-ish fonts or modify boldness levels on the device.)
slm is offline   Reply With Quote
Old 01-20-2024, 12:00 PM   #9
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 10,144
Karma: 224760044
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by Quoth View Post
Indeed, but it's hardly ever of value!

You really have to view the ebook in Calibre Editor and it's usually quicker to fix the four CSS for body, first paragraph, chapter heading and images. Sometimes only body and first paragraph, sometimes also verses, quotations, scene separators.

I fixed an ebook yesterday that ONLY had divs for headings, first paragraph, colophons, body paragraph etc. Everything! Didn't take long to edit CSS and change 'div' variously to 'p' or 'h2'.
Adding my own custom CSS would have done nothing.

Also every CSS except headings had 'left' justified and 'small' font (instead of say 1em). There were 184 unused CSS removed by Calibre Editor.
I do edit all my ebooks in the editor as well. Body font, paragraph indents, line-height, justification, margins etc. But I also use the bulk conversion or Modify Epub to remove/insert certain things after I've done editing. Like setting widows and orphans to 1, disable hyphenation and a couple more things like that. It's just too time-consuming to add them individually to every book.

Last edited by Sirtel; 01-20-2024 at 12:08 PM.
Sirtel is offline   Reply With Quote
Old 01-20-2024, 12:01 PM   #10
Sirtel
Grand Sorcerer
Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.Sirtel ought to be getting tired of karma fortunes by now.
 
Sirtel's Avatar
 
Posts: 10,144
Karma: 224760044
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
Quote:
Originally Posted by slm View Post
Of course, it all depends on what you wish to accomplish. The OP seemed to want bulk changes. Calibre's conversion option works well for that. And, if you don't care about the risks of inadvertent problems, the use of the !important qualifier can make unexamined original CSS irrelevant.
Unless the original css also uses !important (some Kobo books do).
Sirtel is offline   Reply With Quote
Old 01-20-2024, 12:10 PM   #11
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,161
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I do remove line-height and white-space on ALL ebooks added to calibre by conversion, even epub-epub.
Also if it's from gutenberg or similar I add extra conversion options, such as smarten punctuation, remove paragraph spacing and add indents (mostly only changes body text). Gutenberg mysteriously offiically believes in typewriter quotes and spaced paragraphs, but they did launch etexts in 1972 and neither unicode (after 1987) nor CSS (approx 1996) nor HTML (1990 approx) were invented till later. Though Hypertext is maybe before 1980s, see Project Xanadu, Dynabook, Futurenet CAD/CAE and Apple Hypercard.

Then if it's a publisher I've not seen before I take a quick look in the viewer. I guess I'm lazier than you as I only edit some ebooks!

IMO '!important' in a published ebook is an example of bad design. Also some ebook designers try to do too clever layout, maybe aided by media queries; again it's a poor design decision. It's not paper, so KISS applies. They have no control over ereader or app used.

Last edited by Quoth; 01-20-2024 at 12:15 PM.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing default blank HTML file WV-Mike Sigil 3 07-14-2023 06:28 PM
default css of sigil valarcher Sigil 8 07-25-2022 03:10 PM
Patching vs. editing CSS for W/O and Breaks fabianmoreno01 Kobo Developer's Corner 2 03-11-2022 06:55 AM
Calibre 2.0 problem editing CSS BobC Editor 14 08-24-2014 03:02 PM


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


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