VSC2I is a Visual Studio Code extension that allows you to convert selected code snippets into images. Customize the image generation with various themes and settings. This extension can be particularly useful for generating visual documentation or sharing code snippets on social media.
Features
Convert selected code snippets to images.
Customize image appearance with themes, backgrounds, padding, and more.
Copy the generated image to the clipboard or save it to disk.
Installation
Install the Extension:
Open VS Code.
Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or pressing Ctrl+Shift+X.
Search for vsc2i and click the Install button.
Usage
Select Text:
Open a file in VS Code.
Highlight the code snippet you want to convert to an image.
Generate Image:
Right-click on the selected text.
Choose Make Image from the context menu.
The extension will process the request and generate an image.
Notification:
You will receive notifications once the image is saved and copied to the clipboard.
Configuration
Configure the extension by adding settings to your settings.json file. You can open this file by navigating to File > Preferences > Settings and searching for vsc2i.
Available Settings
vsc2i.url: URL of the image generation service. (Default: https://joshc2i.vercel.app)
vsc2i.theme: Theme for the generated image. (Default: default)
vsc2i.backgroundImage: URL of the background image. (Default: "")
vsc2i.lineNumbers: Show line numbers in the image. (Default: true)
vsc2i.scale: Scale of the generated image. (Default: 2, Range: 1-5)
vsc2i.backgroundColor: Background color of the image if no background image is applied. (Default: yellow)
vsc2i.showBackground: Show the background in the generated image. (Default: true)
vsc2i.padding: Padding around the text in the image. (Default: 5, Range: 0-15)
vsc2i.imageFolder: Folder where images are saved temporarily. (Default: vsc2i_images)