8

Take Beautiful Screenshots of Your Code in VS Code

 2 years ago
source link: https://joets.medium.com/take-beautiful-screenshots-of-your-code-in-vs-code-88a68864dee
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Responses

There are currently no responses for this story.

Be the first to respond.

You have 2 free member-only stories left this month.

Take Beautiful Screenshots of Your Code in VS Code

Impress your audiences and Improve Understandability

Photo by Roman Synkevych 🇺🇦 on Unsplash

Sharing your code with beautiful screenshots can impress your audiences and improve understandability. This article curates two VS Code extensions to help you create a beautiful screenshot of your code. If you use VS Code to code your program, it is very easy to use an extension to take a screenshot of your code with your selected color theme, supporting all programming languages which VS Code does.

This is an example from one of my scripts from another Python article.

From This (Default Code Snippet in Medium): 😒

def main():
df = pd.read_html('https://www.stuttgart-airport.com/security-wait-times/')
df = df[0] # Get First table
df['Wait times'] = df['Wait times'].str.replace(r'\D', '')
df['Wait times'] = pd.to_numeric(df['Wait times'], errors='coerce').astype('float')
df = df.set_index('Terminal').T

Into This: 👌

Looks much better, right?

Let’s get started!

CodeSnap

(300K+ Installed)
So far, the CodeSnap extension is my favorite tool to create a screenshot with its simplicity. After installation, you can just drag to select your code where you want a screenshot, right-click to open the CodeSnap menu, and click a button to generate a screenshot and save it as PNG locally.

Link to installation:

Basic use of CodeSnap extension

Create a Screenshot with CodeSnap Extension.
  • Selecting Part of Your Code to Screenshot
  • Right-clicking
  • Click “CodeSnap”
  • Click on the CodeSnap logo to export the generated screenshot as an image file.

Polacode

(650K+ installed)

Polacode is quite similar to CodeSnap. However, I found it a little more difficult to use PolaCode because the only way you can start Polacode is by activating it from the Command Palette (Cmd/Ctrl + Shift + P). On the bright side, you can freely resize the snippet container by dragging the lower-right corner.

Demo from PolaCode

Basic use of PolaCode extension

  • Activate Polarcode by using Ctrl + Shift + P
  • Copy Code you want to create a screenshot
  • Paste code into the Polacode view
  • Click on the Polacode logo to export the generated screenshot as an image file.

That’s about it!
I hope you enjoy this article and find it useful for your daily work or projects. Please, feel free to contact me if you have any questions.

Be Safe and Healthy!
Thank you for Reading. 👋😄


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK