1
0

Add a handy script to gen markdown from tree

Dieser Commit ist enthalten in:
2024-07-23 00:23:46 -04:00
Ursprung 3bfc5fbad7
Commit 0440912859

7
script-tree-to-markdown Normale Datei
Datei anzeigen

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