问题
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
回答1:
For .gitignore
there is no default linguist available by 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 default linguist.
```dockerfile
FROM golang:1.10-alpine3.8
ENV NAME demo
ENV SOURCEROOT /go/src/github.com/${NAME}
COPY . ${SOURCEROOT}
WORKDIR ${SOURCEROOT}
...
...
```
来源:https://stackoverflow.com/questions/52402063/how-can-i-highlight-gitignore-code-for-my-readme-md