Difference between revisions of "Syntax highlighter"
From MohidWiki
(→Syntax) |
(→Installation procedure for mediawiki) |
||
| Line 40: | Line 40: | ||
<!-- ... --> | <!-- ... --> | ||
| − | + | <head> | |
<!-- ... --> | <!-- ... --> | ||
<!-- Syntax highlighter --> | <!-- Syntax highlighter --> | ||
| Line 46: | Line 46: | ||
<!-- Syntax highlighter --> | <!-- Syntax highlighter --> | ||
<!-- ... --> | <!-- ... --> | ||
| − | + | </head> | |
| − | + | <body> | |
<!-- ... --> | <!-- ... --> | ||
<!-- Syntax highlighter --> | <!-- Syntax highlighter --> | ||
| Line 74: | Line 74: | ||
</script> | </script> | ||
<!-- Syntax highlighter --> | <!-- Syntax highlighter --> | ||
| − | + | <body> | |
<!-- ... --> | <!-- ... --> | ||
</pre> | </pre> | ||
Revision as of 23:20, 12 December 2008
This wiki allows to embed code with syntax highlighting.
Syntax
Simply add in the wiki article edit box this code:
<htm><pre name="code" class="ruby">
File.open("sample.txt", "r") { |fs|
while line = fs.gets
if line.match(pattern)
puts "Line read was '#{line.chomp}'.\n"
end
end
fs.close
}
</pre></htm>
|
File.open("sample.txt", "r") { |fs|
while line = fs.gets
if line.match(pattern)
puts "Line read was '#{line.chomp}'.\n"
end
end
fs.close
}
|
Installation procedure for mediawiki
First, download and untar inside your wiki root folder the syntax highlighter code. Then, simply add the following code snippets in your monobook.php file.
<head>
</head>
<body>
<body>
That's it! You can now test to see if it worked ...