Extension:Winter

Winter (Wiki Interpreter) is an extension which adds an interpreted language to Mediawiki pages. It is intended to enhance the templating system but can be used on any page.

Features
Features of the Winter language include:
 * simple syntax
 * alphanumeric variables & arrays
 * if/then/else conditional
 * for and while loop conditionals
 * definable functions
 * arithmetic
 * string manipulation

Download

 * Winter 1.5.0 - Added 13:04, 4 August 2007 (UTC)
 * Winter 1.5.0 - Added 03:04, 12 January 2006 (UTC)
 * Winter 1.4.1 - Added 11:55, 2 January 2006 (UTC)
 * Winter 1.4.0 - Added 10:32, 2 January 2006 (UTC)
 * Winter 1.3 - Added 10:25, 6 December 2005 (UTC)
 * Winter 1.2 - Added 19:23, 23 November 2005 (UTC)
 * Winter 1.1 - Added 05:06, 18 November 2005 (UTC)
 * Winter 1.0 - Added 09:04, 16 November 2005 (UTC)

Installation

 * 1) Place Winter.php in your wiki's the extensions directory.
 * 2) Add require_once("extensions/Winter.php"); to the bottom of LocalSettings.php
 * 3) You're done!

Language specification
Language Specification

Example 1
This example demonstrates the use of defined functions, for loops, and variable assignment

Will return . foobar1 .. foobar2 .. foobar3 .. foobar4 .. foobar5.

Example 2
Template parameters can be accessed easily

Using the code above in a template will return First parameter is set to:param1 if the template is called with a first paramter set to param1 (eg  param1 ). If the first parameter is blank or not used, the template would return nothing.

Example 3 - Creating a Calendar
This example is too large to include on this page.

View Example 3

v2.0.0

 * fixed bug in operation count which severely undercounted operations
 * fixed bug when trying to loop inside of a function
 * improved &lt;nowinter> tag
 * improved error messages
 * depreciated #define in favor of #str_replace_all
 * depreciated #default in favor of #set_param_default
 * added installation settings $wgWinterMaxNesting, $wgWinterMaxOperations, $wgWinterMaxIterations, $wgWinterNotAllowed
 * added external function definition support
 * added charachters - and $ to acceptable function and variable name characters, also explicitly defined _
 * added @ (silence) modifier for variable assignment operators
 * added <- and <=> variable assignment operators
 * added & | xor << >> bitwise operators
 * added ^ arithmetic operator
 * added #add, #subtract, #multiply, #divide arithmetic functions
 * added #strtoupper, #strtolower, #ucfirst, #trim, #ltrim, #rtrim, #strip_tags string functions
 * added #comment as another name for #null
 * added #debug for easy debugging stub display
 * added #rand function
 * added #html_to_xml and #xml_xpath xml function
 * added array variable type (2 dimensions maximum)
 * added #foreach loop construct for traversing arrays
 * added []= and [][]= operators for array assignment
 * added #count, #array_rand, #array_rand_value, #sort, #rsort, #asort, #arsort, #natsort, #ksort, #krsort array functions

v1.5.0

 * Added new shortcut syntax:  is the same as .  Each span of whitespace is converted to a pipe character.  This is especially useful for math operations:   =
 * #op can now accept any amount of operations. However, the order of operations is only left to right.   ie  will return 0 and not 4.
 * Added #formula command
 * Added #eval command
 * Added #repeat command
 * fixed some bugs in #strpos

v1.4.1

 * &lt;nowinter> tag added to replace #noeval command

v1.4.0

 * Added #noeval command to allow Winter code to be displayed without being evaluated.
 * Reworked escape character code. Escape characters are now only translated inside of a Winter command instead of anywhere on the page.  This ensures that users who are unaware Winter is installed are not confused.
 * #define actually works now.
 * Switched to x.y.z version numbering system.

v1.3

 * Fixed problems with certain commands inside of a for loop. Also fixed the problem with newlines in variable values.
 * Added mod (modulus) operator.

v1.2
and are now equivalent, as are  and  (an all other operators), assuming a has already been defined by a #setvar or #var command.
 * Introduced new shortcut syntax for variables:

v1.1

 * Fixed a few bugs
 * Nesting didn't always work right depending on syntax
 * != didn't work

v1.0

 * Original Public release

Updates by RSS
Winter updates are published on my blog.

RSS Feed