Use new Scratch Blocks on MediaWiki.
  • PHP 56.2%
  • JavaScript 39.4%
  • CSS 4.4%
Find a file
2025-10-05 17:45:26 -04:00
.github/workflows Create php.yml 2021-01-07 09:05:19 -05:00
i18n Refactor to use new hook system 2022-10-11 19:42:16 +09:00
lib update scratchblocks to 3.6.4 2025-01-14 19:39:59 +00:00
.editorconfig Refactor to use new hook system 2022-10-11 19:42:16 +09:00
.gitattributes Add some docs, chmod a-x some files 2016-05-04 21:10:36 -07:00
.gitignore Refactor to use new hook system 2022-10-11 19:42:16 +09:00
extension.json Refactor to use new hook system 2022-10-11 19:42:16 +09:00
inline.css Allow scrolling overflowing SB 2019-04-20 06:53:38 +02:00
LICENSE Add some docs, chmod a-x some files 2016-05-04 21:10:36 -07:00
README.md Use hc-3 2023-06-30 21:42:52 +09:00
run_scratchblocks4.js Use hc-3 2023-06-30 21:42:52 +09:00
ScratchblockHooks.php Fix 1.44 compatibility 2025-09-09 18:09:13 +02:00
ScratchBlocks.php Cleanup (#1) 2018-12-30 15:37:36 +09:00

A simple MediaWiki extension for rendering Scratch Blocks used on Scratch 3.0. Supports MediaWiki 1.35+.

Transforms <scratchblocks> tags inside wiki articles into <pre class="blocks"> in the HTML, which are then rendered to scratch blocks using CSS and JS included in the page. Inline blocks are rendered with <sb> tags, and become <code class="blocks"> tags.

Use version attribute to set the version. Valid values are 2, 3, and hc-3 (for High Contrast colors).

  • Maintained by apple502j.
  • Contributed to by Kenny2github
  • Original by tjvr and ErnieParke

Installation

This repository no longer uses Git submodules. You do not need to include the --recursive option.

$ cd extensions
$ git clone http://github.com/InternationalScratchWiki/mw-ScratchBlocks4

After cloning, add the line

wfLoadExtension( "mw-ScratchBlocks4" );

to your LocalSettings.php file. If you need to use languages besides English, add the following line (Japanese and Traditional Chinese used as an example):

$wgScratchBlocks4Langs = ['ja', 'zh_TW'];

Note that the TW is preceded by an underscore rather than a hyphen.

This variable is accessible through JavaScript via mw.config.get("wgScratchBlocks4Lang").

Use $wgScratchBlocks4BlockVersion to specify the default version. Valid values are 2, 3, and hc-3 (for High Contrast colors).