2# converts html to markdown
3# uses an available program to fetch URL and tidy to normalize it first
5[ -n "$(which pandoc)" ] || {
6 echo >&2 "You need 'pandoc' to use this program!"
9[ -n "$(which tidy)" ] || {
10 echo >&2 "You need 'tidy' to use this program!"
14if [ -z "$1" ] || [ -f $1 ]; then
15 tidy -utf8 $1 2>/dev/null | pandoc -r html -w markdown -s
17 # Treat given argument as an URL. Locate a
18 # sensible text based browser (note the order).
19 for p in wget lynx w3m curl links w3c; do
20 if which $p >/dev/null; then
25 # Setup proper options.
28 lynx) OPT="-source" ;;
29 w3m) OPT="-dump_source" ;;
31 links) OPT="-source" ;;
33 "") echo -n >&2 "Needs a program to fetch the URL "
34 echo -n >&2 "(e.g. wget, w3m, lynx, w3c, or curl)."
37 # Fetch and feed to pandoc.
38 $DUMPER $OPT $1 2>/dev/null | tidy -utf8 2>/dev/null | pandoc -r html -w markdown -s
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list