A terminal based gempub reader
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
sloum d69e555e4b Fixes an issue with resume functionality 3 months ago
images Redoes the repo image(s) 3 months ago
termios Adds license comment to files missing it 3 months ago
.gitignore Updates meta generation to a human and computer version, updates gitignore 3 months ago
LICENSE Adds license file and license comment to each go file 3 months ago
Makefile Adds URL support 3 months ago
README.md Minor updates to readme 3 months ago
go.mod Initial commit. Non-functional program. 3 months ago
go.sum Initial commit. Non-functional program. 3 months ago
gpub.go Fixes an issue with resume functionality 3 months ago
main.go Fixes an issue with resume functionality 3 months ago
metadata.go Adds license file and license comment to each go file 3 months ago
net.go Adds license file and license comment to each go file 3 months ago
open.go Adds license file and license comment to each go file 3 months ago
open_darwin.go Adds license file and license comment to each go file 3 months ago
zip.go Adds license file and license comment to each go file 3 months ago

README.md

gpr

A basic gempub reader for the terminal. It is a reader/client for gpub files, though they do not have to have that file extension... just the correct metadata and file structure.

Options

The help output of gpr is as follows:

Usage: gpr [option]... [gpub-file]

When run with no options and no file gpr will attempt to resume
reading the last book that was opened where it was left off.

When run with a path to a gpub file gpr will attempt to resume
from where reading left off last for that file, or the beginning
if the file has not been read previously.

When run with a URL to a remote gpub file gpr will attempt to
download the file to $GPR_LIBRARY, if it is set, or
~/.local/share/gpr, if it is not set. The book will then be
opened for reading if it is a valid gpub.

Options:

  -h    Print help text
  -d    Output a book's description (for human reading)
  -fancy
        Use escape sequences to render headings, bold, and italics
  -indent
        Indent the beginning of paragraphs
  -meta
        Output a book's metadata (for processing)

Key Bindings

Key(s) Effect(s)
l, j, RightArrow, or DownArrow Turn to the next page, moving to the next chapter if need be
h, k, LeftArrow, or UpArrow Turn to the previous page, moving to the last page in the previous chapter if need be
L or J Jump to the start of the next chapter
H or K Jump to the start of the previous chapter
q Quit the program (autosaving your place in the book)
Escape Open/Close the Table of Contents
0-9 (any number key) Enter a number; used for entering a ToC entry or a link number that you wish to follow
Backspace Erase the last number in the number input buffer
Enter Submit the number that has been entered to follow the link corresponding to that number (closing the ToC if it is open)
Any Key Re-render the screen, in particular after a terminal size change. Note: any key pressed will still have its normal function as well

Not supported

  • Images (including the cover). Since it is a terminal application and most terminals do not support images I am not attempting to add it as a feature.
  • The Windows operating system: I do not have it, do not use it, and do not know it. If you would like to port this software to windows: please do! I just don't have a machine to test with and am generally uninterested in the platform.

Building

Building gpr from source should be relatively painless... if you have a compiler for golang. If you do, and it is not ancient, a simple go build from within the folder will do the job. Alternatively, make will build. At which point you can run the program ./gpr -h or sudo make install to move it to /usr/local/bin. Note that the Makefile removes some debugging tables and headers that result in a smaller file size than go build will produce by default.

Goals/Thoughts

The point of this reader is to be able to read novels (often converted from epub). The gpub format is smaller and simpler than epub. I am hoping that by building the reader (as well as an epub to gpub converter) more people may start using the gpub format for novels and other prose styles suitable to the format. It is not a core goal of the reader to specifically support capsule archives or other written forms other than fiction writing... but it likely will handle them relatively ok. The gpub format is well suited to journaling, but I think it is also well suited to fiction writing (novels, short story collections, etc), and that it could be a much simpler alternaitve to epub/azw3/etc, giving writers the power to control their works without needing to be software developers. With the sole shortcoming, for me, being the lack of inline italics/em and bold/strong in gemtext. I support their markdown syntax in this reader, which is a break from the gemtext specification that I hope does not start up in gemtext in general and fragment things as I do not think the change would be appropriate for gemini/gemtext in general, just for the gempub book format.

Images

Who doesn't like a screenshot in a repo?

A view of the table of contents and a book page in gpr