How to Add Syntax Highlighting to Code on Your Website
ฝัง
- เผยแพร่เมื่อ 22 ก.ย. 2024
- It's easy to add syntax highlighting to any code you wish to embed into your website or existing project. Let me show you how.
Highlight.js:
highlightjs.or...
Available Styles:
github.com/hig...
Supported Languages:
github.com/hig...
🏫 My Udemy Courses - www.udemy.com/...
🎨 Download my VS Code theme - marketplace.vi...
💜 Join my Discord Server - / discord
🐦 Find me on Twitter - / dcodeyt
💸 Support me on Patreon - / dcode
📰 Follow me on DEV Community - dev.to/dcodeyt
📹 Join this channel to get access to perks - / @dcode-software
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
#dcode #web #website
Nice, im using this in my django blog app, works great. thanks!
Highlight JS is great. It helped me add syntax highlighting to my Next JS blog few weeks ago.
Can you share the link of your blog?
Awesome video
helpful video. thank you verymuch
Amazinggg 👏 thanks!
Thx lots dude, exactly what I was trying to do!!
Thanks a lot
What about for Python in Django? This work for that?
Thanks a lot!!!!
Thanks!
NOTE: I tried it and it didn’t work for me at first, and it is because had to add "https:" to the href value of the link element and the script. Because it is missing in the documentation as we would normally just copy (they're just putting the path without https:).
thanks!
How about React applications? How to turn this into React components?
How to add some function like copy to clipboard, and dark mode...
Thanks you very much ..@dcode
Nice!!
I cannot get the cdnjs code anywhere on the website. Where is it? Please someone help me out.
Awesome
But how do you add the code in the first place?
Hii @decode, whenever I'm including the libraries in my code like this(#include) so in the output screen it's showing like this(#include) only. All the content of the line after < is now showing. So how I can fix this.
You need to replace all "" to ">" because HTML thinks that is a HTML element
What if i want to do this in react?
This tech stopped working sadly
You gotta look for it, I forgot how I did it but it still works it’s just in a different part of the website
on my code the code dont add line break. do we need to add manually?
mine:
let a = b; console.log(a);
expected:
let a = 1;
console.log(a);