DEV Community

Sp1983
Sp1983

Posted on

How to add colorful output to my dev.to posts?

Hi! I am writing post about testing framework which emits nice colorful output, how can I colorize text through dev.to markdown?

Thank you.

Top comments (6)

Collapse
 
andy profile image
Andy Zhao (he/him) •

Hey there! You can colorize text in code blocks, but not the regular text.

To use a code block, type wrap some code with triple back ticks:
code block with no colors example

To colorize it, add a language immediately after the first set of triple back ticks:
code block with colors example

You can find more info in our editor guide: dev.to/p/editor_guide

Collapse
 
sp1983 profile image
Sp1983 •

Thanks Andy. Maybe worth it to allow color text snipped, irrelevant to text? But it is probably beyond Markdown scope ...

Collapse
 
ben profile image
Ben Halpern •

I think it may be. Perhaps you could use a Codepen embed as described in the guide?

Thread Thread
 
sp1983 profile image
Sp1983 •

I presume it only works with Language source code? Not with just any text?

Collapse
 
derekjhopper profile image
Derek Hopper •

carbon.now.sh is a good option if you don't mind sharing your code as an image. A reader wouldn't get the copy/paste option, but you can create a colorful image.

Collapse
 
sp1983 profile image
Sp1983 •

Hi Derek! Will take a look, thanks a lot!