Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is the proper language for fenced code blocks when representing directory & file structure in Markdown syntax?

I want to represent my directory & file structure in Markdown syntax with fenced code blocks like this:

📁project
├── 📁client
└── 📁server

The thing is that my Markdown linter and other Markdown Style Guides recommend to Always specify the language of the code when using Fenced Code Blocks like this:

```language
a = 1

I was wondering if I should leave it without specifying a language, add a random one, or if there is a specific one for this situation that would highlight the structure.

like image 474
reymon359 Avatar asked Apr 27 '20 06:04

reymon359


People also ask

What is a fenced code block?

Fenced Code Blocks are defined using the syntax originally established in PHP Markdown Extra and popularized by GitHub Flavored Markdown. Fenced code blocks begin with three or more backticks ( ``` ) or tildes ( ~~~ ) on a line by themselves and end with a matching set of backticks or tildes on a line by themselves.

How do you represent code in Markdown?

There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a line, or you can use a code block, which some renderers will apply syntax highlighting to.

How do you code block in Markdown?

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input: This is a normal paragraph: This is a code block. A code block continues until it reaches a line that is not indented (or the end of the article).


Video Answer


1 Answers

There's text for non-highlighted fenced blocks compliant with MD040. I'm not sure how much official in Markdown world that is but it is listed in Github's linguist languages.yml as supported highlighted (in fact non-highlighted) language.

like image 89
blami Avatar answered Oct 23 '22 07:10

blami