View Single Post
Old 04-28-2007, 02:38 AM   #1
EatingPie
Blueberry!
EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.EatingPie puts his or her pants on both legs at a time.
 
EatingPie's Avatar
 
Posts: 888
Karma: 133343
Join Date: Mar 2007
Device: Sony PRS-500 (RIP); PRS-600 (Good Riddance); PRS-505; PRS-650; PRS-350
Exclamation pielrf beta - Text to LRF with Easy TOC, autoflow, etc.

Out of beta, now officially released on the Reader Content forum. All new versions will be posted there, as well as questions answered and whatnot.
Announcing pielrf, a Python command line tool to convert text to Reader lrf format, utilizing Fallstaff's pylrs.

I've only tested this using Python 2.5 on Mac OS X 10.4.9 (Intel). The main features are easy Table of Content creation, curly quotes, top-of-page header and paragraph autoflow.
pielrf -i flatland.txt -o flatland.lrf -t "Flatland" -a "Edwin A. Abbott"
Please feel free to give this a run. I've been using it primarily for Guteberg and OCR books. I've included a few short examples with the executable.

Chapters.

To create chapters, simply add "<chapter>" before the chapter name.
<chapter>Chapter One
This will add "Chapter One" to the main Table of Contents, along with a button on the Table of Contents page at the beginning of the book.

Paragraphs

There's several ways to delimit paragraphs. Gutenberg uses vertical whitespace (CRs), while other files use tabs on the first line of the paragraph, while still others use spaces. By default, the program automatically the actual method used. You can also force it using the "-b" flag: "-b tab" or "-b cr" for example.

Features.

+ Curly (typographic) quotes.
+ Top-of-page header like those in books from the Sony Connect Store.
+ Paragraph auto-flow.
+ Table of Contents and Chapterization if you use the <chapter> tag.
+ Understands HTML tags <i></i>, <b></b>, <center></center>, <sub></sub>, <sup></sup>, <p></p>.
+ Understands ALL HTML Ampersand tags - &amp;, &pound, &uumlat, etc.
+ Paragraphs can be delimited by tabs, spaces, vertical whitespace.
+ Font size / weight (bold) can be controlled from command line.
+ Ability to control almost everything else from the command line too!

Requirements

Requires install of Python 2.5 from the Developer Tools / Tiger Install CD. Also requires pylrs-1.0.0, along with ElementTree 1.2.6.
-Pie

Versions provided here, see subsequent posts for discussion of changes.
Attached Files
File Type: zip pielrf-1.0.zip (34.9 KB, 1172 views)
File Type: zip pielrf-1.1.zip (42.0 KB, 1174 views)
File Type: zip pielrf-1.2.zip (42.9 KB, 1132 views)

Last edited by EatingPie; 05-08-2007 at 06:59 AM.
EatingPie is offline   Reply With Quote