In my Githubs repos documentation I want to represent a directory tree structure like this:
Is there a way to do that with Github flavoured markdown, besides just creating it with ascii art?
So basically like this question, but I'm wondering if there is a github specific solution.
Not directly, no. You'd have to hand create it and put it in yourself. Assuming you are using a *nix box locally and are using utf, then tree will generate it nicely (I believe that is what generated the example you used above).
Assuming you mean the readme.md
as the documentation target, then I think the only way you could automate it would be a git pre-commit hook that ran tree
and embedded it into your readme file. You'd want to do a diff to make sure you only updated the readme if the output changed.
Otoh if you are maintaining seperate docs via github pages, then what you could do, is switch to using jekyll (or another generator) locally and pushing the static pages yourself. Then you could potentially implement the changes you want either as a plugin / shell script* / manual changes (if they won't vary much), or use the same method as above.
*If you integrate it into a commit hook, you can avoid adding any extra steps to changing your pages.