— The VS Code Compatible Syntax Highlighting API.


Sometimes your code contains URLs to other supporting documentation. It's a nice experience for the reader if those urls were actually links instead of having to copy-paste them.

It's a little thing, but Torchlight sweats the little things so you don't have to.

Using the autolink annotation, Torchlight will look for URLs and turn them into links for you.

2 * @see [tl! autolink]
3 */
5$link = '' // [tl! autolink]
3 */

The resulting link will look like this (color will change depending on your theme):

1<a target="_blank"
2 rel="noopener"
3 class="torchlight-link"
4 style="color: #032F62;"
5 href=""></a>

(Line breaks added for readability.)

Torchlight adds a torchlight-link class, and rel + target attributes.

The rel=noopener attribute ensures that no a malicious website doesn't have access to the window.opener property. Although this is less of a concern now with modern browsers, we still want you to be covered.

Read more about rel=noopener at


Your URL must start with one of the following in order to match:

  • http:
  • https:
  • www.


The autolink annotation supports the entire set of range modifiers to help you quickly annotate a whole set of lines.

Check out the range docs for more details, but here is a quick cheat sheet.

1autolink -- This line only
3autolink:start -- The start of an open ended range
4autolink:end -- The end of an open ended range
6autolink:10 -- This line, and the 10 following lines
7autolink:-10 -- This line, and the 10 preceding lines
9autolink:1,10 -- Start one line down, highlight 10 lines total
10autolink:-1,10 -- Start one line up, highlight 10 lines total
A Hammerstone, LLC Product.
Built with Love & Care by Aaron in Dallas, Texas.