![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jul 2010
Device: none
|
Is it possible to change how Calibre formats HTML for Epubs
I am converting a bunch of files to Epub and Calibre tries to pick up the formatting from the original document by adding Classes to most of the HTML elements.
Is it possible to turn them off so it simply adds <p></p> instead of <p class="calibre1"></p> etc.? Thanks |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
I agree, this would be useful. For now I use Notepad++ as a post-processing tool on calibre generated epubs. It has powerful search and replace facilities which can be applied to all files in a folder and can be used to strip these extra <p> classes across a whole book in one go.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Jul 2010
Device: none
|
Thanks Agama, I had a feeling that would be the case. I've been using Sigil for post-processing for this but it adds a whole bunch of time I was hoping to cut out. I hadn't realised I could do this in Notepad++ so might try that to see if thats any easier.
|
![]() |
![]() |
![]() |
#4 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
|
Yes, I had a crummy RTF produced by an OCR package which converted to an epub that was rife with class="calibre1" tag attributes. I'll have to give Notepad++ a try.
(People who are willing to spend a bit of money might want to try UltraEdit. Which also can do search-and-replace on multiple files, among many more wonderful features.) |
![]() |
![]() |
![]() |
#5 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
|
I've also had a play with Sigil and it's quite impressive; a great tool for stripping out unwanted sections/pictures from free epubs, (e.g. Feedbooks), in order to minimize their size. However, I have had trouble with some calibre generated level 3 TOCs within Sigil - they simply didn't show up. The search/replace works well in Sigil but Notepad++ is exceptionally fast and has extended options for matching special characters, (e.g. linefeed, carriage return), and for matching Regular Expressions. It's a good editor for source code as it can colour code syntax for many different file types, including html and xml. There's also a handy macro record/playback facility to do repetitive edits.
I've had a look at the UltraEdit website and their editor looks like Notepad++ on steroids. Could be a good investment if you want the extra features, for example scripts look a really useful tool. Last edited by Agama; 07-07-2010 at 08:22 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
|
Quote:
Notepad++ is incredibly powerful for a free program. And there are lots of useful plug-ins for it. If one is doing editing professionally, it might be worth investing in UltraEdit. I use it at my day job for computer programming. It is one of the few programs that I personally found worthy of spending my own money to purchase. |
|
![]() |
![]() |
![]() |
#7 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jul 2010
Device: Nook
|
On the html conversion topic... and CSS
The other change that I have had to made in my books, and would like to see, is line-height: ##em instead of ##px for the main content. In reflow-aware context, moving to a large font size with fixed line-height leads to line overlap. Moving to em allows the spacing to scale with the font size.
|
![]() |
![]() |
![]() |
#9 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 281
Karma: 52007
Join Date: Jun 2010
Device: nook
|
It is good for Python, although it does not offer function completion like a true IDE (or at least not that I'm aware of). It will collapse code blocks by indent (sort of, it has trouble with finding the end of a block), and has user-definable syntax highlighting. I do not think it highlights code blocks, but there may be a way to make it do that.
Last edited by nyrath; 07-07-2010 at 03:23 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why the font won't change in certain epubs | ficbot | Kobo Reader | 68 | 10-14-2020 01:54 PM |
Calibre Recipe HTML content differs from raw html of index.html. | krunk | Calibre | 4 | 09-20-2010 09:48 PM |
Reader Device Change - Re-Convert all Epubs? | sjfwhite | Calibre | 2 | 06-24-2010 10:55 AM |
How to change the Fonts for ePubs | diokdin | Calibre | 3 | 04-19-2010 09:31 PM |