The Wolfe Pack

Here is an improved version of the pdf function from a couple days ago. In the old version, some links in the generated documents would not work because they reference the file itself which was not created because it used stdout.

pdf()
{
    if [[ $# -ne 1 ]]; then
        echo 'Usage: pdf <file>' >&2
    else
        local dir="$(mktemp -d)"
        pdftohtml -noframes -i -s $1 "${dir}/${1%.[pP][dD][fF]}.html"
        w3m -s "${dir}/${1%.[pP][dD][fF]}.html"
        rm -rf "${dir}"
    fi
}
replies
0
announces
0
likes
0