MediaWiki / Syntax highlighting

From WhyNotWiki

Jump to: navigation, search


[MediaWiki (category)]


In the future: I'm keeping my eyes open for a good extension to do this for me...


[WhyNotWiki / Conventions (category)]


In the meantime: Just put all code blocks in <pre> tags...

Also, you can feel free to start encoding the language of the block, so that when we finally do get a syntax highlighting extension/feature, we already know which language should be used for syntax highlighting for each block...

Valid language options are:

  • console: commands typed in the shell / on the command line
  • bash: a bash script
  • mediawiki: MediaWiki wikitext markup
  • ruby
  • ... (the rest should be intuitive enough to guess)

Example:

<pre class='console'>
> svn propset svn:externals "rails http://dev.rubyonrails.org/svn/rails/trunk" vendor
</pre>
> svn propset svn:externals "rails http://dev.rubyonrails.org/svn/rails/trunk" vendor

These classes defined here: MediaWiki:Common.css  edit

Personal tools