06-19-2007, 01:11 PM | #1 |
creator of calibre
Posts: 44,564
Karma: 24495948
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:
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:
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 Last edited by kovidgoyal; 06-19-2007 at 01:19 PM. |
06-20-2007, 02:19 PM | #2 |
Lovin' the e-book life...
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... |
Advert | |
|
06-20-2007, 02:21 PM | #3 |
Resident Curmudgeon
Posts: 76,489
Karma: 136564766
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.
|
06-20-2007, 02:25 PM | #4 |
creator of calibre
Posts: 44,564
Karma: 24495948
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 02:29 PM. |
06-20-2007, 04:10 PM | #5 |
Lovin' the e-book life...
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....
|
Advert | |
|
06-20-2007, 05:33 PM | #6 |
Resident Curmudgeon
Posts: 76,489
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
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.
|
06-20-2007, 06:13 PM | #7 |
Lovin' the e-book life...
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!
|
06-20-2007, 06:27 PM | #8 |
Resident Curmudgeon
Posts: 76,489
Karma: 136564766
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! |
06-20-2007, 07:56 PM | #9 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm surprised you still need --bottom-margin. I thought I fixed that bug.
|
06-20-2007, 07:58 PM | #10 |
Resident Curmudgeon
Posts: 76,489
Karma: 136564766
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.
|
06-20-2007, 09:25 PM | #11 |
Connoisseur
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 |
06-20-2007, 10:55 PM | #12 |
creator of calibre
Posts: 44,564
Karma: 24495948
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 |
06-23-2007, 05:30 AM | #13 |
Connoisseur
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 |
06-23-2007, 02:52 PM | #14 |
creator of calibre
Posts: 44,564
Karma: 24495948
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 03:05 PM. |
07-09-2007, 07:11 AM | #15 |
This world is not my home
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?
|
Tags |
libprs500, txt2lrf |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ahhhhh - Utility overload: BookDesigner, BookCreator, Textify, txt2lrf...too much | FatDog | Workshop | 6 | 05-10-2010 01:00 AM |
DX: Contrast has Been Improved | ny10522 | Amazon Kindle | 3 | 06-15-2009 03:46 AM |
txt2lrf questions | ShellShock | Calibre | 0 | 05-04-2009 05:15 AM |
Has E-ink improved? | Kilarney | Which one should I buy? | 4 | 03-14-2009 08:01 PM |
txt2lrf | daesdaemar | Calibre | 3 | 11-20-2008 06:24 PM |