Difference between revisions of "Syntax Highlighting Examples"
Jump to navigation
Jump to search
Rand Linden (talk | contribs) (New page: == PHP Test == Text before code. <source lang="php"> <?php $v = "string"; // sample initialization ?> html text <? echo $v; // end of php code ?> </source> Text after ...) |
Rand Linden (talk | contribs) |
||
Line 1: | Line 1: | ||
== PHP | This extension enables including code with syntax highlighting. You can use the following tags: | ||
<pre> | |||
"actionscript-french", "actionscript", "ada", "apache", "applescript", | |||
"asm", "asp", "bash", "c", "caddcl", "cadlisp", "cpp", "csharp", | |||
"css", "c_mac", "d", "delphi", "diff", "dos", "eiffel", | |||
"freebasic", "gml", "html4strict", "ini", "inno", "java", "javascript", | |||
"lisp", "lua", "matlab", "mpasm", "nsis", "objc", "ocaml-brief", | |||
"ocaml", "oobas", "oracle8", "pascal", "perl", "php-brief", "php", | |||
"python", "qbasic", "ruby", "scheme", "sdlbasic", "smarty", "sql", | |||
"vb", "vbnet", "vhdl", "visualfoxpro", "xml"); | |||
</pre> | |||
== PHP == | |||
Text before code. | Text before code. | ||
< | <php><?php | ||
<?php | |||
$v = "string"; // sample initialization | $v = "string"; // sample initialization | ||
?> | ?> | ||
Line 9: | Line 21: | ||
<? | <? | ||
echo $v; // end of php code | echo $v; // end of php code | ||
?> | ?> </php> | ||
</ | |||
Text after code. | Text after code. | ||
== Python | == Python == | ||
Text before code. | Text before code. | ||
< | <python> # Hello World in Python | ||
def main(): | def main(): | ||
Line 23: | Line 33: | ||
if __name__ == '__main__': | if __name__ == '__main__': | ||
main() | main()</python> | ||
</ | |||
Text after code. | Text after code. | ||
== | == C++ == | ||
Text before code. | Text before code. | ||
< | <cpp>#include <iostream> | ||
#include <iostream> | |||
int main(int argc, char** argv) | int main(int argc, char** argv) | ||
Line 51: | Line 46: | ||
std::cout << "hai, can i haz c++ nao?" << std::endl; | std::cout << "hai, can i haz c++ nao?" << std::endl; | ||
return 0; | return 0; | ||
} | }</cpp> | ||
</ | |||
Text after code. | Text after code. | ||
== HTML | == HTML == | ||
Text before code. | Text before code. | ||
< | <html4strict><h1>OMG Look at This</h1> | ||
<h1>OMG Look at | <p class="youknowsit">Wait where did he get that penguin from?</p></html4strict> | ||
<p class="youknowsit">Wait where did he get that penguin from</p> | |||
</ | |||
Text after code. | Text after code. |
Revision as of 12:48, 18 May 2009
This extension enables including code with syntax highlighting. You can use the following tags:
"actionscript-french", "actionscript", "ada", "apache", "applescript", "asm", "asp", "bash", "c", "caddcl", "cadlisp", "cpp", "csharp", "css", "c_mac", "d", "delphi", "diff", "dos", "eiffel", "freebasic", "gml", "html4strict", "ini", "inno", "java", "javascript", "lisp", "lua", "matlab", "mpasm", "nsis", "objc", "ocaml-brief", "ocaml", "oobas", "oracle8", "pascal", "perl", "php-brief", "php", "python", "qbasic", "ruby", "scheme", "sdlbasic", "smarty", "sql", "vb", "vbnet", "vhdl", "visualfoxpro", "xml");
PHP
Text before code. <php><?php
$v = "string"; // sample initialization
?> html text <?
echo $v; // end of php code
?> </php> Text after code.
Python
Text before code. <python> # Hello World in Python
def main(): print "Hello World!" if __name__ == '__main__': main()</python>
Text after code.
C++
Text before code.
<cpp>#include <iostream>
int main(int argc, char** argv) {
std::cout << "hai, can i haz c++ nao?" << std::endl; return 0;
}</cpp>
Text after code.
HTML
Text before code.
<html4strict>
OMG Look at This
Wait where did he get that penguin from?
</html4strict>
Text after code.