SmartAss Highlighter - A beautifying plugin for wordpress

SmartAss Highlighter – WordPress Plugin for code syntax highlighting

SmartAss Highlighter is extremely simple and easy to use syntax highlighter for your code. It works for WordPress blogs, only thing you need to add is a Shortcode – [highlighter]
It does not require mentioning of language, Simply add the shortcode to the post you need to highlight. All your previous posts remain unaffected.

Download SmartAss Highlighter


Description

  • SmartAss Highlighter is a simple and easy to use code prettifier for wordpress.
  • The code between <pre> and </pre> tags is highlighted.
  • Almost all languages are supported, no need to mention the code language.
  • Customizable for each post, use [highlighter] shortcode to enable for particular post.
  • To change theme, modify highlighter.css in the plugin directory.
  • Button is available for both editor modes, i.e., Visual and Text editor.
  • Line Numbers are ON by default but can be turned OFF by using modified shortcode [highlighter line=0]

Basic Usage

  1. Switch to Text Only Mode, Go to “Edit my profile” and then check “Disable the visual editor when writing”
  2. Create new post
  3. Put your code in between <pre> and </pre>
  4. MUST use shortcode [highlighter] to activate the SmartAss-Highlighter
  5. Line numbers are on by default, but can be switched off by using [highlighter line=0]
  6. Note: Only the Posts having shortcode [highlighter] will be highlighted. Your previous posts won’t be affected.
  7. Do NOT use html codes for special characters ( &lt; or &gt; ), Directly use < or >

Installation

  1. Download and extract "SmartAss-Highlighter.zip" to "wp-content/plugins/"
  2. Activate the plugin through the “Plugins” menu in WordPress
  3. Put your code in between <pre> and </pre> (It provides a code button in the editor)
  4. MUST use shortcode [highlighter] to activate the SmartAss-Highlighter
  5. Line numbers are on by default, but can be switched off by using [highlighter line=0]

Frequently Asked Questions

Which programming languages are supported?

It supports all programming languages. No need to mention the language of the code anywhere

I don’t like the style and theme colors of this plugin. How to change the colors?

Edit the file highlighter.css to change the colors. See the documentation of CSS and class details at Google Code Prettify

Will this highlighter make my webpage slow?

SmartAss Highlighter uses two files in output- highlighter.js and highlighter.css. These two files have total size of 17KB but If you web server supports compression then the reduced load will be of 7KB. However, If your server does not support compression or you dont have control over it, please edit line 15-18 of plugin page “SmartAss-Highlighter.php” to:

$highlight_js = "http://cdn.justtechthings.com/js/highlighter.js";
$highlight_style = "http://cdn.justtechthings.com/css/highlighter.css";
#$highlight_js = plugins_url('/highlighter.js', __FILE__);
#$highlight_style = plugins_url('/highlighter.css', __FILE__);

Note : By altering the above code, You are actually changing the path of the libraries to pre-hosted files in this server. You can change the path to any valid URL without affecting the functionality of the plugin.

What is different about this highlighter?

  • It uses a shortcode to trigger, so user can control highlighting from post to post.
  • The extra code/libraries are added in footer, so that you page is loaded first and highlighting is done later asynchronously
  • No option menu

Screenshots

  1. Visual editor screenshot
    SmartAss Highlighter button

    SmartAss Highlighter button

  2. Text only editor screenshot
    smartass highlighter button example

    smartass highlighter button example

  3. Sample highlighted output with line numbers
    smartass highlighter output

    smartass highlighter output


Changelog

1.0

  • Initial release

Upgrade Notice

1.0
Initial release

Authors: th3pirat3
Contributors: boliquan
Donate link
Tags: SmartAss, highlighter, wordpress code highlight, wp code, code highlighter, sourcecode, wp prettify, wp code prettify, syntax, javascript, highlight, code, formatting, google code prettify, code button, quicktags, html, xhtml, css, syntax highlighter, google syntax highlighter, code highlighter, code snippet, codecolorer, source, articles, post
Requires at least: 2.7
Tested up to: 4.1
Stable tag: 1.0
License: MIT License

Download SmartAss Highlighter

[highlighter]