Quote:
Originally Posted by jjk
Thanks, BetterRed. I didn't know that. It will be very useful for my work.
But, editing by other text editor is only one of my needs.
I want also to read and modify decompressed files by Python scripts.
Here is my project : in Calibre editor I edit a lot of epubs created by Adobe Indesign export. This export creates css with very redundant. The main css file contains for example selector p.Title with up to 15 props/values, p.Title2 with up to 15 props/values. Say that the only difference is about font-size.
So I want to create the p.css file which contains props/values for standard paragraph, and styles.css with p.Title { font-size: 2em; } and p.Title2 { font-size: 1.5em; }, and I link p.css and styles.css to all my xhtml files.
At least I want to create a Python script to dedupe p selector props/values, ie delete those which are already present in p.css selector p. Therefore I need to know where are decompressed files, in order to read them, then modify them, and at least re-compress them.
|
All of that can easily be done in the calibre editor.
What you do is create snippits. Then you can easily add in your own CSS no problem. One thing that's incorrect is {p class="title"} as it should be a header tag such as <h2>. style <h2> to be your main chapter title settings. Using the Edit Spans & Divs plugin, it's very simple to change <p class="title"> to <h2>. Then when you do finish, you can use Remove unused CSS from the tools menu. It will remove unused CSS in the CSS and HTML. So if you are no longer using yout title style, it will be deleted.
If you use the calibre error checker, it will tell you if you have duplicate CSS. Then you just have to delete the one you don't want.
If you are going to write a Python script, you may as well write an editor script to do what you want.