소스 검색

Add tree-to-markdown

Bryan Roessler 2 주 전
부모
커밋
0417a6241f
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 0 0
      shell/container-home-assistant
  2. 8 0
      shell/tree-to-markdown

+ 0 - 0
shell/container-home-assistant


+ 8 - 0
shell/tree-to-markdown

@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+# Make a nice markdown file from a dir tree
+# Copyright 2021 Bryan C. Roessler
+# Licensed under the Apache License, Version 2.0
+
+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"