Search tool for EPUB e-books
Go to file
tastytea 554caebcef
Make GETTEXT_CREATE_TRANSLATIONS-hack silent.
2021-05-26 11:05:29 +02:00
cmake Don't generate checksums. We do that in the CI. 2021-05-26 10:38:13 +02:00
dist/termcolor Merge commit '6c33fb4dcebd5464d89ca3fb98bdf23847d81fbf' as 'dist/termcolor' 2021-05-25 10:43:32 +02:00
man Add --no-filename switch. 2021-05-26 09:04:16 +02:00
src Add --no-filename switch. 2021-05-26 09:04:16 +02:00
tests Add test for HTML tags in titles. 2021-05-26 08:53:48 +02:00
translations Make GETTEXT_CREATE_TRANSLATIONS-hack silent. 2021-05-26 11:05:29 +02:00
.clang-format Add .clang-tify and .clang-format. 2021-05-21 03:24:28 +02:00
.clang-tidy Add .clang-tify and .clang-format. 2021-05-21 03:24:28 +02:00
.drone.yml Set up drone CI for Debian / Ubuntu package uploading. 2021-05-26 10:37:13 +02:00
.editorconfig Initial commit. 2021-05-20 04:34:06 +02:00
.gitignore Squashed 'dist/termcolor/' content from commit 9a832a1 2021-05-25 10:43:32 +02:00
AUTHORS Initial commit. 2021-05-20 04:34:06 +02:00
CMakeLists.txt CMake: Prefer Config, make Termcolor-message more visible. 2021-05-26 10:48:11 +02:00
CODE_OF_CONDUCT.adoc Initial commit. 2021-05-20 04:34:06 +02:00
CONTRIBUTING.adoc Clarify that the pot-file is created during build. 2021-05-25 20:00:00 +02:00
CREDITS Typo in readme, add Termcolor to CREDITS. 2021-05-25 11:07:37 +02:00
LICENSE Squashed 'dist/termcolor/' content from commit 9a832a1 2021-05-25 10:43:32 +02:00
README.adoc Set up recipe for Debian package generation. 2021-05-26 10:23:18 +02:00
screenshot.png Add screenshot. 2021-05-25 11:43:20 +02:00

README.adoc

epubgrep

epubgrep is a search tool for EPUB e-books. It does not operate on lines, but on whole files. All newlines will be replaced by spaces and HTML will be stripped. This means you can search for text spanning multiple lines and dont have to worry about HTML tags in the text.

epubgrep is licensed under the AGPL-3.0-only. The bundled Termcolor is licensed under the BSD-3-Clause license.

Usage

Screenshot of epubgrep, showing the output of 2 book searches.

See man page for more information.

Install

Packaging status

Gentoo

sudo eselect repository enable guru
echo 'app-text/epubgrep' | sudo tee -a /etc/portage/package.accept_keywords/epubgrep
sudo emaint sync -r guru
sudo emerge -a app-text/epubgrep

Debian and Ubuntu

This repository works for Debian buster (10) and Ubuntu focal (20.04). It may work for other versions, I have not tested it. It does not work for Ubuntu bionic (18.04).

wget -O - https://tastytea.de/tastytea.asc | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.schlomp.space/debian buster main'
sudo apt install epubgrep
Tip
If you get the error message that add-apt-repository was not found, install software-properties-common.

From source

Dependencies

  • Tested OS: Linux

  • C++ compiler with C++17 support (tested: GCC 7/10, clang 6/11)

  • CMake (at least: 3.12)

  • Boost (tested: 1.75.0 / 1.65.0)

  • gettext (tested: 0.21 / 0.19)

  • libarchive (tested: 3.5 / 3.2)

  • fmt (tested: 7.0 / 4.0)

  • AsciiDoc (tested: 8.6 / 9.0)

  • Termcolor (tested: 2.0) (If not found, the bundled version is used.)

  • Optional

    • Tests: Catch (tested: 2.13 / 1.10)

Install dependencies in Debian or Ubuntu

Or distributions that are derived from Debian or Ubuntu. You will need at least Debian buster (10) or Ubuntu focal (20.04), unless you install a newer version of CMake.

sudo apt install build-essential cmake libboost-program-options-dev libboost-locale-dev libboost-regex-dev gettext libarchive-dev libfmt-dev asciidoc

Get sourcecode

Release

Download the current release at schlomp.space.

Development version
git clone https://schlomp.space/tastytea/epubgrep.git

Compile

In a terminal, go to the directory where you unpacked / cloned the source code and then:

mkdir -p build && cd build
cmake ..
cmake --build . -- --jobs=$(nproc --ignore=1)

To install, run sudo make install. To run the tests, run cd tests && ctest.

Tip
If you are using Debian or Ubuntu, or a distribution that is derived from these, you can run cpack -G DEB in the build directory to generate a .deb-file. You can then install it with apt install ./epubgrep-*.deb.
CMake options:
  • -DCMAKE_BUILD_TYPE=Debug for a debug build.

  • -DWITH_TESTS=YES if you want to compile the tests.

  • -DXGETTEXT_CMD=String The program to use instead of xgettext.

  • -DFALLBACK_BUNDLED=NO if you dont want to fall back on bundled libraries.