wustho / baca Goto Github PK
View Code? Open in Web Editor NEWTUI Ebook Reader
License: GNU General Public License v3.0
TUI Ebook Reader
License: GNU General Public License v3.0
baca v0.1.11 cannot open images when clicking the large IMAGE
box.
I've already tried with several other books I own as well as the ones freely available at Project Gutenberg.
IMAGE
box[Win Error 2]
error.Using (touchpad emulated) mouse wheel to scroll with current git checkout (6318c71). Looks like the scroll overshoots a little then bounces back, on each line. Does not occur with epy
.
Upstream renamed fuzzywuzzy
to thefuzz
.
No urgency in switching because the Linux repositories I checked still provide python-fuzzywuzzy
. But since it's apparently only a name change, maybe something like the following would work:
try:
import thefuzz as fuzzywuzzy
except:
import fuzzywuzzy
The README section on configuration mentions
Configuration file available at ~/.config/baca/config.ini for linux users
Would this work also on MacOs architectures? I am on a macOS 12.7.1 Monterey
and it seems no configuration takes effect (I have tried with further versions and it appears not to work either): I presume the system can only be configured on linux then?
Hello,
Textual dev here. We are building a little showcase of apps for the docs / website.
Would you mind if we put a screenshot of Baca there? With a link to the repo of course.
Hello,
With CLImage-0.2.0, there were changes (variables renaming, etc.) that mean baca is not longer compatible with it. Therefore, baca-0.1.16 has a dependency with climage-0.1.3.
In order to be able to use climage-0.2.0 with baca, please find attached this simple patch:
patch-baca_with_CLImage-0.2.0.txt
I was just curious if you had considered using something like CLImage to show images in the terminal while reading?
This is super nice!
Minor improvement request -- add a hotkey for Space to go down (alias for ctrl-f)
Run this command: baca "Karl Marx - Capital\Karl Marx - Capital Vol.I\Karl Marx - Capital Vol.I.epub"
Get This Error
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\Administrator\AppData\Local\Programs\Python\Python3\Lib\site-packages\baca\__main__.py: │
│ 15 in main │
│ │
│ 12 │ │ migrate() │
│ 13 │ │ ebook_path = find_file() │
│ 14 │ │ ebook_class = get_ebook_class(ebook_path) │
│ ❱ 15 │ │ return sys.exit(Baca(ebook_path=ebook_path, ebook_class=ebook_class).run()) │
│ 16 │ except Exception: │
│ 17 │ │ Console().print_exception() │
│ 18 │ │ sys.exit(-1) │
│ │
│ C:\Users\Administrator\AppData\Local\Programs\Python\Python3\Lib\site-packages\baca\app.py:29 in │
│ __init__ │
│ │
│ 26 │ │
│ 27 │ def __init__(self, ebook_path: Path, ebook_class: Type[Ebook]): │
│ 28 │ │ # load first to resolve css variables │
│ ❱ 29 │ │ self.config = load_config() │
│ 30 │ │ super().__init__() │
│ 31 │ │ self.ebook_path = ebook_path │
│ 32 │ │ self.ebook_class = ebook_class │
│ │
│ C:\Users\Administrator\AppData\Local\Programs\Python\Python3\Lib\site-packages\baca\config.py:15 │
│ in load_config │
│ │
│ 12 │
│ 13 def load_config() -> Config: │
│ 14 │ user_conf = ConfigParser() │
│ ❱ 15 │ user_conf.read(retrieve_user_config_file()) │
│ 16 │ default_conf = ConfigParser() │
│ 17 │ default_conf.read(DEFAULT_CONFIG) │
│ 18 │
│ │
│ C:\Users\Administrator\AppData\Local\Programs\Python\Python3\Lib\site-packages\baca\utils\user_a │
│ ppdirs.py:28 in retrieve_user_config_file │
│ │
│ 25 │ configfile = configdir / "config.ini" │
│ 26 │ if not os.path.isfile(configfile): │
│ 27 │ │ # shutil.copyfile(str(DEFAULT_CONFIG), str(configfile)) │
│ ❱ 28 │ │ with open(DEFAULT_CONFIG, "r", encoding="utf-8") as src, open(configfile, "w", e │
│ 29 │ │ │ dest.write(src.read()) │
│ 30 │ │
│ 31 │ return configfile │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: expected str, bytes or os.PathLike object, not _GeneratorContextManager
Happened with pypi release and pip install git+https
Right now I think baca do a nice job to show images as ANSI colored blocks, but can be better to have more external options (that should be easy to do). I think is good idea to show images as it's now, but have an option that shows a place holder with the image filename (Example: [cover.jpg]
) and offer a hotkey to open outside (external). Options:
The obvious one, should be use xdg-open
to open a GUI
(X11/Wayland) viewer of preference (like: nsxiv, imv, feh, imagemagick's display, etc).
I did test this inside multiplexer
(tmux) and TTY
; in TTY the images doesn't have any color, maybe there is a way to improve that. There are other options 4 ANSI colored blocks/ASCII, that works well in GUI and some in TTY (like: aalib, libcaca, viu, chafa, timg, etc). Viu also can use terminal (Kitty, iTerm) features to show images.
At last, use Framebuffer
viewers for TTY (like: fim, fbi, fbvis, jfbview) to have a near GUI image experience in TTY.
I think nnn do this very well with plugins like: preview-tui-ext
, preview-tabbed
, nuke
, imgview
; should be useful because the code is easy to read (I'm no programmer). There is a happy coincidence with gutenread
plugin, that uses epr to read from Project Gutemberg.
Maybe this can help you to add some more image options. Can be as simple as custom command, to use a preferred external iamge viewer. Or more complex, like showing image in a new "window pane" or tab (inside a multiplexer).
I did notice that front cover image (cover.jpg
) was not shown in my tests, I did test with same e-book in epub and azw3 formats. Later I did try with two more epubs, and happens the same, it did skip 1st image (cover).
I'm using baca installed via pipx
on postmarketOS. Setting the background colour values in ~/.config/baca/config.ini
has no effect.
[Color Dark]
Background = #002B36
Foreground = #f5f5f5
Accent = #0178d4
[Color Light]
Background = #FDF6E3
Foreground = #1e1e1e
Accent = #0178d4
I have the above in my configuration, and yet the original colour is used.
Other settings work though (e.g. changing the value of TextJustification
or ShowImageAsANSI
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.