-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1140fcf
commit d5644ad
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Nemo Search Helper] | ||
TryExec=unzip;html2text;nemo-epub2text; | ||
Exec=nemo-epub2text %s | ||
MimeType=application/epub+zip; | ||
Priority=100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Requires unzip package | ||
# ================================== | ||
# 1. Get a list of all xhtml/html/htm files, exclude titlepage.xhtml (if present) | ||
# It appears that the zipped files _never_ contain problem characters such as spaces... | ||
# 2. Extract the html files and convert to text (UTF-8 output is available). | ||
# ================================== | ||
|
||
# 1. Get a list of xhtml/html/htm files [using unzip's weird regular expression] - and exclude any named titlepage/toc/copyright | ||
files=$(unzip -Z1 "$1" \*.*htm* | egrep -v 'titlepage.*|toc.*|copyright.*') | ||
|
||
# 2. Uncompress each of the files and process with html2text. | ||
unzip -cqq "$1" $files | html2text -o - |