From mediawiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: unmaintained
Implementation Parser function
Description A simple mediawiki extension for rendering Scratchblocks.
Author(s) Choco31415 and blob8108
Latest version 3.1
MediaWiki 1.10+
License MIT License
Example [1] - A sample page for experimenting with the Scratchblocks syntax.
scratchblocks, sb
Check usage and version matrix.

ScratchBlocks is an extension to display Scratch, a programming language created by MIT, in wiki blocks.


If you clone from the repository, note that it uses Git submodules. When you git clone, make sure to include the --recursive option.

$ cd mediawiki/extensions
$ git clone --recursive http://github.com/tjvr/wiki-scratchblocks ScratchBlocks
  • Download and place the file(s) in a directory called ScratchBlocks in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'ScratchBlocks' );
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension(). If you need to install this extension on these earlier versions (MediaWiki 1.24 and earlier), instead of wfLoadExtension( 'ScratchBlocks' );, you need to use:

require_once "$IP/extensions/ScratchBlocks/ScratchBlocks.php";


None -- every language is enabled by default.


There are two ways to create snippet of Scratchblocks code, which are nearly identical.

  • Use <scratchblocks> before and after your code to create a block level element displaying Scratch code.
  • To create an inline-block element (that will show in the middle of the paragraph), enclose the code in <sb> tags.
 repeat (5)
 move (10) steps
 say [Done!]
 You can repeat Scratch code in a <sb>forever</sb> loop!

For information on how to write Scratchblocks code, visit this link. (Warning, the page is outdated!)