Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2024, 10:48 AM   #1
Pocok
Member
Pocok began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2024
Device: none
Modify multiple xhtml files enmasse in one go?

Hello

I have a couple of epubs with over 40-50 xhtml files in them.

Unfortunately the *author* didn't create separate css style file(s), but rather incorporated them into each and every xhtml file.

I want to modify/update them all, but going through them manually would be quite time consuming process, I just want to replace certain segments at the upper part of files, as they were built identically.

Is there a way to speed this process up, not going through them one-by-one?

Thank you!
Pocok is offline   Reply With Quote
Old 01-26-2024, 11:29 AM   #2
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
I admit that I do not understand the problem.
If styles are written in each head section of the xhtml file between the
Code:
<style>...</style>
tags, then after all, replacing this in all files with:
Code:
  <link href="../Styles/Style0001.css" type="text/css" rel="stylesheet"/>
takes just a moment.

In addition, if you put your own css file in the Sigil configuration folder with the name user-template2.css (for EPUB2) or user-template3.css (for EPUB3) respectively, and when selecting the "Add Blank Stylesheet" command, you immediately have a ready-made stylesheet file.

Perhaps your problem is more complicated, but in that case show an example.

Edit: With a few EPUB files I think the whole job would take two minutes.

Last edited by BeckyEbook; 01-26-2024 at 11:31 AM.
BeckyEbook is offline   Reply With Quote
Advert
Old 01-26-2024, 01:56 PM   #3
Pocok
Member
Pocok began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2024
Device: none
Thank you for the reply.

I did that trick and it works.

However that still involves:

-opening each xhtml within a given epub
-replacing the css tags with that single line

As I mentioned, in those epubs (because bad structuring or I don't know) there are 40-50 files to get through. In case of 5 epubs, that's a lot to still click through manually.
Pocok is offline   Reply With Quote
Old 01-26-2024, 02:04 PM   #4
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 the <style>...</style> is identical between the xhtml files in an epub, could you not copy the style from one of the files to a new stylesheet, select all the xhtml files and link them to that stylesheet and then remove the <style>...</style> from all xhtml files in single search/replace?
DNSB is offline   Reply With Quote
Old 01-26-2024, 02:14 PM   #5
Pocok
Member
Pocok began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2024
Device: none
That worked, thank you!
Pocok is offline   Reply With Quote
Advert
Old 01-26-2024, 02:31 PM   #6
Pocok
Member
Pocok began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2024
Device: none
Also another question, unrelated to the original issue:




https://i.imgur.com/ZFBEkmL.png

https://i.imgur.com/zadBsga.png

There are 2 epubs about the same story:
- one is "good looking", the other not really
- their structuring (how the files are organized/build up) is not identical, different *author*

how can I make easy and quick modifications on the second one without too much manual work, going through each paragraph manually/by hand? Is there some kind of way or auto process?

Last edited by Pocok; 01-26-2024 at 02:32 PM. Reason: pictures uploading too slowly, switched to direct linking instead
Pocok is offline   Reply With Quote
Old 01-26-2024, 02:54 PM   #7
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Can I just ask why we're consistently giving the word author the asterisk treatment?
DiapDealer is offline   Reply With Quote
Old 01-26-2024, 02:58 PM   #8
Pocok
Member
Pocok began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jan 2024
Device: none
Because they are unknown people (creators), and overall not important to my questions/situation.

Last edited by Pocok; 01-26-2024 at 03:03 PM.
Pocok is offline   Reply With Quote
Old 01-26-2024, 07:31 PM   #9
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,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I still don't get it, but OK.
DiapDealer is offline   Reply With Quote
Old 01-26-2024, 10:17 PM   #10
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by BeckyEbook View Post
.../...

In addition, if you put your own css file in the Sigil configuration folder with the name user-template2.css (for EPUB2) or user-template3.css (for EPUB3) respectively, and when selecting the "Add Blank Stylesheet" command, you immediately have a ready-made stylesheet file.
Could you please elaborate further?

1. By "Sigil configuration folder", I guess you mean the Edit/Preferences folder? In which place precisely should I insert this css file?
2. I do not find "Add Blank Stylesheet" on my Sigil, neither in the "Tools" nor "Insert" menu items. Is it just a new clip?

Sigil 2.0.2. Qt 6.6.1.

Last edited by roger64; 01-26-2024 at 10:19 PM.
roger64 is offline   Reply With Quote
Old 01-26-2024, 11:48 PM   #11
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
Quote:
Originally Posted by roger64 View Post
2. I do not find "Add Blank Stylesheet" on my Sigil, neither in the "Tools" nor "Insert" menu items. Is it just a new clip?
Right click on Styles in the Book Browser window, click on Add Blank Stylesheet. See attached image.
Attached Thumbnails
Click image for larger version

Name:	add_blank_stylesheet.png
Views:	37
Size:	30.0 KB
ID:	206042  
DNSB is offline   Reply With Quote
Old 01-27-2024, 07:24 AM   #12
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thanks David, I did not think to look here.

Now for the first question...
roger64 is offline   Reply With Quote
Old 01-27-2024, 07:51 AM   #13
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
You are correct, the folder you get from clicking on the button in your edit/preferences section... I think it says "Sigil preferences folder", or something similar, at the bottom of the preferences window. Just put any template files (css, cover, etc.) in that folder. Sigil will see the when it starts up.
Turtle91 is online now   Reply With Quote
Old 01-27-2024, 11:22 PM   #14
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thank you Turtle91.
roger64 is offline   Reply With Quote
Reply

Tags
epub, manual update, mass update, modify, xhtml


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some files.html & toc.xhtml (also Cover.xhtml) chaot Workshop 23 02-13-2017 12:20 PM
split docx into multiple xhtml files xanguera Conversion 14 08-01-2014 07:09 AM
Converting multiple text files to xhtml? Spotnik Sigil 19 04-12-2011 10:37 PM
Merge multiple XHTML files at once gmw Sigil 1 12-28-2010 02:35 AM
multiple xhtml's to pdf monkeyman224 Amazon Kindle 3 10-16-2010 02:39 AM


All times are GMT -4. The time now is 03:21 PM.


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