DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:syntaxhighlighter2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:syntaxhighlighter2 [2011-11-21 12:47] 138.215.255.66plugin:syntaxhighlighter2 [2020-06-04 16:33] (current) StarArmy
Line 7: Line 7:
 type       : Action, Syntax type       : Action, Syntax
 lastupdate : 2010-07-05 lastupdate : 2010-07-05
-compatible : 2009-02-14+compatible : !Hogfather
 depends    :  depends    : 
 conflicts  : syntaxhighlighter3 conflicts  : syntaxhighlighter3
 similar    : code, code2, code3, syntaxhighlighter, syntaxhighlighter3 similar    : code, code2, code3, syntaxhighlighter, syntaxhighlighter3
-tags       : code, highlight, syntax+tags       : code, syntaxhighlight, syntax
  
-downloadurl: http://github.com/downloads/bddali/dokuwiki-plugin-syntaxhighlighter2/syntaxhighlighter2.tar.gz+downloadurl: no longer available
 ---- ----
 ===== Download and Installation ===== ===== Download and Installation =====
  
-:!: **Plugin is not actively maintained (unless someone else takes over), please use [[:plugin:syntaxhighlighter3|SyntaxHighlighter 3]] instead.**+:!: **Plugin has been discontinued, please use [[:plugin:syntaxhighlighter3|SyntaxHighlighter 3]] or [[:plugin:syntaxhighlighter4|SyntaxHighlighter 4]] instead.**
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually. 
- 
-The subfolder sxh2 contains a complete (and untouched) distribution of SyntaxHighlighter 2.1.364. 
- 
-**screenshot** 
- 
-{{http://img87.imageshack.us/img87/92/syntaxhighlighter2.png|}} 
-===== Syntax and Usage ===== 
- 
-Client side syntax highlighter (with copy to clipboard functionality) based on [[plugin:SyntaxHighlighter|SyntaxHighlighter Plugin]] by David Shin. Main differences: 
- 
-  * Updated to use version 2.1.364 of [[http://alexgorbatchev.com/wiki/SyntaxHighlighter|SyntaxHighlighter]] by Alex Gorbatchev. 
-  * Does not use <nowiki><code></nowiki> tags, enables parallell use with DokuWikis own server side syntax highlighter (GeSHi). 
- 
-Usage:\\ 
-<code text> 
-<sxh [brush alias][; options for SyntaxHighlighter]> 
-... code/text ... 
-</sxh> 
-</code> 
- 
-**//brush alias//** - The brush alias (language) that SyntaxHighlighter should use. Defaults to "text" if none is provided. See [[http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes|SyntaxHighlighter Brushes]] for a complete list of available brushes. Add new brushes to the scripts directory and the file name to $brushes in action.php, see [[#plugin_structure|plugin structure]].\\ 
-\\ 
-**//options//** - Semicolon separated options for SyntaxHighlighter, see [[http://alexgorbatchev.com/wiki/SyntaxHighlighter:Configuration#SyntaxHighlighter.defaults|SyntaxHighlighter Configuration]].\\ 
- 
-Example: 
-<code text> 
-<sxh php; first-line: 5; highlight: [10,11,12,13]; wrap-lines: true> 
-function render($mode, &$renderer, $data) { 
-  
-    if ($mode == 'xhtml') { 
-        if (count($data) == 3) { 
-            list($syntax, $attr, $content) = $data; 
-            if ($syntax == 'sxh') 
-                $renderer->doc .= "<pre class=\"brush: ".$attr."\">".$renderer->_xmlEntities($content)."</pre>"; 
-            else 
-                $renderer->file($content); 
-        } 
-        return true; 
-    } 
-    return false; 
-} 
-</sxh> 
-</code> 
- 
-==== Copy to clipboard ==== 
- 
-Hover mouse pointer over the code, a toolbar pops up with four buttons, the second is "copy to clipboard". 
- 
-Tool tips and dialog texts can be modified but require code changes, see [[http://alexgorbatchev.com/wiki/SyntaxHighlighter:Configuration:strings|SyntaxHighlighter strings]]. 
- 
-===== Plugin structure ===== 
- 
-These files and directories are included in the plugin: 
-<code text> 
-syntaxhighlighter2/ 
-|-- action.php 
-|-- sxh2 
-|   |-- LGPLv3.txt 
-|   |-- scripts 
-|     |-- clipboard.swf 
-|     |-- shBrushAS3.js 
-|     |-- shBrushBash.js 
-|     |-- shBrushCSharp.js 
-|     |-- shBrushColdFusion.js 
-|     |-- shBrushCpp.js 
-|     |-- shBrushCss.js 
-|     |-- shBrushDelphi.js 
-|     |-- shBrushDiff.js 
-|     |-- shBrushErlang.js 
-|     |-- shBrushGroovy.js 
-|     |-- shBrushJScript.js 
-|     |-- shBrushJava.js 
-|     |-- shBrushJavaFX.js 
-|     |-- shBrushPerl.js 
-|     |-- shBrushPhp.js 
-|     |-- shBrushPlain.js 
-|     |-- shBrushPowerShell.js 
-|     |-- shBrushPython.js 
-|     |-- shBrushRuby.js 
-|     |-- shBrushScala.js 
-|     |-- shBrushSql.js 
-|     |-- shBrushVb.js 
-|     |-- shBrushXml.js 
-|     |-- shCore.js 
-|     `-- shLegacy.js 
-|   |-- src 
-|     |-- shCore.js 
-|     `-- shLegacy.js 
-|   |-- styles 
-|     |-- help.png 
-|     |-- magnifier.png 
-|     |-- page_white_code.png 
-|     |-- page_white_copy.png 
-|     |-- printer.png 
-|     |-- shCore.css 
-|     |-- shThemeDefault.css 
-|     |-- shThemeDjango.css 
-|     |-- shThemeEclipse.css 
-|     |-- shThemeEmacs.css 
-|     |-- shThemeFadeToGrey.css 
-|     |-- shThemeMidnight.css 
-|     `-- shThemeRDark.css 
-|   `-- test.html 
-`-- syntax 
-    `-- code.php 
-</code> 
-===== Known issues ===== 
- 
-  * <del>Does not look good in Mozilla Firefox, looks great in Internet Explorer 8. SyntaxHighlighter examples (tested outside DokuWiki) look like they should in Firefox. The problem seems to be a combination of stylesheets, Firefox and DokuWiki. Could be an easy fix, but I don't know.</del> Turns out it really was an easy fix, removing 'title' attribute for SyntaxHighlighter's CSS stylesheets in action.php solved the problem. 
-  * Requires Flash for copy to clipboard functionality. :!: [[:plugin:syntaxhighlighter3|SyntaxHighlighter 3]] does not use Flash. 
-===== Discussions ===== 
-I installed the plugin as of 2010-06-29, but it doesn't work correctly. The line numbers and toolbar are displayed, so I guess the plugin is loaded at least. But it does not highlight any code. I tried with a different theme in action.php, but it does not make any effect. What's wrong? 
- 
---- First of all, have you read "known issues" above? Secondly, you have to provide information about browser used and DokuWiki version. 
- 
---- 2010-07-05: If the problem was Firefox/Chrome related, it has been fixed. Remove old plugin and download again using link on top of this page. 
plugin/syntaxhighlighter2.1321876051.txt.gz · Last modified: 2011-11-21 12:47 by 138.215.255.66

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki