代表目录Markdown语法中的文件结构 [英] Representing Directory & File Structure in Markdown Syntax

查看:628
本文介绍了代表目录Markdown语法中的文件结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想描述目录&我的一些Jekyll博客文章中的文件结构,Markdown是否提供了输出此类内容的巧妙方法?

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?

例如,您可以在Jekyll上看到 该目录和网站文件结构在页面上非常整洁地输出:

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

我相信上面的行块字符是Unicode(如 此处的答案 ),但不确定Markdown或其他浏览器将如何处理它们.我希望Markdown包含一些实现此目的的方法,该方法可能在上面输出为Unicode字符.

I believe the line block characters above are Unicode (as described in this answer here), but 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.

推荐答案

如果您担心Unicode字符,则可以使用ASCII来构建结构,因此示例结构将变为

If you are concerned about Unicode characters you can use ASCII to build the structures, so your example structure becomes

.
+-- _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

如果选择ANSI输出,则类似于tree使用的格式.

Which is similar to the format tree uses if you select ANSI output.

这篇关于代表目录Markdown语法中的文件结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