Diff: Help/SyntaxHighlighterPlugin

Differences between current version and predecessor to the previous major change of Help/SyntaxHighlighterPlugin.

Other diffs: Previous Revision, Previous Author

Newer page: version 6 Last edited on 17 January 2022 3:00 by harold
Older page: version 5 Last edited on 9 September 2007 0:16 by harold Revert
@@ -1,50 +1,87 @@
-The ~SyntaxHighlighter plugin passes all its arguments through a C++  
-highlighter called " highlight" (available at http://www.andre-simon.de/)
+The ** ~SyntaxHighlighter** [[Help:WikiPlugin| plugin]] will highlight source  
+code in a variety of languages
  
-Author : alecthomas  
+Highlighting is done in Javascript with [[http ://highlightjs.org/]].  
  
-! Arguments  
-syntax |  
- (required) , See http://www.andre-simon.de/doku/highlight/highlight.html  
-style |  
- ~[ "ansi", "gnu", "kr", "java", "linux" ~] (required)  
-color |  
- null (optional), see =highlight/themes=  
-number |  
- 0 (optional)  
-wrap |  
- 0 (optional)  
+Recognized languages are the following:  
+| Apache | Bash | C# | C++  
+| CSS | ~CoffeeScript | Diff | HTML , XML  
+| HTTP | Ini | JSON | Java  
+| ~JavaScript | Makefile | Markdown | Nginx  
+| Objective C | PHP | Perl | Python  
+| Ruby | SQL  
  
+== Arguments ==  
  
-! Example  
+None.  
  
-<verbatim>  
- <?plugin SyntaxHighlighter syntax =c style =kr color =emacs  
+The source code is put between {{{ <<SyntaxHighlighter}}} and {{{>>}}}.  
+  
+ == Example ==  
+  
+{{{  
+<<SyntaxHighlighter  
  #include <stdio.h> 
  
  int main() { 
- printf("Lalala\n"); 
+ printf("Lalala\n"); 
 
-? >  
-</verbatim
+>>  
+}}}  
  
-=>  
+will give:  
  
-<?plugin SyntaxHighlighter syntax=c style=kr color=emacs  
+<< SyntaxHighlighter 
  #include <stdio.h> 
  
  int main() { 
- printf("Lalala\n"); 
+ printf("Lalala\n"); 
 
-?
+>>  
+  
+== History ==  
+  
+The first implementation of this plugin passed all its arguments through a C++  
+highlighter called "highlight" (available at [[http://www.andre-simon.de]]).  
+  
+This implementation allowed the following arguments, which are now ignored.  
+  
+=== Former Arguments ===  
+  
+{| class="bordered"  
+|-  
+! Argument  
+! Description  
+! Default value  
+|-  
+| **syntax**  
+|  
+| //None// (required argument), see http://www.andre-simon.de/doku/highlight/highlight.html  
+|-  
+| **style**  
+|  
+| ~[ "ansi", "gnu", "kr", "java", "linux" ~] (required)  
+|-  
+| **color**  
+|  
+| null (optional), see ##highlight/themes##  
+|-  
+| **number**  
+|  
+| 0 (optional)  
+|-  
+| **wrap**  
+|  
+| 0 (optional)  
+|}  
+  
+== Authors ==  
  
-I did not use beautifier, because it used up more than 8M of memory on  
-my system and PHP killed it. I'm not sure whether this is a problem  
-with my integration , or with beautifier itself.  
+* alecthomas  
+* Fixes by [[Help:Reini Urban|Reini Urban]]  
+* Re-implementation with [[http://highlightjs.org/]] by Alain Peyrat and Marc-Etienne Vargenau , Alcatel-Lucent  
  
-Fixes by Reini Urban:  
-* support options: syntax, style, color.  
-* php version switch  
-* HIGHLIGHT_DATA_DIR, HIGHLIGHT_EXE constants  
+<noinclude>  
 ---- 
-PhpWikiDocumentation Help:WikiPlugin  
+[[ PhpWikiDocumentation]] [[CategoryWikiPlugin]]  
+</noinclude>  

current version

The SyntaxHighlighter plugin will highlight source code in a variety of languages.

Highlighting is done in Javascript with http://highlightjs.org/.

Recognized languages are the following:

Apache Bash C# C++
CSS CoffeeScript Diff HTML, XML
HTTP Ini JSON Java
JavaScript Makefile Markdown Nginx
Objective C PHP Perl Python
Ruby SQL

Arguments

None.

The source code is put between <<SyntaxHighlighter and >>.

Example

<<SyntaxHighlighter
 #include <stdio.h>

 int main() {
     printf("Lalala\n");
 }
>>

will give:


#include <stdio.h>

 int main() {
     printf("Lalala\n");
 }

History

The first implementation of this plugin passed all its arguments through a C++ highlighter called "highlight" (available at http://www.andre-simon.de).

This implementation allowed the following arguments, which are now ignored.

Former Arguments

Argument

Description

Default value

syntax

None (required argument), see http://www.andre-simon.de/doku/highlight/highlight.html

style

[ "ansi", "gnu", "kr", "java", "linux" ] (required)

color

null (optional), see highlight/themes

number

0 (optional)

wrap

0 (optional)

Authors