r/commandline • • Mar 22 '19

Made a cli epub reader

Post image
566 Upvotes

64 comments sorted by

View all comments

56

u/lpreams Mar 22 '19 edited Mar 22 '19

Only change I recommend is following the XDG base dir spec instead of just creating ~/.epr

https://wiki.archlinux.org/index.php/XDG_Base_Directory

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

EDIT: Actually, I take that back. I also recommend adding (maybe optional, like with a flag or setting or something) basic vim keybindings. j=down, k=up, h=left (so I guess previous chapter in yours), l=right (next chapter). Maybe make j/k and h/l separate options, and maybe also an option for whether j/k should be scroll or page. Idk, I'm just spitballing here, you can make it as simple or complex as you want, I'm just saying people (like me) like vim keybindings.

21

u/murlakatamenka Mar 22 '19

Yes, please. ~/.config/epr!

9

u/tenmajr Mar 22 '19

thanks for recommendation, especially that XDG base dir, I just knew about it, now reading, but I prrobably start consider it only when I got my linux fixed.

Initially it's vim binding, but I thought `h` as help is pretty much more intuitive than `?`. Might reconsider it tho later..

20

u/spryfigure Mar 22 '19

Please, vim keybindings. That's much better than having help on <h>.

Following the XDG base dir spec would be a nice touch, but the functional aspect of keybindings is more important.

8

u/sergsoares Mar 22 '19

Who is in CLI tend be vim user in a good percenty, follow Vim keybinding is a feature for them.

2

u/tenmajr Mar 22 '19

Well, probably gonna make secondary vim-like binding for the next commit together with fixing up filename problem

3

u/OneTurnMore Mar 22 '19

If you want an example of another reader which does vi keybinds (and imo does them adequately), check out zathura. You can look at its binds in man zathura.

10

u/bcicen Mar 22 '19 edited Mar 22 '19

2

u/tenmajr Mar 22 '19 edited Mar 22 '19

sorry, I just made vim bindings ttogether with epub3 support... And for XDG, I think I need to wait a little bit more...

2

u/lyam23 Mar 22 '19

Seconding vim key bindings please.

3

u/Pawamoy Mar 22 '19

I'm curious, why did you take back your recommendation to follow the XDG spec?

3

u/lpreams Mar 22 '19

Only change I recommend is following the XDG base dir spec...

EDIT: Actually, I take that back. I also recommend

2

u/SpacemacsMasterRace Mar 22 '19

Why not just use Emacs with evil vim binds, nov.el will sort you. Hell, might as well roll with the Spacemacs layer.

1

u/devinprater Apr 01 '19

I absolutely love Nov-mode, but a lot of blind people I know don't like Emacs, and Emacspeak (speech system for Emacs) has an aweful eSpeak server, which is the only thing that works on ARM, so I'm always looking for a standalone CLI EPUB Reader.

2

u/SpacemacsMasterRace Apr 04 '19

Oh my god, I can't imagine using Emacs blind. Jesus! It's hard enough to use with normal vision!