Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Other formats > LRF

Notices

Reply
 
Thread Tools Search this Thread
Old 06-19-2007, 12:11 PM   #1
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
txt2lrf - New and Improved

txt2lrf now supports a lightweight markup language. It has two main design goals:
  1. To allow you to create good looking TXT files that can be read directly as TXT files on a computer screen.
  2. Enable the easy conversion of TXT into nicely formatted LRF

These design goals make it a particularly useful tool for those of you that find creating HTML files by hand too tedious.
Some of the features that the markup supports:
  • Lists
  • Tables
  • Images
  • Automatic TOC creation

Automatic TOC creation makes this an excellent replacement for BookDesigner for those of us who don't use Windows, especially since it supports inline images and tables.

Look at the attached demo for to understand the basic syntax. For full details see: http://daringfireball.net/projects/markdown/syntax

The improved txt2lrf is part of libprs500 v0.3.53 and higher. It can be run from the commandline as
Code:
txt2lrf myfile.txt
Attached Files
File Type: txt demo.txt (1.7 KB, 1941 views)
File Type: lrf txt2lrf.lrf (15.4 KB, 2177 views)

Last edited by kovidgoyal; 06-19-2007 at 12:19 PM.
kovidgoyal is offline   Reply With Quote
Old 06-20-2007, 01:19 PM   #2
tsgreer
Lovin' the e-book life...
tsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with others
 
tsgreer's Avatar
 
Posts: 633
Karma: 2509
Join Date: Nov 2006
Location: Colorado
Device: Ebookwise 1150, Sony PRS-505, Amazon Kindle, BeBook (with OpenInkpot)
I am running the GUI libprs500 v0.3.54 on my Mac, but can I access txt2lrf from within the GUI or is it commandline only? I can't seem to find any reference to the txt2lrf function in the GUI.

Sorry for the silly question! Thanks for all of your hard work...
tsgreer is offline   Reply With Quote
Advert
Old 06-20-2007, 01:21 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
txt2lrf and html2lrf and prs500 are all command line. No GUI.
JSWolf is offline   Reply With Quote
Old 06-20-2007, 01:25 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
They'll be added to the GUI in v0.4.0...towards which libprs500 is inching every day ;-)
Indeed I'm planning to add a GUI editor, rather like the editor box used in the mobileread forums that will allow easy creation of txt file marked up in the markdown format for conversion to LRF.

Last edited by kovidgoyal; 06-20-2007 at 01:29 PM.
kovidgoyal is offline   Reply With Quote
Old 06-20-2007, 03:10 PM   #5
tsgreer
Lovin' the e-book life...
tsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with others
 
tsgreer's Avatar
 
Posts: 633
Karma: 2509
Join Date: Nov 2006
Location: Colorado
Device: Ebookwise 1150, Sony PRS-505, Amazon Kindle, BeBook (with OpenInkpot)
Excellent! I'm looking forward to it. I have put off adding more books the our "uploads" section because I want to be able to have a little more control over the formatting....
tsgreer is offline   Reply With Quote
Advert
Old 06-20-2007, 04:33 PM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by tsgreer View Post
Excellent! I'm looking forward to it. I have put off adding more books the our "uploads" section because I want to be able to have a little more control over the formatting....
You still have that control. You can use html2lrf, txt2lrf, pielrf, or Book Designer.yes, all but BD are from the command line, but is it really so hard to use? To me, it's trivial. And if it is hard, just ask and we'll be glad to try to help.
JSWolf is offline   Reply With Quote
Old 06-20-2007, 05:13 PM   #7
tsgreer
Lovin' the e-book life...
tsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with otherstsgreer plays well with others
 
tsgreer's Avatar
 
Posts: 633
Karma: 2509
Join Date: Nov 2006
Location: Colorado
Device: Ebookwise 1150, Sony PRS-505, Amazon Kindle, BeBook (with OpenInkpot)
Thaks JSWolf. I'm on a Mac with no access to Windows, so Book Designer is out. I'm also one of the fellows that just can't get the command line stuff to work. I've tried plenty, but just doesn't seem to work out for me. But once it's GUI, I'm all over it. Thanks again!
tsgreer is offline   Reply With Quote
Old 06-20-2007, 05:27 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
To convert an HTML file to an LRF file, one of the commands is...

html2lrf --header --font-delta=.5 --bottom-margin=27 -a "Cary Rockwell" -t "Danger in Deep Space" "Rockwell Carey_Danger in Deep Space.htm"

Again, that's using Windows. But it is not hard to do. Honest!
JSWolf is offline   Reply With Quote
Old 06-20-2007, 06:56 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm surprised you still need --bottom-margin. I thought I fixed that bug.
kovidgoyal is offline   Reply With Quote
Old 06-20-2007, 06:58 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,645
Karma: 127837858
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
That's a command from a bat file before you fixed the bottom margin bug.
JSWolf is offline   Reply With Quote
Old 06-20-2007, 08:25 PM   #11
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
Problem with Command line execution of commands in OS X

Hi,

I dragged the libprs500.app to my Desktop, then executed, it asked form my admin login/password which I entered. The GUI program seems to work OK, but none of the command line utilities seem to work. Upon re-running the GUI application, I am asked for the admin login/password again, yet the utilities don't seem to work. Tried it with the current and the previous versions. No dice, I get errors when trying to execute the utilities from within the .app package in the Resources directory. Any ideas?

