1

I wrote a README.md with parts of code and I want to highlight those parts with the right colors.

One of this code is a .gitignore code, that I would like to integrate to my README.md. But I can't have the good linguist highlight for this, which colorize in green my comments for example.

I have searched some languages detected by GFM but I am not satisfied by the results.

Can someone help me to find the good linguist ?

P.S. : I also want to question for a DockerFile, docker-compose in a REAMDE code highlight.

Thanks, MushuLeDragon

MushuLeDragon
  • 87
  • 2
  • 12
  • Hi! I'm one of the maintainers of Linguist. I'm not sure I get your comment about green comments. Are you trying to find a syntax highlighter that colors comments in green or are you trying to avoid that? Could you post an example of what you're trying to achieve? – pchaigno Sep 19 '18 at 09:42

1 Answers1

5

For .gitignore there is no default linguist available; buy sh is the closest match, so you can use that.

Example: https://gist.github.com/binki/7e0710d92863276ba39091cb299725bd

And for DockerFile, docker-compose use dockerfile linguist. It's the default linguist.

```dockerfile
FROM golang:1.10-alpine3.8
ENV NAME demo
ENV SOURCEROOT /go/src/github.com/${NAME}
COPY . ${SOURCEROOT}
WORKDIR ${SOURCEROOT}
...
...
```
Ridham Tarpara
  • 5,970
  • 4
  • 19
  • 39