CC-Syntax-Highlight
The CC-Syntax-Highlight plugin supports syntax highlighting of Posts, Pages, and any public Custom Post Types. It uses highlight.js or google-code-prettify libraries. Additionally it can use the clipboard.js library to add a button that copies text to the clipboard and highlightjs-line-numbers.js pl
The CC-Syntax-Highlight plugin supports syntax highlighting of Posts, Pages, and any public Custom Post Types. It uses highlight.js or google-code-prettify libraries. Additionally it can use the clipboard.js library to add a button that copies text to the clipboard and highlightjs-line-numbers.js plugin to add line numbers. It is delivered with support for shortcode (default [code] – you can change it on the settings page) which automatically converts all special characters to HTML entities. This plugin is compatible with Multisite WordPress installations.
How does it work?
- 01Go to the ‘Settings > Syntax Highlight’ page, select your preferred options and save them.
- 02Simply add the source code to your post (or other selected public Custom Post Type) wrapped with: <pre><code>Your source code</code></pre> or if you would like to automatically convert all special characters to HTML entities, use shortcode wrapper instead (default [code] – you can change it on the settings page): <pre>[code]Your source code[/code]</pre>
Plugin’s js scripts and css styles files only load if the source code occurs on displaying page.
A closer look.
From your WordPress Dashboard
- 01Go to ‘Plugins > Add New’
- 02Search for ‘CC-Syntax-Highlight’
- 03Activate the plugin from the Plugin section on your WordPress Dashboard.
From WordPress.org
- 04Download ‘CC-Syntax-Highlight’.
- 05Upload the ‘cc-syntax-highlight’ directory to your ‘/wp-content/plugins/’ directory using your favorite method (ftp, sftp, scp, etc…)