Dusty Shaw
Dusty Shaw

Reputation: 64

How to display HTML as code formatted for specific programming languages

I came across a website that displayed some SQL code. Inspecting the element, I saw that there was SQL specific classes and styles applied (ex. the table names were blue).

Here is what I saw: html text shown as SQL formatted code

My question is how is this done easily? Is there some front-end package or library that can make code blocks formatted correctly to a certain language like C#, SQL, HTML, etc.?

Upvotes: 0

Views: 82

Answers (1)

btx
btx

Reputation: 2497

The site is using likely highlight.js which is a CSS/JS library that handles code highlighting for many languages.

Upvotes: 1

Related Questions