DEV Community

Alexey Melezhik
Alexey Melezhik

Posted on

4

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
 
melezhik profile image
Alexey Melezhik

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
 
melezhik profile image
Alexey Melezhik

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
 
melezhik profile image
Alexey Melezhik

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

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay