# File extension for CommonMark?

**URL:** <https://talk.commonmark.org/t/file-extension-for-commonmark/440>\
**Category:** Spec\
**Created:** [September 6, 2014, 2:38am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440 "2014-09-06T02:38:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dantobias](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/d/f04885/32.png) [@dantobias](https://talk.commonmark.org/u/dantobias)\
**Post date:** [September 6, 2014, 2:38am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/1 "2014-09-06T02:38:59Z")

</div>

Perhaps the spec should make a suggestion for what file extension to use when CommonMark (formerly Standard Markdown) data is saved in a separate file? Obviously, this is irrelevant when the data is merely submitted in an HTML form, or saved in a database object, but there are occasions when it might be saved into a flat file, so there ought to be a suggested extension for this. Markdown itself seems to lack consistency in this area; .md, .markdown, .mdown, and .markdn have been observed.

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 6, 2014, 3:15am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/2 "2014-09-06T03:15:26Z")

</div>

There’s [a Daring Fireball post](http://daringfireball.net/linked/2014/01/08/markdown-extension) about this very issue. Gruber writes:

> Too late now, I suppose, but the only file extension I would endorse is “.markdown”, for the same reason offered by Hilton Lipschitz:
> 
> > We no longer live in a 8.3 world, so we should be using the most descriptive file extensions. It’s sad that all our operating systems rely on this stupid convention instead of the better creator code or a metadata model, but great that they now support longer file extensions.

However, file extensions sometimes have to be typed, so a long file extension like .markdown may not be the most appropriate.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/codinghorror/32/2_2.png) [@codinghorror](https://talk.commonmark.org/u/codinghorror)\
**Post date:** [September 6, 2014, 6:37am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/3 "2014-09-06T06:37:52Z")

</div>

I don’t see any reason why `.md` or even `.markdown` wouldn’t be fine, since CommonMark is designed to be fully Markdown compatible, and in the cases where the traditional Markdown spec is ambiguous, to choose the most compatible definition that is closest to most authors’ intent.

---

<div class="post-metadata">

**Author:** ![mikl](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mikl/32/67_2.png) [@mikl](https://talk.commonmark.org/u/mikl)\
**Post date:** [September 6, 2014, 6:40am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/4 "2014-09-06T06:40:04Z")

</div>

I suppose we can still say that CommonMark is a Markdown implementation, so we do not need (nor want) a new file extension. `.md` and `.markdown` is widely supported by now, so I hope we will stick to that.

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 6, 2014, 8:39am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/5 "2014-09-06T08:39:37Z")

</div>

.markdown was Gruber’s preference/intent; I suggest we go with that.

---

<div class="post-metadata">

**Author:** ![mikl](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mikl/32/67_2.png) [@mikl](https://talk.commonmark.org/u/mikl)\
**Post date:** [September 6, 2014, 10:16am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/6 "2014-09-06T10:16:10Z")

</div>

I think .md is more common these days. There’s more than 5 times as many `README.md` on Github as there are `README.markdown`:

> **[Build software better, together](https://github.com/search?utf8=%E2%9C%93&q=README.md&type=Code&ref=searchresults)**
>
> GitHub is where people build software. More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects.

  

> **[Build software better, together](https://github.com/search?utf8=%E2%9C%93&q=README.markdown&type=Code&ref=searchresults)**
>
> GitHub is where people build software. More than 50 million people use GitHub to discover, fork, and contribute to over 100 million projects.

I don’t think there’s any reason that CommonMark(down) should mandate one or the other. Most apps that deal with Markdown files understand both of them, and probably most of the less common variants too.

---

<div class="post-metadata">

**Author:** ![dantobias](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/d/f04885/32.png) [@dantobias](https://talk.commonmark.org/u/dantobias)\
**Post date:** [September 6, 2014, 11:00am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/7 "2014-09-06T11:00:18Z")

</div>

I guess a related question is, what’s the proper MIME type to use for Markdown / CommonMark data?

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 6, 2014, 11:06am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/8 "2014-09-06T11:06:14Z")

</div>

I prefer `.md` as well and it does seem to be very widely used. I think we should include `.md` and `.markdown` but not the others unless there is a good reason to.

---

<div class="post-metadata">

**Author:** ![mikl](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mikl/32/67_2.png) [@mikl](https://talk.commonmark.org/u/mikl)\
**Post date:** [September 6, 2014, 11:53am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/9 "2014-09-06T11:53:46Z")

</div>

There is no official mime type, but `text/x-markdown` looks like a good bid, see [What is the mime type for markdown? (StackOverflow)](https://stackoverflow.com/q/10701983/66851).

---

<div class="post-metadata">

**Author:** ![rwzy](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/r/3d9bf3/32.png) [@rwzy](https://talk.commonmark.org/u/rwzy)\
**Post date:** [September 6, 2014, 11:59am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/10 "2014-09-06T11:59:26Z")

</div>

Why `x-markdown` instead of just `markdown`? My understanding was the `x-` prefix was normally there for _unstandardized_ formats? But this is standard markdown (commonmark now) right?

---

<div class="post-metadata">

**Author:** ![mikl](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mikl/32/67_2.png) [@mikl](https://talk.commonmark.org/u/mikl)\
**Post date:** [September 6, 2014, 12:48pm UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/11 "2014-09-06T12:48:00Z")

</div>

> [@rwzy](#):
>
> My understanding was the x- prefix was normally there for unstandardized formats?

The `x-` indicates that it’s a non-standard MIME-type, not that the file format itself is not standardized – the standard MIME-types are only those appearing on this list: [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml) – and getting on that list is not easy. If you look at the `text/*` section, there are very few standard mimetypes that are not vendor-specific types (like `vnd.debian.copyright`).

A famous example of this is JSON (which is `application/json` rather than `text/json`) – JavaScript itself is, of course, `text/javascript`.

So in short, until Markdown gets on the list, I’ll have to be `text/x-markdown` or similar.

---

<div class="post-metadata">

**Author:** ![rwzy](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/r/3d9bf3/32.png) [@rwzy](https://talk.commonmark.org/u/rwzy)\
**Post date:** [September 6, 2014, 12:52pm UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/12 "2014-09-06T12:52:08Z")

</div>

Thank you, that makes sense. I was clearly confused.

---

<div class="post-metadata">

**Author:** ![dantobias](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/d/f04885/32.png) [@dantobias](https://talk.commonmark.org/u/dantobias)\
**Post date:** [September 6, 2014, 7:04pm UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/13 "2014-09-06T19:04:25Z")

</div>

On the other hand, [RFC 6648](http://www.rfc-editor.org/bcp/bcp178.txt) deprecates such “x-” prefixes.

---

<div class="post-metadata">

**Author:** ![mikl](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/mikl/32/67_2.png) [@mikl](https://talk.commonmark.org/u/mikl)\
**Post date:** [September 6, 2014, 7:21pm UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/14 "2014-09-06T19:21:01Z")

</div>

Yeah, it’s a tricky problem. Until we could get a proper MIME type delegation from IANA, there are basically no clear choice, because whatever we pick might get rejected by IANA.

We could try for something like `text/vnd.commonmark.markdown`, since, as I understand it, the bar for vendor-specific MIME-types is significantly lower than the universal ones (ie. `text/markdown`).

---

<div class="post-metadata">

**Author:** ![Jim\_Balter](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/46a35a/32.png) [@Jim\_Balter](https://talk.commonmark.org/u/Jim_Balter)\
**Post date:** [September 6, 2014, 9:53pm UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/15 "2014-09-06T21:53:40Z")

</div>

> [@chrisalley](#):
>
> .markdown was Gruber’s preference/intent

I don’t see how that is at all relevant. And for those who think it matters what he personally prefers, be warned that he is as likely as not to be “infuriated” that files called foo.markdown contain CommonMark content.

In any case, tools that need to identify files containing this stuff, whatever it’s called, should accept whatever extensions are in common use.

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 7, 2014, 5:28am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/16 "2014-09-07T05:28:23Z")

</div>

> [@Jim\_Balter](#):
>
> I don’t see how that is at all relevant. And for those who think it matters what he personally prefers, be warned that he is as likely as not to be “infuriated” that files called foo.markdown contain CommonMark content.

I just meant it’s best to keep close to Gruber’s intention with the original spec unless there is a good reason to diverge. It helps prevent fragmentation to have something to appeal to. Although technically `.markdown` isn’t in the spec itself.

---

<div class="post-metadata">

**Author:** ![Jim\_Balter](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/46a35a/32.png) [@Jim\_Balter](https://talk.commonmark.org/u/Jim_Balter)\
**Post date:** [September 7, 2014, 6:10am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/17 "2014-09-07T06:10:05Z")

</div>

I know what you meant … but you yourself don’t seem to understand or be aware of the assumptions – or perhaps worldview – behind your statement. Again, Gruber’s intentions are irrelevant … especially now that he has gone so far out of his way not only to distance himself from this standardization effort and to denigrate it and the people behind it (“a group I don’t agree with”), but to drive a wedge between members of the community and sow confusion forever after because of this cockamamie “CommonMark” name for a standardized spec for Markdown.

> [@](#):
>
> Although technically .markdown isn’t in the spec itself.

Sort of like how, technically, I’m not the queen of Romania.

Not only isn’t it in the spec itself, it isn’t in anything. All we have is Gruber saying, long after he produced anything related to Markdown, that **.markdown** is the only extension that he would endorse (not even that he does endorse it). Again, Gruber’s preferences are completely and utterly irrelevant … all that is relevant is what is commonly used by the community. For that reason, **.md** is the preferred extension, but as I said, tools that need to identify files containing this sort of markup should accept **.md** , **.markdown** , and any other extension in common use.

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 7, 2014, 6:43am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/18 "2014-09-07T06:43:47Z")

</div>

> [@Jim\_Balter](#):
>
> I know what you meant … but you yourself don’t seem to understand or be aware of the assumptions – or perhaps worldview – behind your statement.

Markdown has a very well thought out aesthetic, and I think that’s linked to Gruber’s opinionated nature. I suspect many of us are here because we want to build upon (some of) his preferences/intentions for Markdown, even if we don’t agree with all of them. That said, I agree with either `.markdown` or `.md` for the reasons already outlined in this topic.

---

<div class="post-metadata">

**Author:** ![alex](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/alex/32/294_2.png) [@alex](https://talk.commonmark.org/u/alex)\
**Post date:** [September 7, 2014, 6:54am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/19 "2014-09-07T06:54:34Z")

</div>

If I remember correctly many text editors have followed TextMate’s example and support a variety of file extensions: `.md`, `.mdown`, `.markdown`, and `.markdn`

Does it make sense for the spec to support more than one file extension? I’m personally a huge fan of `.md` even though I know `.markdown` is supposed to be the standard. How much does backwards compatibility with existing documents matter?

---

<div class="post-metadata">

**Author:** ![Jim\_Balter](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/j/46a35a/32.png) [@Jim\_Balter](https://talk.commonmark.org/u/Jim_Balter)\
**Post date:** [September 7, 2014, 8:58am UTC](https://talk.commonmark.org/t/file-extension-for-commonmark/440/20 "2014-09-07T08:58:02Z")

</div>

> [@chrisalley](#):
>
> Markdown has a very well thought out aesthetic, and I think that’s linked to Gruber’s opinionated nature. I suspect many of us are here because we want to build upon (some of) his preferences/intentions for Markdown

There’s that workdview again. I suggest that you read [http://c2.com/cgi/wiki?EgolessProgramming](http://c2.com/cgi/wiki?EgolessProgramming)

[Next page](https://talk.commonmark.org/t/file-extension-for-commonmark/440.md?page=2)
