View Full Version : Tools for adjusting ePub for specifi readers?


tompe
12-24-2009, 07:21 PM
What tools exists for automatically convert an ePub to something suitable for a specific reader? Just playing around with my Gen3 and ePub a couple of hours I have noticed tha you need to remove text-align from the css file to be able to choose justification or not in the Gen3. You also need to adjust the top margin.

So have anybody started writing any libraries for this or should I just write the tools myself (maybe a good project for learning Python...).

JSWolf
12-26-2009, 04:16 PM
What tools exists for automatically convert an ePub to something suitable for a specific reader? Just playing around with my Gen3 and ePub a couple of hours I have noticed tha you need to remove text-align from the css file to be able to choose justification or not in the Gen3. You also need to adjust the top margin.

So have anybody started writing any libraries for this or should I just write the tools myself (maybe a good project for learning Python...).
If I was converting ePub to something else, I would use Calibre.

tompe
12-26-2009, 04:22 PM
If I was converting ePub to something else, I would use Calibre.

Well, I was not talking about converting to something else. I was talking about e.g. modifying the css file in an existing ePub and avoid modifying anything else.

rogue_ronin
12-26-2009, 04:50 PM
I believe that Sigil opens your CSS as a style-sheet at the top of the document. Make your changes, and save should do it.

The new 2.0 will actually have a separate CSS editor, too, I think. Should be great.

m a r

mtravellerh
12-26-2009, 04:54 PM
I believe that Sigil opens your CSS as a style-sheet at the top of the document. Make your changes, and save should do it.

The new 2.0 will actually have a separate CSS editor, too, I think. Should be great.

m a r

Sigil works great, but you have to have a little elementary CSS knowledge.

JSWolf
12-26-2009, 05:13 PM
Well, I was not talking about converting to something else. I was talking about e.g. modifying the css file in an existing ePub and avoid modifying anything else.
What I do is I have .epub associated with WinRAR so all I have to do is right click the .epub and select open with and then select WinRAR and it opens and I can extract the contents. I then make my changes to the HTML & CSS as needed and re-zip the files I've changed.

I use Notepad++ to make the changes.

tompe
12-26-2009, 05:53 PM
I will test Sigil.

Yes, I cal also unzip the ePub, modify it in Emacs, and zip it together again. But that is kind of primitive when you can have a clever script that do all the things automatically.

rogue_ronin
12-26-2009, 06:40 PM
I will test Sigil.

Yes, I cal also unzip the ePub, modify it in Emacs, and zip it together again. But that is kind of primitive when you can have a clever script that do all the things automatically.

Yeah, you're looking to make it easier -- that's what computers are supposed to do!

You might have to make a fairly smart script, one that can check for various values that you discover, as most CSS are going to be different from one another in layout.

Or, you might be able to create a "generic" CSS that you like and simply substitute the entire file. Depends on how the XHTML is structured, of course.

Or, just add your preferences to the end of the existing CSS file. The rules are processed such that the last read rules are dominant, I think.

m a r

tompe
12-26-2009, 06:51 PM
You might have to make a fairly smart script, one that can check for various values that you discover, as most CSS are going to be different from one another in layout.

The plan was to take one book at the time. And hope that the number of way to specify body text is limited or that you easily can identify body text and what "tag" it has.

rogue_ronin
12-26-2009, 07:22 PM
The empirical approach.

Should work!

Do share it with others if you get a good script working.

m a r

Toxaris
12-30-2009, 03:26 PM
You could try the tweak_epub tool specified in another thread (http://www.mobileread.com/forums/showthread.php?t=48775&page=4).

With the tool you can easily edit only a few files. You still need some basic CSS knowledge though. Not that difficult usually.