carbon.now.sh

Pretty code screenshots

Over the past few years I’ve seen a fair share of posts around the internet which attempt to copy paste or screenshot some code directly from an editor and show it. Often this goes completely wrong, either the quality of the image is bad, the formatting looks ugly or there’s unneeded information in the screenshot! This remains one of my pet peeves which I cannot do much about but atleast I can write a post about a very cool tool to help with prettifying any necessary code related screenshots. Carbon.now.sh is a very straightforward website, no strange bells and whistles. Just a small text editor and some options to choose both the programming language as well as the makeup you want to see for your code. For example, take this small piece of Python code I recently wrote, I could paste it directly into this article but that won’t look very good, the formatting is lost as well as the makeup.

def prettify_data(ugly_data): pretty_data = “————Books————\n” for row in ugly_data:
pretty_data += row[1]+” - “+ row[2] +” - Added by: “+ row[3] +”\n” pretty_data += “————~Books~———–” return pretty_data

I then take and add it to the editor. Choose the right programming language and a color scheme that I like.

Hit the export button and good to go!

The app will export the code as a .png screenshot perfect for embedding into any content you might be creating.
I Hope this will be of use to someone else like it has been to me. Happy writing!

Link to the carbon.sh github: https://github.com/carbon-app/carbon