Mes essais sur les différents plugins

SyntaxHighlighter

Fournisseur

http://alexgorbatchev.com/SyntaxHighlighter/

Le site n'existe plus. Le plugin n'utilise que du javascript, contrairement à la famile geshi qui elle utilise du php.

 

La syntaxe

<pre class="brush: php;gutter:false;toolbar:false"> $variable = "Ceci est un message test !";</pre>

 

Le résultat

$variable = "Ceci est un message test !";

Site

 Joomler SyntaxHighlighter - Joomla! Extensions Directory

Correctif

J'ai eu un souci sous Internet Explorer

can't find a brush

J'ai fait un correctif dans syntaxhighlighter:

JFactory::getDocument()->addScriptDeclaration($js); 
//added  JFactory::getDocument()->addScript( 'plugins/content/syntaxhighlighter/js/shBrushPhp.js' );
JFactory::getDocument()->addScript( 'plugins/content/syntaxhighlighter/js/shBrushCss.js' );

 

Geshi

La syntaxe

 

<pre xml:lang="javascript" lines="true" > 
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19694431-1']);
_gaq.push(['_trackPageview']);
 
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
 </pre>

 

Attention à bien placer xml:lang juste après la balise pre

Le résultat

  1. var _gaq = _gaq || [];
  2. _gaq.push(['_setAccount', 'UA-19694431-1']);
  3. _gaq.push(['_trackPageview']);
  4.  
  5. (function() {
  6. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  7. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  8. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  9. })();