include code sections in your Joomla 1.5 content |
The CodeCitation plugin allows you to include code sections in your Joomla! 1.5 content using {codecitation} tag.Use of the {codecitation} tag allows you to work with code sections in your Joomla WYSIWYG editors. The plugin supports syntax highlighting for bash, shell, csharp, cpp, c, css, delphi, pascal, diff, patch, groovy, javascript, java, perl, php, python, rails, ruby, scala, sql, vb, vbnet, xml, xhtml, xslt, html, xhtml Using the plugin: The syntax for the usage is: {codecitation class="<parameters for SyntaxHighlight engine>)" width="<width>"} CODE TO HIGHTLIGHT {/codecitation} where: <parameters for SyntaxHighligh engine> is a parameter string for the engine - see http://alexgorbatchev.com/wiki/SyntaxHighlighter:Configuration#Parameters <width> is an optional parameter to specify <div> width (fix code in some cases into your template)
Recommended settings for JCE (Joomla! Content Editor) WYSIWYG Editor: To make your life copy/pasting code into your articles easier, and preserve indentation in the code (otherwise JCE will delete extra whitespaces and break your code visual structure), we recommend to do the following: In Cleanup section of JCE Editor Setup of Joomla! backend set Cleanup HTML parameter value to "Yes" and Entity encoding parameter value to "named". Examples: In the following examples the codecitation tags are bold to make it possible to show you the example source :-) Do not use formatting in real life inside codecitation tag. Example 1: {codecitation class="brush: xml; gutter: false;" width="500px"}
<company>
<name>ACME</name>
<address>Address example</address>
</company>
{/codecitation} Result: view source print? 1.<company> 2. <name>ACME</name> 3. <address>Address example</address> 4.</company>
|