From c2cae799b9416a604e05a1004291ff5831a9a8d9 Mon Sep 17 00:00:00 2001 From: lee2sman Date: Tue, 20 Jul 2021 19:04:39 -0400 Subject: [PATCH] switched backend to readability-cli rather than roll my own --- bookmobile.fish | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/bookmobile.fish b/bookmobile.fish index d3ca401..37165a6 100755 --- a/bookmobile.fish +++ b/bookmobile.fish @@ -1,27 +1,17 @@ #!/usr/bin/env fish -set theme themes/sakura.css -set temp ./.temp.html +set theme themes/medium.css -# pulldown html page -wget --output-document $temp $argv - -# Let's grab the page title -# -# solution from https://stackoverflow.com/questions/9312154/wget-page-title -set title (wget --quiet -O - $argv | paste -s -d " " | sed -n -e 's!.*]*>\(.*\).*!\1!p' | sed -n -e 's!.*\(.*\).*!\1!p') +# get title +set title (readable $argv --properties "title") echo "title: " $title -cp $temp originals/$title.html +# pulldown html page +readable $argv --output originals/$title.html -# make rabid reader version -pandoc --self-contained -s $temp -c $theme --lua-filter=lib/remove-images.lua -o reader/$title.html +pandoc --self-contained -f html -t html -c $theme -o reader/$title.html originals/$title.html -# presto changeo converto from html to markdown -pandoc -f html -t markdown_github-raw_html --lua-filter=lib/remove-images.lua -o markdown/$title.md $temp +pandoc -f html -t markdown_github-raw_html -o markdown/$title.md originals/$title.html -pandoc -f html -t epub -o epubs/$title.epub --lua-filter=lib/remove-images.lua $temp - - -rm -f $temp +pandoc -f html -t epub -o epubs/$title.epub originals/$title.html