markup icon indicating copy to clipboard operation
markup copied to clipboard

Color text in markdown

Open jeppeutzon opened this issue 4 years ago • 235 comments

@bkeepers : FYI people are continually asking for coloured text in this closed issue:

https://github.com/github/markup/issues/369

jeppeutzon avatar Feb 07 '21 09:02 jeppeutzon

Hi, thank you for starting this new issue. I would absolutely appreciate that feature. Thank you

paquinmathieu avatar Feb 10 '21 13:02 paquinmathieu

+1000, which is a roughly accurate summation of six years worth of continuous +1 posts on issue #369, most of which weren't noticed due to that issue being closed for most of that time. (I'm exaggerating only slightly; the real number is 76 posts)

Please fix this and sunset one of my most popular StackOverflow questions (another +358 upvotes and counting): https://stackoverflow.com/questions/11509830/how-to-add-color-to-githubs-readme-md-file

Color is an important design feature for many CLI tools, including my underscore-cli tool for hacking on JSON data, and thus, it's important to be able to include properly colored output examples in the documentation.

Currently, the ONLY way to accomplish this is with a screenshot:

example.png

Screenshots are inferior to natively colored text. Beyond the minor inconveniences of being cumbersome to create / edit / maintain, and slower for browsers to load, screenshots thwart readers from copy/pasting key snippets of text, such as the command that was executed in the screenshot -- this makes the documentation less usable, and the potential work-arounds are all very ugly.

Another use-case from issue #369: There's a reason you support auto-colorization of code blocks --- coloring text is crucial for facilitating our eyes to parse it faster. However, there's no fallback story for tail languages and other structured text formats that aren't in your list.

Many, many projects would benefit from being able to tastefully color the structured text in their documentation.

ddopson avatar Feb 15 '21 21:02 ddopson

I am here to add my support to colorization in Markdown. Colors are an essential part of communication and we are in 2021, not in 1981 with monochrome displays.

GiuseppeChillemi avatar Feb 15 '21 23:02 GiuseppeChillemi

+2147483647, we need this to happen!

xinye83 avatar Feb 21 '21 21:02 xinye83

Please, make colors happen!

aarakelian avatar Mar 05 '21 19:03 aarakelian

It is crucial indeed! It's been 7 years for god's sake...

dazdapertrakz avatar Mar 13 '21 07:03 dazdapertrakz

One of examples where color text in markdown is useful is Terraform plan reviews.

Consider attaching Terraform plan into GitHub tickets, issues or pull requests. Having TF plan is useful, makes it easier to review pull request, but.. it is plan text, no colors at all.

avishnyakov avatar Mar 20 '21 03:03 avishnyakov

You can abuse the support for diff. I pipe it through this function (zsh/osx):

format_plan () {
	awk '
    /Terraform will perform the following actions:/ { found=1 }
    /------------------------------------------------------------------------/ { found=0 }
    // { if (found) { print $0 } }
  ' | (
		printf '<details><summary>Plan for %s</summary>\n\n```diff\n\n' "$1" && perl -pe 's/\x1b\[[0-9;]*[mG]//g' | sed -e 's/^\(  *\)\([\+-]\)/\2\1/' -e 's/^\(  *\)~/!\1/' && printf '```\n</details>'
	) | pbcopy
}

akloss-cibo avatar Mar 20 '21 14:03 akloss-cibo

At least, GitHub could create a custom attribute (<span data-color="red">Red</span>) for example. This would be great as you don't have to use style attributes anymore anymore. It would be easy to style these with some javascript.

Recap of two ~hacks~ methods provided to do this

Images

