Quote:
Originally Posted by HarryT
On a related note, do you (or anyone else) know of any good way to create an LRF file from a "collection" of HTML files - ie the sort of document where (for example) one has a book that consists of a "Contents" page which has links to each chapter; each chapter being a separate HTML file?
|
I usually take the index.html (TOC) file and edit it so only the list of files that are referenced is retained- all in perfect order.
This can be done like this
load file in vim editor
remove all linebreaks :%s/\n//
insert linebreaks before all < characters :%s/</{here press ctrl+Q Enter}</g
insert linebreaks after all > characters :%s/>/>{here press ctrl+Q Enter}/g
remove all lines not containing <a href= tag :v/<a href/delete
remove all <a href="http:// tags themselves :%s/<a href="
remove all > tags :%s/">//
You can even make script file
strip_names.vim
" beginning of the script
:%s/\n//
:%s/</{here press ctrl+Q Enter}</g
:%s/>/>{here press ctrl+Q Enter}/g
:v/<a href/delete
:%s/<a href="
:%s/">//
" end of the script
and you call the script by typing
:source strip_names.vim
on the commandline of the Vim editor
Then I take this list and convert it to a script like
cat chapter1.html >> all_of_them.html
cat chapter2.html >> all_of_them.html
and run the script
as an alternative the script all_of_them.vim
can look like
:$read chapter1.html
:$read chapter2.html
then you open an empty file all_of_them.html in Vim
and run the script
:source all_of_them.vim
Now you transform resulting monster html document all_of_them.html to rtf by loading it into your favourite word processor and saving it into rtf or using html2rtf, or by running a vim script that converts chosen html tags to rtf tags and inserts an rtf "header" and "footer" - this way you can retain bold and itallic tags and nuke all others
Then you can procede to transform rtf file into lrf using your favourite tools.
I usually do not bother converting and load rtf file directly into Reader via memory card.
For Vim editor for your favourite operating system (including QNX, AmigaOS or VMS among numerous others) see
www.vim.org