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”.
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.
Search for ray.so and install it.
Using the extension
To create an image, highlight some code on your computer, open Raycast using your hotkey, and search for “Generate image”.
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.
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.
This content originally appeared on DEV Community and was authored by Brian Morrison II
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.