Go back to previous page
Forum URL: http://www.eyrie-productions.com/Forum/dcboard.cgi
Forum Name: Eyrie Miscellaneous
Topic ID: 261
Message ID: 4
#4, RE: eBook versions of EPU works -- anybody done anythin
Posted by Zox on Jan-09-12 at 09:45 PM
In response to message #1
LAST EDITED ON Jan-09-12 AT 09:46 PM (EST)
 
>As for modifying the files so they can be read 'normally', the only
>thing you have to do is remove the line breaks; your Kindle will take
>care of the rest. Slightly tedious, but not impossible.

Here's the vim commands I use, which work pretty well for "de-breaking" text files in general (the struck-through "b"s represent spaces):


:1,$s/\t/bbbbbbbb/g
:g/^[^b]/-1j
:1,$s/^bbbbb*/bbbb/

Translated:


  1. Convert all tabs into eight spaces.
  2. Search for lines that don't start with a space, and join each one to the line above itself.
  3. Reduce any group of five or more leading spaces to four spaces.

This does a good job on the majority of the non-Core stories; the parallel-cast-and-song credits on some of the stories don't fare as well.

(The Core stories have idiosyncratic sections that would require a good deal of hand-editing to make right, but most of the body text comes out okay.)