GP2X Gpl Cli Ebook Reader


FluffyPanda posted on Mar 2 2006 at 10:39 AM said:
Interesting?

From the article it seems to be comparable to less, i.e. a text-based application. So not directly useful.

what's wrong with using 'man' anyway?

P.
 
Last edited by a moderator:
Less doesn't support bookmarks, unless I missed something.

Still, writing a front end to less might not be such a bad way to implement a new ebook reader if the GPH one never sees a source release.


edit: just compiled reed for the desktop. It is very similar to less, but with bookmark support and a display of where you are in the file at the top of the screen.

When I'm not at work I'll mess with the controls and try compiling it for the gp2x.
 
FluffyPanda posted on Mar 2 2006 at 11:18 AM said:
Less doesn't support bookmarks, unless I missed something.

I'm not a big ebook reader. So, this might not be what you mean with bookmarks, but this is how I do these things:

If you're not closing less off, just get interrupted, no need to set a bookmark, less will still be there when you come back.

If you need the terminal, you can always get a new virtual one (you did run screen, did you?).

If I need to set a mark to return to later, e.g. a table to reference now and then:
press m then a letter to mark the spot.
press ' then the letter used before to jump back to the section.
press ' (two single quotes) to go back to where you were when you jumped back.
(if you're going to jump back more before returning, just leave a mark, suggest letter m) (you can jump between files)

Now , on the gp2x, you can't just leave less running, you want to switch off the machine when taking a break.

So just press = and note/remember the fileposition.

For the gp2x you'll not be using less directly (well, maybe in sterm?) so whatever wrapper you use can just make it easy to 'enter' the above commands, and even
record the fileposition (using = and storing the output) when exiting.

P.
 
Last edited by a moderator:
If I was writing a wrapper for less it would be enough to remember the line number and then skip forward to that.

Like I said, less is an option, but reed seems to have implemented almost all the same commands as less plus it displays the file position and stores bookmarks for you (properly, not just by dropping "zzzzz" into a file and then searching).
 
FluffyPanda posted on Mar 2 2006 at 03:21 PM said:
reed [...]displays the file position and stores bookmarks for you.

I guess we're both on the same wavelength.

Anyway, less displays the file position too (-M option for long prompt, can be switched on and off from within less by just typing -M if you forgot to specify it as an option).

Another thing you can do is use tags as bookmarks, e.g.
Code:
luteijn@dollar:~$ cat tags
t         tags            1
b1      less.txt        128
b2      less.txt        256
luteijn@dollar:~$ less -Mtb1

If your tags file is like that, less will open less.txt and go to line 128 when invoked as indicated. you could have one tags file per book (-T to specify which one to use) or one tags file per directory of related books etc.

To set a bookmark, you'd type study the status line of less for a bit, and make sure you stored the current linenumber in your short time memory. Then type -tt<enter> to jump to the tags/bookmark file. Then press v to edit it a bit and update an existing tag with new linenumber, or add a new tag.

It would be a nice feature to be able to dump any 'm'arks you set in less into a tags file.

I got the reed code and quickly gave it a spin. looks like its bookmark file format is a lot like the one you'd use for a 'tags' file for less; too bad the columns are in a different order (filename:line#:tag instead of tag:filename:line#). It seems to have copied some less-isms too, look at how you jump to one letter bookmarks, open up the editor etc.

Too bad it's not just build with less as a starting point, now you have two programs that are both 'close but not 100%'..


P.
 
Last edited by a moderator:
I have to admit when you first suggested less I looked at its man page and I was quite impressed. Before today I'd only used it to pipe the output of cat or ls through and I wasn't aware of all its vi-like functionality.

I guess the question comes down to what exactly an ebook reader needs to do. There seems to be a good number of less functions that reed doesn't have, and the reed only functions would be easy to implement in the wrapper program to less.

I just wonder if less wouldn't be overkill (and there's a sentence that you wouldn't expect to hear). On the plus side, it will probably compile for the gp2x without modification anyway, so any unnecessary functions can just be ignored by the wrapper.

I guess I'll just toss a coin.
 
Back
Top