
Carbon – Create and share images of your source code - praveenscience
https://carbon.now.sh/
======
Meekro
I love the appearance of it, but there are very few cases where sharing un-
copyable blocks of code is actually what you want.

Let's say you're making a programming tutorial, or you're publishing an open
source library and want to provide a website with code examples. Appearance is
important, of course, but your audience will want to copy/paste your examples.

I feel like this should be a CSS generator for styling the <code> or <pre>
tag. If you really want to have a built-in screenshot exporter as well, I
suppose that's fine too!

~~~
chrisseaton
How do you share code snippets on Twitter?

~~~
baroffoos
You upgrade to a platform that was made for sharing code snippets and not
flinging insults and blogspam

~~~
JadoJodo
I find it frustrating that you not only failed to answer the question to which
you responded, but you also failed to provide the name of the alternative
platform you so condescendingly espoused.

~~~
tomc1985
A disingenuous answer is still an answer. Just because it's trendy to abuse a
medium like Twitter for all sorts of unintended purposes doesn't mean its good
or right.

------
saagarjha
Aside: if you're using this on a platform where it's easy to actually share
the code itself, please don't use this. It might look pretty, but you can't
copy from it easily. Plus it's inaccessible unless you've jumped through the
hoops to make it so, at which point you might as well just link to the code
directly.

~~~
viiralvx
Yeah, I've found myself using Carbon for sharing code in my tweets, really
it's the only time I use it.

~~~
nickjj
It's already pretty easy to do this without Carbon -- at least on Windows.

1\. Hit print screen on your keyboard

2\. Select the rectangle area that you want to capture

3\. Paste it into a tweet

You don't even need an intermediate image on your computer unless you wanted
to crop it before sending it to Twitter.

You may also want to consider a step 0 which is to temporarily bump up the
font size in your editor to make it more readable in a tweet.

~~~
eugene-s
Command+Shift+4 on mac. And on Ubuntu there was something too, but I’ve
forgotten the combo

~~~
itsrajju
Shift+PrintScreen. It freezes the screen and lets you draw a rectangle over
the area you want to capture.

~~~
nickjj
> It freezes the screen and lets you draw a rectangle over the area you want
> to capture.

This is what Windows 10 does when you hit print screen on its own (as of a
recent'ish update).

Then there's also:

alt + print screen to automatically capture the focused window.

And ctrl + print screen to capture all monitors instead of the focused window.

------
xixixao
People use this in presentations, but wait if you make a mistake across many
slides :) I think it’s worth looking into a better way to create presentations
with code (there are many).

~~~
lucb1e
Slides are often (usually?) shared, which would now be rendered uncopyable.

~~~
baroffoos
You could include a text file with the full source.

~~~
lucb1e
True, I guess a code repository link is common and even more useful than just
a code snippet.

------
lf-non
Silicon [1] is a similar solution implemented in Rust and can work without
browser & Internet.

[1] [https://github.com/Aloxaf/silicon](https://github.com/Aloxaf/silicon)

------
nickjj
When adding code to tweets, IMO the most important thing is legibility on all
devices. That means a large font size with minimal distractions.

In the example code snippet from their site more than half of the vertical
space is taken up by unnecessary details added by Carbon (huge shadows, the
window icons, borders and white space). Why would you want to waste half of
your image on non-code elements when the goal is to share code?

~~~
charonn0
You can turn those elements off by clicking the gear icon.

------
knolax
Why not just take a screenshot.

~~~
Double_a_92
This just makes it look pixel perfect, and adds a clean frame around it... In
case that somebody needs to share their code snippets on social media.

------
k__
Would be cool if the service was a bit better integrated into Twitter.

Writing a Tweet, adding code that gets displayed as an image plus a link to
some text-representation of that code-image.

------
mkeedlinger
I think a lot of people are wondering why this exists.

My first thought was in READMEs, just to be flashy. My thoughts were that any
code made fancy in image form could also be found elsewhere, I don't think
(brash assumption on my part) that this was meant to be the only way code is
presented.

For something like twitter or whatever to be flashy though? Very cool. I dig
it.

------
_bxg1
Reminds me of this site that I can no longer find called something like
"instacode" (instacode.com is not it, at least not anymore). It had a more
tongue in cheek vibe but it let you select different themes and even rotate
your code in 3D and apply blur effects and such, then save an image. People
got pretty creative.

------
lalos
It'd be fun to have optional licensing info of said code snippet.

------
akerro
What are usecases of sharing text as image? Is it to force user type from from
image or use OCR to get the text?

~~~
conradludgate
For situations where that text needs to be formatted a specific way but can't
due to the platform. For example, twitter (where you can/should also include a
pastebin, gist, gh repo, etc...) where having an image is better for
retention/engagement

------
ecf
I’ve found Polacode, a VSCode extension that creates screenshots locally, is
much better.

------
denkmoon
macOS has this built in using Apple-Shift-4.

------
st3fan
Please do not use this. Looks pretty but is unusable for code examples. The
web has everything you need for pretty formatted text.

------
tomc1985
Can we please all agree to stop marketing our low-effort side projects like
they were SV companies? The about page on this makes me puke.

@carbon_app -- bro, you're not an app! You're barely more than some JS on a
page.

"Carbon is used by thousands of developers daily, including experts at..." \--
99% sure this is a lie. "Puffery" if we want to be charitable

"carbon" \-- for chrissake "carbon" has like 50 meanings in computing. Name
collide much? Did the author even bother to care?

"Beautiful" \-- stop using this word. Nobody in computing seems to know what
it means and we've cheapened its meaning to whatever stupid colorful,
excessive-whitespace, overly-padded pile of crap that floats our way.
Formatting that impresses snobby, wannabe graphic designers and clueless
executives is not "beautiful", it is "trendy" or "contemporary" at best

