| Install the downloaded zip file using Joomla!'s extensions installer. Go to Extensions -> Extension Manager, then under Upload Package File click on Browse, and select the zip file, and click Upload & Install. If upgrading from a previous version, it is normally safe to simply install it as usual over the top of the existing plugin. First, however, check the board for Smart Highlighter in the forum to see if there are any upgrade instructions for your specific version. If installing over the top of an existing previous version, open the plugin settings page and click on save, even if you haven't changed any settings. This makes sure that the database is up to date with any new or changed settings in the new version. Once installed, the plugin must be enabled. Under Extensions -> Plugin Manager, look for Content - Smart Highlighter, and either click on the red circle, or open the plugin's settings page and select Enabled. Adding Code to an ArticleOnce the Smart Highlighter plugin is enabled, the only further step required is to enter your code sample into an article. You may need to toggle on source code view, depending on which article editor you are using. Enter in a pre block, with a class attribute that indicates the programming language of your code sample. Within the pre start and end tag, enter your code sample. Note that in order for this to work all < and > characters in your code sample need to be converted to their html-escaped equivalents < and >. The paid version of Smart Highlighter contains a code conversion tool in it's plugin settings page that can perform this conversion for you at the click of a button. Here are a couple of examples. First is the html as entered into the article, next is that html displayed using Syntax Highlighter (v2) as loaded by Smart Highlighter on this page. <pre class="brush: php">
function myFunc($arg)
{
return $arg + 1;
}
</pre>
function myFunc($arg)
{
return $arg + 1;
}
Note here that the conversion of all < and > to < and > can be done instantly using this plugin's Code Converter (paid version, see below). <pre class="brush: xml; gutter: false">
<files>
<filename plugin="smarthighlighter">smarthighlighter.php</filename>
<filename>index.html</filename>
<folder>language</folder>
<folder>syntaxhighlighter2</folder>
<folder>syntaxhighlighter3</folder>
<folder>formfields</folder>
</files>
</pre>
<files>
<filename plugin="smarthighlighter">smarthighlighter.php</filename>
<filename>index.html</filename>
<folder>language</folder>
<folder>syntaxhighlighter2</folder>
<folder>syntaxhighlighter3</folder>
<folder>formfields</folder>
</files>
Smart Highlighter's settings page also contains a listing of all possible language aliases, and Syntax Highlighter options, for easy reference. Plugin SettingsBasic Options
Global Config (v2.x) (Paid version only)
Global Config (v3.x) (Paid version only)
Global Defaults
CSS Options (Paid version only)
Note that clicking on any of these text boxes opens a convenient colour picker in Joomla! 2.5.
Code Converter (Paid version only)
Use this tool to convert < and > to < and >. Enter your source code in the first text area, click Convert, and the second text area will contain the converted code for you to paste directly into your article. |
|
Smart Highlighter - Technical Overview
|





