SyntaxHighlight GeSHi

From Wikipedia!
Jump to: navigation, search

Testing the Extension:SyntaxHighlight GeSHi extension.

Examples[edit]

Normal pre, no extension
if (blah) {
   // stuff
}
Basic example (pre mode)
if (blah) {
   // stuff
}
Div mode
if (blah) {
   // stuff
}
Light on black may be easier to read than light on white - dark on light may be better.
if (blah) {
   // stuff
}
if (blah) {
   // stuff
}
if (blah) {
   // stuff
}
if (blah) {
   // stuff
}
if (blah) {
   // stuff
}
Line numbered (forces div mode)
1 if (blah) {
2    // stuff
3 }
Line numbered with offset
20 if (blah) {
21    // stuff
22 }
Non-strict
$x = 'y';
<?php
$x = 'y';
?>
Strict
$x = 'y';
<?php
$x = 'y';
?>
INSERT into arsearch2 (Findindex,Word,Src,session) SELECT STRAIGHT_JOIN ind0.Findindex,ind0.Subject,ind0.Src,25765 
FROM arindex as ind0 ,arindex as ind1,arindex as ind2 
WHERE ind0.Subject='WIRING' 
AND ind1.Subject='DIAGRAM' 
AND ind2.Subject='LUCAS' 
AND ind0.FindIndex=ind1.FindIndex 
AND ind0.FindIndex=ind2.FindIndex 
AND ind0.Src=ind1.Src 
AND ind0.Src=ind2.Src
Long lines, yuck.
                        try:
                            self._site = getSite(otherlang, familyName)
                        except ValueError:
                            raise NoPage('%s is not a local page on %s, and the %s family is not supported by PyWikipediaBot!' % (title, self.site(), familyName
))

More examples[edit]

BNF[edit]

<postal-address> ::= <name-part> <street-address> <zip-part>

     <name-part> ::= <personal-part> <last-name> <opt-jr-part> <EOL> 
                   | <personal-part> <name-part>

 <personal-part> ::= <first-name> | <initial> "." 

<street-address> ::= <opt-apt-num> <house-num> <street-name> <EOL>

      <zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL>

Diff[edit]

Context format[edit]

*** /path/to/original ''timestamp''
--- /path/to/new      ''timestamp''
***************
*** 1,3 ****
--- 1,9 ----
+ This is an important
+ notice! It should
+ therefore be located at
+ the beginning of this
+ document!
+
  This part of the
  document has stayed the
  same from version to
***************
*** 5,20 ****
  be shown if it doesn't
  change.  Otherwise, that
  would not be helping to
! compress the size of the
! changes.
!
! This paragraph contains
! text that is outdated.
! It will be deleted in the
! near future.

  It is important to spell
! check this dokument. On
  the other hand, a
  misspelled word isn't
  the end of the world.
--- 11,20 ----
  be shown if it doesn't
  change.  Otherwise, that
  would not be helping to
! compress anything.

  It is important to spell
! check this document. On
  the other hand, a
  misspelled word isn't
  the end of the world.
***************
*** 22,24 ****
--- 22,28 ----
  this paragraph needs to
  be changed.  Things can
  be added after it.
+
+ This paragraph contains
+ important new additions
+ to this document.

Unified format[edit]

--- original ''timestamp''
+++ new      ''timestamp''
@@ -1,3 +1,9 @@
+This is an important
+notice! It should
+therefore be located at
+the beginning of this
+document!
+
 This part of the
 document has stayed the
 same from version to
@@ -5,16 +11,10 @@
 be shown if it doesn't
 change.  Otherwise, that
 would not be helping to
-compress the size of the
-changes.
-
-This paragraph contains
-text that is outdated.
-It will be deleted in the
-near future.
+compress anything.

 It is important to spell
-check this dokument. On
+check this document. On
 the other hand, a
 misspelled word isn't
 the end of the world.
@@ -22,3 +22,7 @@
 this paragraph needs to
 be changed.  Things can
 be added after it.
+
+This paragraph contains
+important new additions
+to this document.

INI[edit]

[section1]

; some comment on section1
var1 = abc
var2 = 451
 
[section2]

; another comment
var1 = 123
var2 = dfg