Extension:ScratchBlocks

Category:Extensions without a compatibility policyCategory:MIT licensed extensions
MediaWiki extensions manual
ScratchBlocks
Release status: stableCategory:Stable extensions
Implementation Tag Category:Tag extensions
Description A simple extension for rendering Scratch blocks.
Author(s)
  • ErnieParke
  • blob8108
  • apple502j
  • kenny2github
MediaWiki 1.17+Category:Extensions with manual MediaWiki version
License MIT License
Download Category:Extensions in GitHub version control
Example https://scratchblocks.github.io - A sample page for experimenting with the Scratchblocks syntax.
scratchblocks, sb
Category:All extensionsCategory:Extensions not in ExtensionJson

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

Installation

Configuration

By default, only English Scratch blocks are rendered. Add more languages like so:

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

Note that the TW is preceded by an underscore, not a hyphen. This variable is accessible through JS mw.config.get("wgScratchBlocks4Langs")

Usage

There are two ways to create a snippet of Scratch blocks, 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.
<scratchblocks>
repeat (5)
  move (10) steps
end
say [Done!]
</scratchblocks>
You can repeat Scratch code in a <sb>forever</sb> loop!

Both tags take a version attribute, whose default value is 3. If specified as 2, the tag will render its blocks in Scratch 2.0 style.

For information on how to write ScratchBlocks code, visit https://en.scratch-wiki.info/wiki/Block_Plugin/Syntax.

See also

Category:Syntax highlighting extensions
Category:All extensions Category:Extensions in GitHub version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:MIT licensed extensions Category:ParserFirstCallInit extensions Category:ResourceLoaderGetConfigVars extensions Category:Stable extensions Category:Syntax highlighting extensions Category:Tag extensions