github-linguist / linguist

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

Support the Mustache language #2685

Closed dasilvacontin closed 8 years ago

dasilvacontin commented 9 years ago

Most used extensions are .mu and .mustache, I believe. Would you accept a PR for this?

pchaigno commented 9 years ago

.mustache files are currently recognized as HTML+Django. Is Mustache related to Django?

dasilvacontin commented 9 years ago

Nope, not at all. Maybe they use it, but it's unrelated. Mustache is a template system with implementations in over 30 programming languages. I've never used it alongside Django, nor I use Django. http://mustache.github.io/

dasilvacontin commented 9 years ago

Handlebars is Mustache-compliant. Handlebars adds logic statements (among other sugar) to Mustache's logic-less templates.

pchaigno commented 9 years ago

Do you have an example of Mustache file and is there a way to identify them (to distinguish them from Django files)?

sonalkr132 commented 8 years ago

I think Mustache should be language of its own just like haml. Django comes with its DTL and doesn't really have anything to do with Mustache. Using .mustache file extension exclusively for Mustache should be enough. Here is an excerpt from template section of Mustache's readme:

By default, a view will try to find its template on disk by searching for an HTML file in the current directory that follows the classic Ruby naming convention. TemplatePartial => ./template_partial.mustache

pchaigno commented 8 years ago

Flagging this as stale :flags: