Top Related Projects
:black_heart: Create and share beautiful images of your source code
🎨 Beautiful images of your code — from right inside your terminal.
The world's most popular non-default computer lockscreen.
📄 CLI that generates beautiful README.md files
📸 Polaroid for your code
Quick Overview
Carbon is an open-source web application that allows users to create and share beautiful images of their source code. It provides a sleek interface for customizing the appearance of code snippets, making them visually appealing for presentations, documentation, or social media sharing.
Pros
- Easy to use with a simple, intuitive interface
- Supports a wide range of programming languages and themes
- Offers various customization options for background, window style, and syntax highlighting
- Allows for easy sharing and exporting of created images
Cons
- Limited to creating static images, not suitable for interactive code demonstrations
- Requires an internet connection to use the web application
- May not support some niche programming languages or custom syntax highlighting
Getting Started
To use Carbon, follow these steps:
- Visit the Carbon website at https://carbon.now.sh/
- Paste your code into the editor
- Customize the appearance using the options panel on the right
- Click the "Tweet" button to share on Twitter or "Export" to download the image
Note: Carbon is a web application, not a code library, so there are no code examples or installation instructions required.
Competitor Comparisons
:black_heart: Create and share beautiful images of your source code
Pros of Carbon
- Actively maintained with regular updates and bug fixes
- Large community with over 30k stars on GitHub
- Extensive documentation and examples available
Cons of Carbon
- Limited customization options for advanced users
- Potential performance issues with large code snippets
- Dependency on external services for some features
Code Comparison
Carbon:
import React from 'react'
import { useTheme } from 'next-themes'
export default function ThemeToggle() {
const { theme, setTheme } = useTheme()
// ... rest of the component
}
Carbon>:
// No relevant code comparison available
// as Carbon> is not a separate repository
Summary
The comparison between Carbon and Carbon> is not applicable, as Carbon> is not a separate repository. Carbon is the main project, while Carbon> likely refers to a specific feature or version within the Carbon repository. The pros and cons listed for Carbon are based on the actual Carbon project. For an accurate comparison, it would be necessary to compare Carbon with a different code snippet sharing tool or image generation project.
🎨 Beautiful images of your code — from right inside your terminal.
Pros of carbon-now-cli
- Command-line interface allows for quick and easy code snippet creation without leaving the terminal
- Supports batch processing of multiple files
- Integrates well with existing CLI workflows and scripts
Cons of carbon-now-cli
- Limited customization options compared to the web-based Carbon
- Lacks real-time preview of the generated image
- May require additional setup and dependencies for some users
Code Comparison
Carbon (web-based):
// No specific code required, as it's a web application
carbon-now-cli:
# Basic usage
carbon-now file.js
# With custom theme and language
carbon-now file.py -t material -l python
Both projects aim to create beautiful code snippets, but they cater to different use cases. Carbon provides a user-friendly web interface with extensive customization options, while carbon-now-cli offers a streamlined command-line experience for developers who prefer working in the terminal. The choice between the two depends on individual preferences and workflow requirements.
The world's most popular non-default computer lockscreen.
Pros of i3lock-color
- Focused on system security and screen locking
- Highly customizable appearance with color options
- Lightweight and efficient for system resources
Cons of i3lock-color
- Limited to screen locking functionality
- Requires more technical knowledge to configure
- Less visually appealing for general users
Code Comparison
i3lock-color (C):
static void draw_image(void) {
if (!vistype)
return;
switch (vistype) {
case 1:
draw_image_centered();
break;
case 2:
draw_image_fill();
break;
}
}
Carbon (JavaScript):
export function getTheme(theme: ThemeConfig, updates: ThemeConfig = {}) {
const newTheme = merge(theme, updates)
if (newTheme.windowTheme === 'none') {
newTheme.windowControls = false
}
return newTheme
}
Summary
i3lock-color is a specialized tool for screen locking with extensive customization options, while Carbon is a web-based tool for creating and sharing code snippets. i3lock-color is more focused on system security and efficiency, whereas Carbon emphasizes visual appeal and ease of use for sharing code. The code comparison shows i3lock-color's C-based implementation for drawing images, contrasting with Carbon's JavaScript functions for theme management.
📄 CLI that generates beautiful README.md files
Pros of readme-md-generator
- Focused on generating README files, making it more specialized for this specific task
- Interactive CLI tool, guiding users through the README creation process
- Supports multiple languages and can generate badges automatically
Cons of readme-md-generator
- Limited to README generation, while Carbon offers broader code snippet sharing capabilities
- Less visually appealing output compared to Carbon's stylized code images
- Lacks the ability to customize colors and themes for the generated content
Code Comparison
readme-md-generator:
const questions = [
{
type: 'input',
name: 'projectName',
message: 'Project name:',
},
// More questions...
];
Carbon:
const themes = {
'3024 Night': '3024-night',
'A11y Dark': 'a11y-dark',
'Blackboard': 'blackboard',
// More themes...
};
While readme-md-generator focuses on gathering project information through a series of questions, Carbon's code emphasizes theme selection for code snippet styling. This reflects their different purposes: readme-md-generator for README creation and Carbon for code snippet visualization.
📸 Polaroid for your code
Pros of Polacode
- Integrated directly into VS Code as an extension
- Captures code snippets from the active editor, maintaining syntax highlighting
- Simpler to use for quick code sharing within the VS Code environment
Cons of Polacode
- Limited customization options compared to Carbon
- Only works within VS Code, lacking web-based functionality
- Less flexibility in terms of export formats and social media integration
Code Comparison
Carbon:
import { createComponent } from 'carbon-components-react'
const MyComponent = createComponent({
name: 'MyComponent',
render: () => <div>Hello, Carbon!</div>
})
Polacode:
// No specific code required for Polacode
// It captures code directly from the VS Code editor
Summary
Carbon is a web-based tool offering extensive customization and sharing options for code snippets, while Polacode is a VS Code extension focused on quick and easy code captures within the editor. Carbon provides more flexibility and features for creating visually appealing code images, whereas Polacode excels in simplicity and integration with the VS Code workflow. The choice between the two depends on the user's specific needs and preferred development environment.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Translations
Introduction
You know all of those code screenshots you see on Twitter? Though the code's usually impressive, we saw room for improvement in the aesthetic department. Carbon makes it easy to create and share beautiful images of your source code. So what are you waiting for? Go impress all of your followers with your newfound design prowess.
Features
- Customization. Customize things like your image's syntax theme, font style, and more
- Share quickly. Save your image or a link with one click
- Save snippets. Create an account to save snippets for later. Shared snippets are automatically unfurled on Twitter and Slack.
Usage
Import
There are a few different ways to import code into Carbon:
- Drop a file onto the editor
- Append a GitHub gist ID to the URL (e.g.
carbon.now.sh/<gist_id_goes_here>
) - Or just start typing!
Customization
Once you've got all of your code into Carbon, you can customize your image by changing the syntax theme, background color, window theme, padding, shadows, fonts, and more.
Exporting & Sharing
After you've customized your image you can share your snippet in a number of ways
Create a saved snippet
Sharing a saved snippet will automatically unfurl the image on platforms like Twitter and Slack. This lets users see your creation, while also giving them access to the source code via the link. Better yet, if you need to make an update, simply follow the link yourself to edit the snippet directly.
To create a saved snippet:
- Login using the "Sign in/Sign up" button
- Edit as you normally would â your snippet will get saved automatically
- Copy the URL from your browser window and share away!
Embed a snippet
This is the recommended method for sharing Carbon on your own website or blog. Readers can even copy the code with the click of a button.
You can embed any Carbon snippet in your website directly using the carbon.now.sh/embed
URL. The "Copy Menu" lets you quickly copy the correct iFrame snippet, or the encoded URL for embedding on platforms like Medium.
Finally, you can also embed saved snippets or GitHub gists using carbon.now.sh/embed/:id
.
Use the Tweet button
The Tweet button will not only share the image on Twitter, but it will also correctly encode the alt
text to ensure your images are accessible. However, if you want to tweet image yourself, please check out how to make your Twitter images accessible.
Download the image directly
Carbon supports downloading your image as a PNG and SVG. You can also click Export â Open
to open your image directly in the browser. Finally, you can copy the Carbon image directly to your clipboard by going to Copy â Image
.
Installing Carbon for Desktop (Offline)
If you are using Google Chrome, or another browser that supports Progressive Web Apps, you can install Carbon for use offline by:
- Visit carbon.now.sh
- Click your browser's settings menu
- Click "Install Carbon..."
Community
Check out these projects our awesome community has created:
Editor Plugins
- IntelliJ IDEA
carbon-now-sh
- Open up the selection in your current IntelliJ IDEA file in Carbon through a context menu - Atom
carbon-now-sh
- Open up your current Atom file in Carbon withshift-cmd-A
- VS Code
carbon-now-sh
- Open up your current VS Code file in Carbon with commandcarbon
- Sublime Text 3
carbon-now-sh
- Open up the selection in your current Sublime Text 3 file with a custom bound key - Vim
carbon-now-sh
- Open up the selection in your current Vim/Neovim using functionCarbonNowSh()
- Emacs
carbon-now-sh
- Open up the selection in your current Emacs using interactive functioncarbon-now-sh
- Xcode
carbon-now-sh
- Open up your current selection incarbon.now.sh
- Xcode
nef
- This Xcode extension enables you to export a code selection as a Carbon snippet in a single action
Tools
- CLI
carbon-now-cli
- Open a file in Carbon or download it directly usingcarbon-now
, featuring an interactive mode, selective highlighting and more - CodeExpander - A smart GitHub gist client with the TextExpander features
nef
- Export multiple Carbon code snippets fromXcode Playground
.@carbonshbot
- A Telegram chatbot which takes in a code snippet or gist URL and generates an Carbon image- R
carbonate
- Iteratively manipulate image aesthetics inR
and either open in Carbon or download directly. - Carbon for Slack - Use Carbon directly in Slack. Just invoke the
/carbon
command.
Citations
- "CS 101 - An Introduction to Computational Thinking" - a computer science textbook by Sarbo Roy.
Authors
Carbon is a project by:
- Mike Fix (@mfix22)
- Brian Dennis (@briandennis)
- Jake Dexheimer (@jakedex)
License
Contribute & Support
Pull requests are welcome! Please see our contributing guidelines for more details.
Sponsors & Backers
Thanks To
â² Vercel for sponsoring Carbon's hosting.
All Contributors
Thanks goes out to all these wonderful people (emoji key):
Top Related Projects
:black_heart: Create and share beautiful images of your source code
🎨 Beautiful images of your code — from right inside your terminal.
The world's most popular non-default computer lockscreen.
📄 CLI that generates beautiful README.md files
📸 Polaroid for your code
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot