SLeepdepD

Code Snippet Wiki

by on Jan.29, 2011, under Programming, Technology

I’ve started using MoWeS with MediaWiki for a code snippet repository.

It’s not an ideal solution, for instance I have to install an extension and enter duplicate text every time I create a new snippet entry.  It does have everything I was looking for in a solution however:

  1. Easily searchable.
  2. Allows tags or categories.
  3. Support versioning of snippets.

Here’s the initial setup I did:

Extensions

Download the SyntaxHighlight_GeSHi extension.

mysql\my.ini

Add the following under “[mysqld]”:

ft_min_word_len=3

This allows full-text searching on words 3 characters or more.  The MySQL default is 4.

www\mediawiki\LocalSettings.php

Add the following to the end of the file:

# Use "Vector" skin
$wgDefaultSkin = 'vector';

# Restrict anonymous editing
$wgGroupPermissions['*']['edit'] = false;

# Use "suggest" feature in search box
$wgEnableMWSuggest = true;

# Extensions
# SyntaxHighlight_GeSHi
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");

Here’s a screen shot of an entry:

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...
:, , ,

2 Comments for this entry

Leave a Reply