maintained with Ranger All Contributors MIT License FOSSA Status



## 简介 你见过推特上面的 [这些](https://twitter.com/dan_abramov/status/890191815567175680) [代码](https://twitter.com/reactjs/status/890511993261654017) [图片](https://twitter.com/notquiteleo/status/873483329345028096) 吗? 虽然这些代码令人印象深刻,但从审美角度来说还有提升空间。Carbon 能够轻松地将你的源码生成漂亮的图片并分享。还等什么呢?用这个新发现的美化工具秀给你的 followers 看吧。

Carbon example

## 特性 - **定制化**:定制选项包括图片的语法主题、窗口样式等 - **快速分享**:一键生成图片并分享 - **从 GitHub gist 导入**:只需要在 url 后面加上 GitHub gist id ## 使用 #### 导入 有几种不同的方法可以将代码导入到 Carbon: - 把文件拖放到编辑器中 - 在 carbon url 后面添加 GitHub gist id (比如 [`carbon.now.sh/<你的_gist_id>`](https://carbon.now.sh/3208813b324d82a9ebd197e4b1c3bae8)) - 直接粘贴代码 #### 定制化 当你把代码导入到 Carbon 后,你可以定制生成的代码图片。定制选项包括语法主题、背景颜色、窗口主题、以及 padding 距离。 #### 导出/分享 当你定制完图片样式后,可以分享到推特上面,或者直接保存。 如果你通过 "Tweet" 按钮分享,Carbon 将自动设置你的图片为公开访问。不过如果你想手动分享图片,可以查看 [如何设置 Twitter 图片公开访问](https://help.twitter.com/en/using-twitter/picture-descriptions)。 如果你在文章中添加 Carbon 图片,注意到图片中的源代码对于无障碍技术来说是不可见的,比如无法放大字号或复制。可以考虑新增一个元素展示文本形式的源代码,比如在图片下方加一个 [详细信息展现元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/details)。 #### 安装 Carbon 桌面客户端(离线) 如果你使用的是 Google Chrome 或别的支持 PWA 技术的浏览器,你可以安装 Carbon 并离线使用: 1. 访问 [https://carbon.now.sh](https://carbon.now.sh) 2. 点击浏览器的设置按钮 3. 点击 "安装 Carbon..." ## 社区 浏览社区中的这些优秀项目: ##### 编辑器插件 - [IntelliJ IDEA `carbon-now-sh`](https://plugins.jetbrains.com/plugin/10469-carbon-now-sh) - 在 IntelliJ IDEA 中通过右键菜单导入选中的代码到 Carbon - [Atom `carbon-now-sh`](https://atom.io/packages/carbon-now-sh) - 在 Atom 中通过 `shift-cmd-A` 快捷键导入当前文件到 Carbon - [VS Code `carbon-now-sh`](https://marketplace.visualstudio.com/items?itemName=ericadamski.carbon-now-sh) - 在 VS Code 中通过 `carbon` 命令导入当前文件到 Carbon - [Sublime Text 3 `carbon-now-sh`](https://github.com/molnarmark/carbonSublime) - 在 Sublime Text 3 中通过自定义快捷键导入选中的代码到 Carbon - [Vim `carbon-now-sh`](https://github.com/kristijanhusak/vim-carbon-now-sh) - 在 Vim/Neovim 中通过 `CarbonNowSh()` 函数导入选中的代码到 Carbon - [Emacs `carbon-now-sh`](https://github.com/veelenga/carbon-now-sh.el) - 在 Emacs 中通过 `carbon-now-sh` 交互函数导入选中的代码到 Carbon - [Xcode `carbon-now-sh`](https://github.com/StevenMagdy/CarboNow4Xcode) - 在 `carbon.now.sh` 中打开选中的代码 - [Xcode `nef`](https://github.com/bow-swift/nef-plugin) - 这个 Xcode 扩展程序能让你将选中的代码一键导出成 Carbon 片段 ##### 工具 - [CLI `carbon-now-cli`](https://github.com/mixn/carbon-now-cli) - 用 `carbon-now` 命令在 Carbon 中打开一个文件或者直接下载它,包含交互式选项、可选高亮等功能 - [CodeExpander](https://codeexpander.com) - 是一个智能并具有像 TextExpander 特性的 GitHub Gist 客户端 - [`nef`](https://github.com/bow-swift/nef#-exporting-carbon-code-snippets) - 从 `Xcode Playground` 导出多个 Carbon 代码片段。 ##### 库 - [R `carbonate`](https://yonicd.github.io/carbonate/) - 用 `R` 脚本迭代处理图片样式并在 Carbon 中打开或直接下载。 ##### 书籍 - ["CS 101 - An Introduction to Computational Thinking"](https://itunes.apple.com/us/book/id1435714196) - Sarbo Roy 写的一本计算机科学书. ## 项目作者 Carbon 项目由 TA 们发起: - Mike Fix ([@mfix22](https://github.com/mfix22)) - Brian Dennis ([@briandennis](https://github.com/briandennis)) - Jake Dexheimer ([@jakedex](https://github.com/jakedex)) #### 许可 [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcarbon-app%2Fcarbon.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcarbon-app%2Fcarbon?ref=badge_large)

