Ebook manager

Bernardo Magri ee6c928135 update README 1 год назад
src 629b255c08 basics 1 год назад
README.md ee6c928135 update README 1 год назад

README.md

EbookSmith

EbookSmith is a C++ desktop application using gtkmm for managing a collection of ebooks. It supports loading metadata from EPUB and PDF files, displaying book covers, tracking reading progress, and syncing with cloud storage. Users can add, edit, delete, and rearrange books in the collection. The application also renders the first page of PDF files as a book cover.

Features

  • Load metadata (title, author) from EPUB and PDF files.
  • Render the first page of a PDF as the book cover using Poppler and Cairo.
  • Track reading progress with a progress bar.
  • Add, edit, and delete books in the collection.
  • Drag and drop functionality to rearrange books on the "shelf".
  • Cloud synchronization for book files.
  • Store book information in a local SQLite database.

Prerequisites

Make sure you have the following libraries installed:

  • GTK4 (gtkmm)
  • Poppler (poppler-glib for PDF rendering)
  • Cairo (for rendering PDF pages)
  • SQLite3 (for database storage)
  • libxml++ (for parsing EPUB files)

Installation on Ubuntu/Debian:

sudo apt-get install libgtkmm-4.0-dev libpoppler-glib-dev libcairomm-1.0-dev libsqlite3-dev libxml++2.6-dev

Installation on Fedora:

sudo dnf install gtkmm4-devel poppler-glib-devel cairomm-devel sqlite-devel libxml++-devel

Build Instructions

This project uses the Meson build system. To build the project:

  1. Install Meson (if not already installed):

    sudo apt-get install meson  # On Ubuntu/Debian
    sudo dnf install meson       # On Fedora
    
  2. Clone the repository:

    git clone https://git.bernardomagri.eu/bernardo/ebooksmith.git
    cd ebooksmith
    
  3. Configure the build:

    meson setup build
    
  4. Build the project:

    meson compile -C build
    

Running the Application

After building the application, run it from the build directory:

./build/ebooksmith

Usage

Adding Books

  • Drag and drop EPUB or PDF files into the application window to add them to your collection.
  • The application will automatically extract metadata (title, author) from the files and generate a book cover from the first page of PDF files.

Editing Book Details

  • Click on the "Edit" button next to a book to manually update the title, author, or other details.

Removing Books

  • Click the "Delete" button to remove a book from the collection and the SQLite database.

Rearranging Books

  • Drag and drop books within the shelf to rearrange their order.

Cloud Sync

  • The application can sync book files to cloud storage (e.g., Google Drive or Dropbox). Be sure to configure cloud settings appropriately.

Code Structure

  • src/MainWindow.cpp: The main application window, where books are displayed and managed.
  • src/Book.cpp: Handles book-related functionality, including loading metadata and rendering covers.
  • src/BookEditDialog.cpp: Dialog for editing book details.
  • src/CMakeLists.txt: The build script for the project.
  • src/render_pdf.cpp: Renders the first page of a PDF as a book cover using Poppler and Cairo.

Dependencies

  • GTK4 (gtkmm): Used for the graphical user interface.
  • Poppler: For rendering PDF files.
  • Cairo: For drawing PDF pages onto Gdk::Pixbufs.
  • SQLite: For persisting the book collection in a local database.
  • libxml++: For parsing EPUB files.

Example Usage

./ebooksmith

Drag and drop a PDF or EPUB file to add it to the book collection. The metadata will be automatically loaded, and the book cover will be displayed.

Future Enhancements

  • Support for reading progress synchronization across devices.
  • Adding additional formats (such as MOBI).
  • Enhanced cloud integration (OAuth2 for Google Drive, Dropbox, etc.).

License

This project is licensed under the GPL3 License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.