Giter VIP home page Giter VIP logo

baca's People

Contributors

maxigaz avatar wustho avatar xiota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

baca's Issues

Spacing Issue

There are some words that are not properly spaced. The pattern where they occur is kinda like in a diagonal way.

baca

baca

Calibre EPUB Viewer:

calibre

Error opening an image: [Win Error 2]

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

Steps to reproduce

  1. Download any e-book (this one preferably).
  2. Open the Terminal and direct baca to the e-book path (either by dragging it through the File Explorer or typing it by hand)
  3. Click IMAGE box
  4. baca will show a [Win Error 2] error.

`config.ini` not applied on Mac

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?

Screenshot?

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.

Error when opening ebook

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

image

[Feature] More Image options +[Bug]

More Image options

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).


[Bug]

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).

Background colour preferences are only applied for the scrollbar

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.