2# converts html to markdown
3# uses an available program to fetch URL and tidy to normalize it first
5pathfind () { # portable which(1), code taken from Debian Developer's Reference
9 if [ -x "$_p/$*" ]; then
18for p in pandoc tidy; do
20 echo >&2 "You need '$p' to use this program!"
26ARGS=${ALL%% -- *} # only the part before ' -- ' delimiters is relevant
29REST=${ALL#$ARGS}; REST=${REST# -- }
30PANDOC_OPTS=${REST:-$PANDOC_OPTS}
36 echo >&2 "Warning: extra arguments '$@' will be ignored!"
39if [ -z "$infile" ] || [ -f $infile ]; then
40 tidy -utf8 $infile 2>/dev/null | \
41 pandoc $PANDOC_OPTS -r html -w markdown -s | \
44 # Treat given argument as an URL. Locate a
45 # sensible text based browser (note the order).
46 for p in wget lynx w3m curl links w3c; do
52 # Setup proper options.
55 lynx) OPT="-source" ;;
56 w3m) OPT="-dump_source" ;;
58 links) OPT="-source" ;;
60 "") printf "Needs a program to fetch the URL " >&2
61 printf "(e.g. wget, w3m, lynx, w3c, or curl)." >&2
64 # Fetch and feed to pandoc.
65 $DUMPER $OPT $infile 2>/dev/null | \
66 tidy -utf8 2>/dev/null | \
67 pandoc $PANDOC_OPTS -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