You can try a third party tool like GitHub Tree to generate directory structure and simply copy it into your markdown.