JavaScript by Roger

Prism

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind.

Prism (prismjs.com)

...see more
  • Only 2KB minified & gzipped (core). Each language definition adds roughly 300-500 bytes.
  • The language-xxxx class is inherited. This means that if multiple code snippets have the same language, you can just define it once,in one of their common ancestors.
  • Very easy to extend without modifying the code, due to Prism’s plugin architecture. Multiple hooks are scattered throughout the source.
  • Very easy to define new languages. The only thing you need is a good understanding of regular expressions.
  • All styling is done through CSS, with sensible class names rather than ugly, namespaced, abbreviated nonsense.
  • Wide browser support: Edge, IE11, Firefox, Chrome, Safari, Opera, most mobile browsers.
  • Highlights embedded languages (e.g. CSS inside HTML, JavaScript inside HTML).
  • Highlights inline code as well, not just code blocks.
  • It doesn’t force you to use any Prism-specific markup, not even a Prism-specific class name, only standard markup you should be using anyway. So, you can just try it for a while, remove it if you don’t like it and leave no traces behind.
...see more

Plugins are additional scripts (and CSS code) that extend Prism’s functionality.

Comments