--- ## 贡献代码 欢迎 PR!请查看 [贡献指南](/.github/CONTRIBUTING.md) 了解详情。 ### 赞助商 你的公司在用 Carbon 吗?考虑一下为此项目的新功能开发、bug 修复等提供赞助。 [![Fossa](https://assets-global.website-files.com/5f4d9ea2592c16056cb0f7a5/5f4d9ea2592c16d9a2b0f7da_logo-FOSSA-night-blue.svg)](https://fossa.com) ### 赞助者 喜欢用 Carbon 吗?考虑一下为此项目的新功能开发或改进提供赞助。 ### 感谢 [ ▲ Vercel ](https://vercel.com?utm_source=carbon-app&utm_campaign=oss) 赞助了 Carbon 的服务托管。 [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/git?s=https%3A%2F%2Fgithub.com%2Fcarbon-app%2Fcarbon&project-name=carbon&repo-name=carbon) ### 贡献者 感谢所有这些优秀的贡献者们 ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

briandennis

💻 📖 🚇 👀

mfix22

💬 💻 🤔

jakedex

💬 💻 🎨 📹

andrewda

💬 💻 🐛 👀

yeskunall

💻 📖 🔧 🐛

stoshfabricius

💻

jkling38

📖

otobrglez

💻

darahak

📖

dom96

💻

elrumordelaluz

💻

cjb

💻

Krzysztof-Cieslak

💻

fernahh

📖

g3r4n

💻

Mat Gadd

🐛 💻

Brad Davies

🐛 💻

Rafael Câmara

💻

Gleb Bahmutov

⚠️ 🔧

Iván Munguía

💻

Dillon Mulroy

💻

Nihad Abbasov

💻

Bruno C. Couto

💻

Mark Molnar

💻

Takahiko Inayama

💻

François Martin

💻

Raphael Amorim

💻

Camron Flanders

💻

Eric Adamski

💻

Winner Crespo

💻 🎨

Milos

💻 🔧 📖 🌍

Yashu Mittal

💻

Rachel M. Carmena

📖

Miguel Salazar

📖 🌍

Vyom Jain

📖 🌍

racaljk

🌍

Sean

💻

Izabela Borges

🌍

Shinil M S

🌍

Berke Atac

🌍

LEE YONGJUN

🌍

Matthew Nielsen

💻

Boy

📦

Vetrivel Chinnasamy

🌍

Farzad YZ

💻 🤔

Yannick Loriot

🌍

Joel Hanson

💻

Muhammad Muzzammil

💻

souppower

🚇

Masato Urai (@uraway_)

🌍

Fernando

🌍

Megha Sachdev

💻 ⚠️

Anudeep Reddy

🚇

Munieru

🌍

Adam Lusted

💻

Jose Noriega

🌍

Merlin Fuchs

🌍

Ramy Majouji

💻

Viktor Nemes

💻

Eric Bailey

💻

Nazeefa

🌍

Pratik Butani

📝

Bakti Aditya

💻

Caleb Taylor

💻

Rogério Munhoz

💻

Technoknol

💻

Tymoteusz Makowski

💻

Nisar Hassan Naqvi

🐛

Ilyas Karim

🐛

Nick Fix

🤔

Melanie Sumner

🤔

aluc

💻

B. Mearns

🤔

Peng Jie

💻

Binyamin Aron Green

💻

Michal

🌍

Quinn Blenkinsop

💻

Dwiferdio Seagal Putra

💻

Ashley Woodall Clark

💻

Tim Wienk

🌍

George McCarron

📖

Erwin Rahayu

🌍 📖

Luca

💻

Andrew Hayes

💻

Bereket Semagn

💻

Lorenzo Lancia

🌍

Guy Adler

🌍

Dan Bamikiya

🤔

kewang

🌍

Rizda Dwi Prasetya

🖋

AbreuY

🌍

>_Rizky.dev

🌍 📖

Abidemi Harry

💻

Marco

🌍

Sam Robbins

📖

alceil

💻

hatsu

💻

Praveen Kumar Purushothaman

🌍

Amir Elsagan

🌍

korzck

🌍

Sakibul Alam

🌍