Search code examples
directoryr-markdownmarkdownsyntax-highlightingdirectory-structure

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.


Solution

  • 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.