I have a README.md in a repository on GitHub that shows a code block of an example .gitignore. I know that one can mark a code block with a language tag in GitHub Flavored Markdown (GFM). For example, the following would be properly prettified in GFM:

  "json": true

Also, I know that the definitive list of languages supported by GFM is the languages.yml in the linguist repository. However, I cannot figure out which of those language tags I should use.

I tried gitignore even though it isn’t on the list of supported languages, but it doesn’t get highlighting:

# Common editor swap files

What tag should I use in this case?

EDIT: I have opened linguist#4225


I'd use INI so your comment is in green, while the rest is black. Unfortunately, that also shows green on your fourth line. It's the closest match AFAIK.

Perhaps you can insert a new feature request.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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