r/github • • Aug 11 '21

I made a self-updating GitHub README!

Post image
175 Upvotes

21 comments sorted by

View all comments

2

u/Highfivesghost Aug 12 '21

How do you get colors in the read me

3

u/AndrewIsntCool Aug 12 '21

GitHub doesn't allow colors in code blocks, but there is a workaround.

When you define a code block, you can give it a language for syntax highlighting. This one is using python's colors.

Here is a list of every language supported by markdown syntax: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml

I recommend diff, it can be used to add color without looking so much like syntax. Here is an example: https://github.com/github/markup/issues/369#issuecomment-394483061 This comment is missing one other color of diff, which is purple. surround your text with @@ and it will show

3

u/Highfivesghost Aug 12 '21

Interesting. Thanks