Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there an official file extension for standalone Markdown files?

share|improve this question
6  
Does anyone use filename.md.txt in the same way as filename.rst.txt? It indicates that it's markdown format, but also falls back to plain text if you don't have something to handle markdown. GitHub recognizes .rst.txt, but not .md.txt: gist.github.com/2770487 –  endolith May 22 '12 at 17:44

7 Answers 7

up vote 65 down vote accepted

There is no requirement for a Markdown file extension, as other answers have explained. But in order for editors or parsers to guarantee that the file they are using is Markdown-formatted, they would look for one of the following extensions:

.markdown
.mdown
.mkdn
.md
.mkd
.mdwn
.mdtxt
.mdtext
.text

There are websites such as GitHub that only use a selection of these extensions for converting to HTML so developers will conform to their standard. (see examples below)

Personally, I have seen .markdown and .mdown used the most, and as a Linux user I would avoid using .md as this can also be a machine description file for compiling code with GCC.


Examples of extension usage:

GitHub: markdown, mdown, mkdn, mkd, md (source)

Elements Markdown Editor: markdown, mdown, mdwn, md

Vim markdown: markdown, mdown, mkdn, mdwn, mkd, md

Bitbucket: markdown, mdown, mkdn, mkd, md, text (source)


Further Reading

There is a Markdown mailing list that has interesting discussions about this topic: 1, 2.

And especially revealing is one of the explanations:

Markdown isn't meant to take over the format of a file, it's a way to subtly add information to the plaintext. Really, the presence of Markdown is metadata, not a file format.
...
No one opening a text file will be confused if they find Markdown syntax, it's pure bonus.

In this sense, it makes sense to use ".text", ".txt", or whatever other plaintext extension is relevant.
...
An editor which knows nothing about Markdown won't care about the metadata and won't be confused by the variety of "non-standard" extensions, but will display and edit the plaintext just fine.

share|improve this answer
    
Bitbucket uses md, mkdn, markdown: confluence.atlassian.com/display/BITBUCKET/… –  Randy Syring Jan 4 '12 at 0:39

The idea of MarkDown and similar light-weight markups is to be readable as plain text, thus they have text/plain extension (.txt or .text).

However, there are some people who use .markdown or .mdown.

share|improve this answer
2  
Just for the record, Elements for the iPhone recognizes .md, .markdown, .mdown, .mdwn and .text –  brupp Feb 26 '11 at 10:31
4  
vim 7.3 recognizes .markdown and .mdown, so .markdown is the most descriptive one. –  queueoverflow May 19 '11 at 11:19
1  
Kohana uses .md –  dawmail333 Jul 24 '11 at 11:33
3  
I've seen a couple of .md in GitHub too, and my Vim at the office recognizes it as Markdown (I've to check why it doesn't at home). –  Wernight Jul 27 '11 at 6:17
1  
This answer is not as extensive / complete as the one with the most votes. –  svandragt Aug 25 '11 at 12:01

I'm not aware of one, but I think a precedent is set by the use of the .text extension on the official website to reveal the Markdown that produces the pages.

share|improve this answer
2  
Just because the official website uses it doesn't mean it's a good idea, though. .text means plain text, not markdown. –  endolith May 22 '12 at 19:36

iA Writer uses the extension .md for Markdown content.

share|improve this answer

In short, the answer is no.

If you are simply using markdown files as stand-alone files that will not be processed in any way, name them however you please. If you are using them in a system the processes them into HTML or PDF or some other format, then you need to figure out what file extensions that system expects for markdown files.

Also, in the context of a UNIX system, file extensions are not even mandatory. You could simply have a file called "README" in markdown format.

share|improve this answer
    
But file will only tell you that it is ASCII text, which does not tell me that I can run it through markdown. –  queueoverflow Jun 8 '11 at 19:21

As an addition to Cas' very good answer I'd like to mention that his link to the github repository of Vim markdown is somewhat deprecated.

The user plasticboy was the original creator of Vim Markdown but it is currently developed and uploaded to the vim scripts site by Hallison Batista and others.

For example one user did a fork to support Gollum links.

share|improve this answer

Doxygen added Markdown suppport in v1.8. It looks for .md or .markdown file extensions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.