🌁 Exporting Carbon code snippets

Xcode Playgrounds are a great tool for prototyping and trying new concepts. Oftentimes we want to share some Swift snippets; for this, Carbon is a cool tool, and nef integrates seamlessly with it. You can take your nef Playground, write several pieces of code and keep it verified. Later you can export all your code snippets, with the following command:

 ➜ nef carbon --project <nef playground> --output <path>



You can customize the output with the next commands

Command Description Format Options Default
--background Background color applied to image hexadecimal #AABBCC, #AABBCCDD or predefined colors nef bow white green blue yellow orange nef
--theme Carbon's theme to be applied String cobalt blackboard dracula duotone hopscotch lucario material monokai nord oceanicNext oneDark panda paraiso seti purple solarized tomorrow twilight verminal vscode zenburn dracula
--size Export file dimensions Number [1, 5] 2
--font Font type String firaCode hack inconsolata iosevka monoid anonymous sourceCodePro darkMono droidMono fantasqueMono ibmPlexMono spaceMono ubuntuMono firaCode
--show-lines shows/hides number of lines in code snippet Bool true false true
--show-watermark shows/hides watermark in code snippet Bool true false true

You can find an example of use in the section How to export my snippets?