惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

6Jyc5p+a

【笔记】HermesAgent学习笔记 【笔记】DeepSeekHarness学习笔记 【笔记】Rollup的PluginBabel插件 【笔记】Rollup学习笔记 【笔记】Gulp的BrowserSync插件 【笔记】Node-SSH学习笔记 【笔记】Tapable学习笔记 【笔记】Marked学习笔记 【笔记】Webpack通过schema-utils实现Loader参数校验 【笔记】Webpack实现TreeShaking 【笔记】Webpack的WebpackBundleAnalyzer插件 【代码】校验信用卡号码 【笔记】Webpack的SpeedMesureWebpackPlugin插件 【笔记】Codex配置Brave浏览器的MCP 【笔记】Webpack的CSSMinimizerWebpackPlugin插件 【笔记】FastNodeManager学习笔记 【笔记】Terser学习笔记 【笔记】Codex配置Wireshark的MCP 【笔记】Codex配置Unity的MCP 【笔记】Codex配置Blender的MCP 【笔记】Codex配置IDEA的MCP 【笔记】Browserslist学习笔记 【笔记】Codex学习笔记 【笔记】MicrosoftStore微软商店学习笔记 【笔记】通过NapCat和AstrBot实现QQ机器人 【笔记】部署NapCat 【笔记】部署AstrBot 【笔记】Poetry学习笔记 【笔记】uv学习笔记 【笔记】Nodejs通过mysql2操作MySQL数据库
【笔记】Highlight.js学习笔记
57uv6Z6g · 2026-08-12 · via 6Jyc5p+a

发表于 更新于 阅读次数:

前言

Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty much any markup, doesn’t depend on any other frameworks, and has automatic language detection.(Github

下载依赖

1
npm install -D highlight.js

渲染代码高亮

1
import "highlight.js/styles/default.css";

完成