Skip to content

Instantly share code, notes, and snippets.

View jhchabran's full-sized avatar
🧀

Jean-Hadrien Chabran jhchabran

🧀
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praveen-palanisamy
praveen-palanisamy / tree_to_github_markdown.sh
Last active February 10, 2024 06:14
Convert output of tree utility to Markdown in a pretty format. Useful to display code/directory structure
#!/usr/bin/env bash
#File: tree2githubmd
#Description: Convert output of unix tree utility to Github flavoured Markdown
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${tree}"

Debugging Go