![Red text](http://placehold.it/size/background-hex/foreground-hex?text=a123)

Red text

Diffs

```diff
+ Green
- Red
! Orange
@@ Pink @@
# Gray
...

It's okay but no inline text I guess

And we also have those symbols. but we can disguise them by doing + Green + instead of + Green for example

SiddharthShyniben avatar Mar 22 '21 09:03 SiddharthShyniben

Idk what GitHub is waiting for, all IDE's I use support coloring in MarkDown..
The hacks described above "work", but should really not be considered as a "fix". The solution is way too dirty for that...
It's 2021 guys, we'd like some proper

+ C +
- O -
! L !
@@ O @@
# R #
S

please! :pray:

Rikj000 avatar Apr 18 '21 22:04 Rikj000

Damn, I am surprised at how many people have been asking for color to be implemented into the GitHub markdown preview, and how long they have been asking for it w/o reply. When a company is new, they are so quick to cater to a customers needs, but when they get big like GitHub did, they can honestly care less. Its not that I think they should insert color into there markdown engine, but at the very least give a quick one liner reason as to why they won't implement color into MD rendering engine.

If I had to guess as to why they don't implement color, I would say it is because, they are the only one with black and white text & oversized headers. There markdown, generates a README view that is unique onto GitHub. Any of us can look at a dot MD document on GitHub, and know we are reading something in a GitHub repository. It is so unique and custom, that I see editor extensions that generate markdown in the same format as GitHub does. There MarkDown is a unique trademark of there site. Which makes since because I know that, (75% ) or more, of the time I spend in GitHub, is in my own, or someone else's, README.md documents. I believe they are MS now, which are like the contemporary marketing gurus.

EDIT: Just wanted to point out that using something like + some-text + - some-text - # some-text # * some-text *

wont work because most of the syntax you are suggesting is already being implemented in Markdown. You need something unused like:

$[1] SumText $

Where 1 equals a set of numbers ex(1-8) or (1-4) or whatever... each number is a different color. It would take some ingenuity to implement. Many of the commonly used shorthand's are alreadt being implemented in contemporary markdown.

AjayChambers avatar Apr 21 '21 14:04 AjayChambers

Could you please some support for colored text in markdown?

Fabrizio-Caruso avatar May 22 '21 13:05 Fabrizio-Caruso

Yes color is important part of communication particularly if you are working on visual components. Please make it possible.

4renginy avatar Jun 08 '21 19:06 4renginy

Yes, colors please.

gomain avatar Jun 30 '21 04:06 gomain

colors would be useful when discussing e.g. the output of RSpec, which uses colors a lot.

emiltin avatar Jul 02 '21 21:07 emiltin

Gosh Darn it GitHub, life is no fun without color! Please don't make us read black & white documentation for another 5 years. Give us something to zest our README docs up with. GitHub Markdown feels very archaic, quite honestly, visiting a GitHub README.md doc reminds me of watching I Luv Lucy, except I Luv Lucy was funny at least! Or, actually i just remembered that I Luv Lucy Wasn't funny, but you get the point. GitHub Docs needs color, please give us color, so GitHub stops looking like a 1950's throwback website from an alternate reality where the internet was invented 50 years earlier.

AjayChambers avatar Jul 12 '21 02:07 AjayChambers

Doesn't have to be HTML tags, you are industry leaders if you think some other option is better. Just set the standard, I'm sure everyone is happy as long as we get colors 😃

LauDijksterhuis avatar Jul 16 '21 18:07 LauDijksterhuis

maybe a custom extension to the markup language, that makes it possible to use different colors for light/dark/dimmed mode

CelDaemon avatar Jul 18 '21 09:07 CelDaemon

I need gray colored text to quickly differentiate from author's text and text left in issue/pull request template. Example: https://github.com/ClickHouse/ClickHouse/pull/26897

The text

By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.

has to have gray color.

PS. Maybe I will simply use quotation for that purpose.

alexey-milovidov avatar Jul 30 '21 06:07 alexey-milovidov

It's already 2021 and Github still insists on ignoring colors.

Why

asherhe avatar Aug 02 '21 17:08 asherhe

give me colors or give me death

ChicagoGupta avatar Aug 04 '21 02:08 ChicagoGupta

This makes me so sad that a feature which is one of the most basic features in any IDE/ is getting no love from Microsoft/github...

chanukov avatar Aug 10 '21 22:08 chanukov

Does GitHub not want to add colors, or is it more of a technical or resource issue?

emiltin avatar Aug 11 '21 08:08 emiltin

@Github should Hoist the colours like a true pirate.

panwarab avatar Aug 19 '21 18:08 panwarab

Can we can an answer to this issue please?

perlygatekeeper avatar Aug 19 '21 18:08 perlygatekeeper

It's already 2021 and Github still insists on ignoring colors.

"Already 2021"? I see you're also feeling this:

fuqz3nuzkdg71

ChristianMertes avatar Aug 23 '21 08:08 ChristianMertes

It would be very nice feature to have !

PaulM5406 avatar Aug 24 '21 14:08 PaulM5406

I think GitHub could allow adding classes ({.class#id}), and then style those classes as necessary. This could allow us to add colored text via text {.red}, and this could open doors for a whole lot of stuff (## h2 {.important}, | Table | Header | {.striped}, ![Image](url) {.centered}, [link](link) {.button}, text {.font-handwriting})

SiddharthShyniben avatar Aug 24 '21 15:08 SiddharthShyniben

Common, Github! Consider started an official campaign for

LET MARKDOWN COLORS HAPPEN!

React to this to call their attention!

marcelino-borges avatar Sep 01 '21 02:09 marcelino-borges

- Colors please! -

+( Just give us colors! )+

SiddharthShyniben avatar Sep 01 '21 03:09 SiddharthShyniben