Offline Website Documentation

On most browsers, you can easily download and print a PDF version of a website for offline use by using Ctrl+P.

With that, you can save and render the PDF with Zathura or Mupdf. I discovered that my undervolted laptop actually struggles with Zathura for PDF rendering, however Mupdf renders the PDFs instantaneously.

However, another technique that might be nicer is to save the website page as Web Page (HTML only) and then convert it to a more readable plain-text format. That way it is much easier to search through your documentation using grep or other Unix tools.

Terminal window displaying readable
documentation.
Fig 1. Rendering documentation readable from the terminal.

To do so Pandoc can be used to to convert it to a Markdown page.

pandoc my-site.html --to markdown_strict -o my-site.md

Markdown is not necessarily the most readable format though, so with some extra help of lowdown, we can produce terminal-readable documentation.

NO_COLOR=true lowdown -tterm -o my-site.txt

With the power of Unix, we can pipe these commands together:

pandoc my-site.html --to markdown_strict |\
> NO_COLOR=true lowdown -tterm -o my-file.txt

Then we can read it with less

cat my-file.txt | less -R

- Marc