Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Representing Directory & File Structure in Markdown Syntax [closed]

I want to describe directory & file structures in some of my Jekyll blog posts, does Markdown provide a neat way of outputting such a thing?

For example, you can see at this link on the Jekyll website that the directory & file structure is output on the page very neatly:

. ├── _config.yml ├── _drafts │   ├── begin-with-the-crazy-ideas.textile │   └── on-simplicity-in-technology.markdown ├── _includes │   ├── footer.html │   └── header.html ├── _layouts │   ├── default.html │   └── post.html ├── _posts │   ├── 2007-10-29-why-every-programmer-should-play-nethack.textile │   └── 2009-04-26-barcamp-boston-4-roundup.textile ├── _data │   └── members.yml ├── _site └── index.html 

I believe the line block characters above are Unicode (as described in this answer here), but I am not sure how Markdown or different browsers will handle them. I was hoping that Markdown had included some way of doing this which outputs as the Unicode characters above perhaps.

like image 692
Matt Rowles Avatar asked Oct 31 '13 05:10

Matt Rowles


People also ask

What is represent in the directory structure?

In computing, a directory is a file system cataloging structure which contains references to other computer files, and possibly other directories. On many computers, directories are known as folders, or drawers, analogous to a workbench or the traditional office filing cabinet.

How do you represent a directory structure in Markdown?

Tree command to generate nested directory structure with markdown. Copy the output to the markdown file and enclose it in three backticks(```markdown) and end with three backticks. And another way is to `pre tag in HTML which preserves the line breaks and spaces. Html tags work in HTML files.


1 Answers

I followed an example in another repository and wrapped the directory structure within a pair of triple backticks (```):

``` project │   README.md │   file001.txt     │ └───folder1 │   │   file011.txt │   │   file012.txt │   │ │   └───subfolder1 │       │   file111.txt │       │   file112.txt │       │   ... │    └───folder2     │   file021.txt     │   file022.txt ``` 
like image 50
user799188 Avatar answered Sep 22 '22 18:09

user799188