github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
11.98k stars 4.15k forks source link

Add `Markdoc`, `.mdoc` #6721

Open jasikpark opened 4 months ago

jasikpark commented 4 months ago

Language name

Markdoc - https://markdoc.dev

URL of example repository

https://github.com/withastro/astro/blob/main/examples/with-markdoc/src/content/docs/intro.mdoc https://github.com/markdoc/docs/blob/main/pages/index.md

URL of syntax highlighting grammar

https://github.com/markdoc/language-server/tree/main/syntaxes

Most popular extensions

.mdoc, .md

Detected language

Roff

Alhadis commented 4 months ago

Most popular extensions: .mdoc, .md

Ugh, this project picked two file extensions already in-use by existing markup languages (Roff and Markdown). Assuming that Markdoc achieves sufficient usage on GitHub, adding support for it is going to be a pain-in-the-arse… 😞

spenserblack commented 4 months ago

If I understand correctly, Markdoc boils down to Markdown plus an extended syntax like {% this %}? If so I imagine a lot of repositories that use Markdown with other template tools that use this Jinja-like syntax can get misidentified as Markdoc very easily.

I noticed that HTML+Django (alias of Jinja) does not have the .html extension, even though it's commonly used (see nearly every Django project). I assume this is intentional since the syntax would be too similar to tell them apart. Perhaps Markdoc should be treated similarly, and not have the .md extension registered for it?

jasikpark commented 4 months ago

This is why every language should specify itself at the top of the doc like XHTML xD