I'd like to use the command line utilities, fairly comfortable with that as the GUI still has a few minor issues (in updating the library list portion of the display).

Thanks,

Dave
DaveNB is offline   Reply With Quote
Old 06-20-2007, 09:55 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm what errors do you get exactly? Run the GUI and look for any messages in the OSX console (the console should be in the Utilities sub-folder of Applications).
Also post the output of
Code:
ls -l /usr/bin/prs500
kovidgoyal is offline   Reply With Quote
Old 06-23-2007, 04:30 AM   #13
DaveNB
Connoisseur
DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.DaveNB has a complete set of Star Wars action figures.
 
Posts: 86
Karma: 399
Join Date: Jun 2007
Device: Nook, Sony PRS-500, Nokia 770 (FBReader)
Kovid,

Thanks for looking into these problems. I installed Python 2.5.1 sucessfully. Then I opened the libprs500 .dmg and dragged the application to a folder on my Desktop (instead of my Application) and ran it from there. It does prompt for my admin password which I do enter.

For the GUI library list refresh issue:
- no errors are showing up in the console log
- the problem is that if I add lets say a .pdf and a .lrf file, the file selection dialogues come up but the library list remains blank (not even the left hand most column of numbers shows up). If I quit libprs500 gui and then restart, the files then show up. If I add any additional files, nothing is added, only shows the 2 previously added files. Quitting and restarting again then shows all the files. Seems to be a refresh problem.

As for the command line applications not showing up:
I think that on startup the libprs500 GUI is not reliably setting up the symlinks to the executables in it's libprs500.app/Contents/Resources folder into the /usr/bin folder

The symlinks are not set up when I try to run the latest version of libprs500

When I set up the symlinks manually and run it AND when I try to run from the libprs500.app/Contents/Resources folder directly, I get the following error (in both situations, the same error):

%>html2lrf --header --font-delta=.5 --bottom-margin=27 -a "test author" -t "test title" "test.html"
Traceback (most recent call last):
File "/usr/bin/html2lrf", line 25, in <module>
os.execv(loader_path, sys.argv)
OSError: [Errno 2] No such file or directory

Anyone else on OS X having trouble with the command line utilities? Is the libprs500 application self contained or do I have to install some other python libraries/apps too?

Maybe I'm missing some of the Python libraries?

Does the libprs500 check to see if the symlinks are setup properly before running or does it re-install the symlinks each and every time? Does it delete the old symlinks first? Does libprs500 need to be installed in a particular directory?

Thanks, sorry I'm a bit confused.

Dave
DaveNB is offline   Reply With Quote
Old 06-23-2007, 01:52 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,771
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The GUI problems will be fixed in v0.4.0 as the GUI (and its database backend) are being completely rewritten and this time I will test it on OSX as well.

As far as I know it should be possible to install libprs500 in any normal folder of your filesystem Each time the GUI is run it checks if the symlinks exists and point to the correct location, and if they don't it asks for the password.
The reason I chose /usr/bin is that /usr/local/bin is not in the PATH in a default installation of OS X.

libprs500.app is fully self-contained and should not require any external dependencies.
I suspect what's happening is that your installation of python 2.5.1 is interfering, though I don't see why that should happen.

Is the file libprs500.app/Contents/Resources/html2lrf.py being created when you run html2lrf?

EDIT: Also try cleaning everything out and re-installing libprs500. Remove /usr/bin/html2lrf, /usr/bin/prs500, /usr/bin/txt2lrf, /usr/bin/lit2lrf, /usr/bin/libprs500, /usr/bin/rtf-meta, /usr/bin/lrf-meta.
The delete libprs500.app and re download it. If it still doesn't work please post the output of
Code:
ls -l /usr/bin/html2lrf

Last edited by kovidgoyal; 06-23-2007 at 02:05 PM.
kovidgoyal is offline   Reply With Quote
Old 07-09-2007, 06:11 AM   #15
DailyPlanet
This world is not my home
DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.DailyPlanet ought to be getting tired of karma fortunes by now.
 
DailyPlanet's Avatar
 
Posts: 31
Karma: 485498
Join Date: Jul 2007
Location: Massachusetts
Device: Kindle Paperwhite, Kindle Oasis 2
Additions to Gui

Are you also going to be adding in the lit2lrf functions into the gui in version 4?
DailyPlanet is offline   Reply With Quote
Reply

Tags
libprs500, txt2lrf

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ahhhhh - Utility overload: BookDesigner, BookCreator, Textify, txt2lrf...too much FatDog Workshop 6 05-10-2010 12:00 AM
DX: Contrast has Been Improved ny10522 Amazon Kindle 3 06-15-2009 02:46 AM
txt2lrf questions ShellShock Calibre 0 05-04-2009 04:15 AM
Has E-ink improved? Kilarney Which one should I buy? 4 03-14-2009 07:01 PM
txt2lrf daesdaemar Calibre 3 11-20-2008 05:24 PM


All times are GMT -4. The time now is 02:40 AM.


MobileRead.com is a privately owned, operated and funded community.