Created
August 23, 2023 11:45
-
-
Save vanvanni/5a3e0aa44145830aaf79972f37567ee6 to your computer and use it in GitHub Desktop.
Simple but not perfect function to export your tree to a markdown code block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mdtree () { | |
echo '```' > $1 | |
tree -I 'node_modules|dist|build|.git|$1' --dirsfirst --prune >> $1 | |
echo '```' >> $1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
mdtree export-file.md
Flaw
It wil also include the export-file.md within the tree, because it is created before tree reading.