script-tree-to-markdown 289 B

1234567
  1. #!/usr/bin/env bash
  2. # Make a nice markdown file from a dir tree
  3. # Copyright 2021 Bryan C. Roessler
  4. tree=$(tree -f --noreport --charset ascii "$1" |
  5. sed -e 's/| \+/ /g' -e 's/[|`]-\+/ */g' -e 's:\(* \)\(\(.*/\)\([^/]\+\)\):\1[\4](\2):g')
  6. printf "# Code/Directory Structure:\n\n%s" "$tree"