Thread: LRF output
View Single Post
Old 05-05-2007, 10:45 AM   #41
Xenophon
curmudgeon
Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.Xenophon ought to be getting tired of karma fortunes by now.
 
Xenophon's Avatar
 
Posts: 1,481
Karma: 5748190
Join Date: Jun 2006
Location: Redwood City, CA USA
Device: Kobo Aura HD, (ex)nook, (ex)PRS-700, (ex)PRS-500
For those of you converting Baen html files with html2lrf, here's a little trick that may help.

First, process the original html to remove the anchors for each paragraph that are used to show paragraph numbers on mouse over. Then, remove the "page-break-before:" from the css declaration in each htm file. Then, remove the "onmouseover" entry from each paragraph element in the htm files. Only after all of that should you convert it to an lrf.

The result of these changes is a clean lrf file, with no slow-downs in page changes. In addition, when you open it for the first time on the reader, it only takes about 10 seconds to process (as compared to the minute-or-so needed when you convert the original html). I've created a little sed script that automates all of this. Its contents are:
Code:
s/<a id=\"p[0-9]*\" name=\"p[0-9]*\"><\/a>//
s/ onmouseover=\"PNo([0-9]*)\"//
s/page-break-before://
You invoke it with the command-line:
Code:
sed -i old -f yoursedfilehere *.htm
from the directory where you've unpacked the sources.

Those of you on non-Unix hosts are on your own for how to do this, but perhaps this'll give you a good start.

Xenophon
Attached Files
File Type: zip cleaner.sed.zip (567 Bytes, 514 views)
Xenophon is offline   Reply With Quote