2

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
{
  "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:

gitignore
# Common editor swap files
*.swp
*~
*\#*

What tag should I use in this case?

EDIT: I have opened linguist#4225

2 Answers 2

1

This has been added to linguist: https://github.com/github/linguist/pull/4343

The tag you should use is ignore-list, as in

```ignore-list
# Common editor swap files
*.swp
*~
*\#*
```

Apparently it also supports gitignore as an alias for ignore-list.

1

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.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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