Prism
is a lightweight, extensible syntax highlighter,
built with modern web standards in mind.
CDN:
<link href="https://webhoanhaocdn.firebaseapp.com/prism/1.9.0/prism.css" rel="stylesheet" />
<script src="https://webhoanhaocdn.firebaseapp.com/prism/1.9.0/prism.js" ></script>
Basic usage:
<pre><code class="language-css">p { color: red }</code></pre>
Features
Dead simple
Include prism.css
and prism.js
, use proper HTML5 code tags (code.language-xxxx
), done!
Intuitive
Language classes are inherited so you can only define the language once for multiple code snippets.
Light as a feather
The core is 2KB minified & gzipped. Languages add 0.3-0.5KB each, themes are around 1KB.
Blazing fast
Supports parallelism with Web Workers, if available.
Extensible
Define new languages or extend existing ones. Add new features thanks to Prism’s plugin architecture.
Easy styling
All styling is done through CSS, with sensible class names like .comment
, .string
, .property
etc