commit 74c3ff4ed81bf041fbef77ea9c65b6053bce4fb1
parent f0325057a5291aef4c42295ee11b20af51e9c133
Author: Sunur Efe Vural <efe@efe.kim>
Date: Sun, 5 May 2019 21:16:37 -0400
add Makefile
Diffstat:
8 files changed, 30 insertions(+), 91 deletions(-)
diff --git a/Makefile b/Makefile
@@ -0,0 +1,23 @@
+# w3mepub - text-based EPUB reader
+# See LICENSE file for copyright and license details.
+.POSIX:
+
+# Adjust $confdir in w3mepub if you change PREFIX
+PREFIX = /usr/local
+
+clean:
+ rm -f less.conf
+
+install:
+ lesskey -o less.conf lesskey
+ mkdir -p $(PREFIX)/bin $(PREFIX)/share/w3mepub
+ cp -f w3mepub $(PREFIX)/bin
+ chmod 755 $(PREFIX)/bin/w3mepub
+ cp -f *.conf *.xsl $(PREFIX)/share/w3mepub
+ chmod 644 $(PREFIX)/share/w3mepub/*
+
+uninstall:
+ rm -f $(PREFIX)/bin/w3mepub
+ rm -f $(PREFIX)/share/w3mepub/*
+
+.PHONY: clean install uninstall
diff --git a/xslt/content.xsl b/content.xsl
diff --git a/xslt/fullpath.xsl b/fullpath.xsl
diff --git a/less.conf b/less.conf
@@ -1,83 +0,0 @@
-#command
-j forw-line
-k back-line
-l right-scroll
-h left-scroll
-$ end-scroll
-0 no-scroll
-d forw-scroll
-u back-scroll
-f forw-screen
-b back-screen
-r repaint
-R repaint-flush
-g goto-line
-p percent
-G goto-end
-s status
-/ forw-search
-? back-search
-n repeat-search
-N reverse-search
-m set-mark
-' goto-mark
-M clear-mark
-w toggle-option S
-q quit
-Q quit
-
-\kd forw-line
-\ku back-line
-\kl left-scroll
-\kr right-scroll
-\kD forw-screen
-\kU back-screen
-\kx no-scroll
-\kh goto-line
-\ke goto-end
-\t forw-search
-\40 forw-screen
-\e undo-hilite
-c undo-hilite
-
-^G status
-= status
-^D forw-scroll
-^U back-scroll
-^N forw-line
-^P back-line
-^E forw-line
-^B back-screen
-^Y back-line
-^F forw-screen
-^R repaint-flush
-
-1 digit
-2 digit
-3 digit
-4 digit
-5 digit
-6 digit
-7 digit
-8 digit
-9 digit
-
-#stop
-
-#line-edit
-\t forw-complete
-\17 back-complete
-^L expand
-^V literal
-^A literal
-\kr right
-\kl left
-\kx delete
-\kh home
-\ku up
-^G abort
-
-#env
-LESS = -e -i -S -W -J -G -z-2 -~ -Q -x4 \#2
-LESSCHARSET = utf-8
-LESSHISTFILE = /dev/null
diff --git a/lesskey b/lesskey
Binary files differ.
diff --git a/xslt/title.xsl b/title.xsl
diff --git a/w3m.conf b/w3m.conf
diff --git a/w3mepub b/w3mepub
@@ -1,18 +1,16 @@
#!/bin/sh
tmpdir=$(mktemp -d /tmp/w3mepub-XXXXXX)
-xsldir=~/test/w3mepub/xslt
-confile=~/test/w3mepub/w3m.conf
-LESSKEY=$HOME/test/w3mepub/lesskey
-export LESSKEY
+confdir=/usr/local/share/w3mepub
+export LESSKEY=${confdir}/less.conf
unset LESS_IS_MORE
unset LESSSECURE
-trap 'rm -r $tmpdir' 0 1 15
+trap 'rm -r "$tmpdir"' 0 1 15
xmltr() {
xsltproc --stringparam rootdir "${rootdir:-na}" \
- "${xsldir}/${1}.xsl" "${tmpdir}/${2}"
+ "${confdir}/${1}.xsl" "${tmpdir}/${2}"
}
unzip -q "$1" -d "$tmpdir" || {
@@ -27,5 +25,6 @@ rootdir=${abspath%/*}
IFS="
"
-w3m -config "$confile" -T text/html -cols 65 -dump \
- $(xmltr content "$fullpath") | less
+w3m -config "${confdir}/w3m.conf" -T text/html \
+ -cols 65 -dump $(xmltr content "$fullpath") | \
+ less