Powershell syntax highlighting for your blog or website

I've added a Powershell syntax file to my online HTML syntax highlighter.

You can now produce this kind of thing:

  1. # Factorial  
  2. # Syntax File Demo  
  3. # Simon Hudson 14/10/2006 - 17/7/2007  
  4.   
  5. param([string]$num)  
  6. if (-not $num)  
  7. {  
  8.     "Factorial PowerShell Demo"  
  9.     "========================="  
  10.       
  11.     Write-Output "Usage:`n`tfactorial <number>"  
  12.       
  13.     return  
  14. }  
  15.       
  16. function factorial([int]$x)  
  17. {  
  18.     if ($x -eq 1)  
  19.         { return 1 }  
  20.     else  
  21.         { return $x * (factorial ($x - 1)) }  
  22. }  
  23.   
  24. factorial $num  


You can play with the Beta highlighter here.

Comments

Beben Koben said…
it's interesting, permition for promote your tool my friend^^
cheers...^^

Popular Posts