Simple, lightweight plugin that integrates the Prism.js syntax highlighter into WordPress
I wasn't really happy with the few Prism.js WordPress plugins I tried so I decided to put together a quick plugin with the functionality I wanted.
This WordPress plugin depends on PrismJs by Lea Verou for the actual syntax highlighting. The plugin includes the default PrismJs javascript/css as well as an alternate set of javascript/css with additional language support and functionality
The default PrismJs JavaScript and CSS are included in prism.js and prism.css. The CSS files are for the default theme. The supported languages are:
- Markup
- CSS
- C-like
- JavaScript
No plugins are included in the default JavaScript/CSS.
The included custom PrismJs JavaScript and CSS are contained in prism-custom.js and prism-custom.css. These files include a slightly modified default theme. The supported languages are:
- Markup
- CSS
- C-like
- JavaScript
- ASP.NET
- Bash
- CSharp (C#)
- HTTP
- JSON
- Markdown
- PHP
- PHP-Extras
- Python
- Sass (SCSS)
- SQL
- TypeScript
- YAML
The following plugins are included in the custom JavaScript/CSS:
- Line Highlight
- Line Numbers
- Autolinker
- File Highlight
- Show Language
- Command Line
The user may also use their own customized PrismJS Javascript and CSS set. Simply place the custom .js file in the plugin's js
directory and place the custom css file in the css
directory. Then specify the names of the custom files in the WordPress PrismJs settings (Settings -> Prism.js).