download-page-to-md 276 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. IFS=$'\n\t'
  4. if [ $# -lt 2 ] ; then
  5. echo "$(basename $0) URL MARKDOWN-FILE" >&2
  6. exit 1
  7. fi
  8. URL=$1
  9. MDFILE=$2
  10. pandoc -f html-native_spans-native_divs \
  11. -t markdown+pandoc_title_block -s \
  12. -o ${MDFILE} \
  13. ${URL}