The easiest way to create code images

While it’s best to use the actual code text in tech blogs, some platforms don’t natively support syntax highlighting. The best solution in this case is to use pre-highlighted images.

There are plenty of tools that let you do this easily, but I like to…


This content originally appeared on DEV Community and was authored by Brian Morrison II

While it’s best to use the actual code text in tech blogs, some platforms don’t natively support syntax highlighting. The best solution in this case is to use pre-highlighted images.

There are plenty of tools that let you do this easily, but I like to do things with as little effort as possible. In my opinion, using Raycast + the ray.so extension is by far the fastest way to do this!

What is Raycast?

Raycast is a Spotlight replacement for Macs (sorry Windows users) that also supports adding third-party extensions. These extensions add new and interesting capabilities to the search box that displays when you call Raycast using its keybinding.

For example, I have the @todoist extension enabled and now have a list of different commands when I type “Todoist”.

Raycast searching for

Creating code images with the ray.so extension

Ray.so is a great website for creating beautiful images of code, and there is a community extension that adds a command directly into Raycast to create a snapshot of whatever code you have selected.

Installing the extension

You can install the extension by using the “Store” command to search the Raycast extension library.

Raycast searching for

Search for ray.so and install it.

Raycast searching for

Using the extension

To create an image, highlight some code on your computer, open Raycast using your hotkey, and search for “Generate image”.

Raycast searching for

Selecting that will open ray.so with your highlighted code! You can edit the code and export the image once you’re satisfied with the result.

The ray.so website with the higlighted code in it

Customize the extension settings

Ray.so supports a few themes and has a padding setting on the website. You can set default values for these configurations in the Raycast settings.

The Raycast extension settings filtered with ray.so


This content originally appeared on DEV Community and was authored by Brian Morrison II


Print Share Comment Cite Upload Translate Updates
APA

Brian Morrison II | Sciencx (2024-08-07T15:15:56+00:00) The easiest way to create code images. Retrieved from https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/

MLA
" » The easiest way to create code images." Brian Morrison II | Sciencx - Wednesday August 7, 2024, https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/
HARVARD
Brian Morrison II | Sciencx Wednesday August 7, 2024 » The easiest way to create code images., viewed ,<https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/>
VANCOUVER
Brian Morrison II | Sciencx - » The easiest way to create code images. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/
CHICAGO
" » The easiest way to create code images." Brian Morrison II | Sciencx - Accessed . https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/
IEEE
" » The easiest way to create code images." Brian Morrison II | Sciencx [Online]. Available: https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/. [Accessed: ]
rf:citation
» The easiest way to create code images | Brian Morrison II | Sciencx | https://www.scien.cx/2024/08/07/the-easiest-way-to-create-code-images/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.