SwiftlyTilting: usability, reusability

Sunday, October 3, 2010

Winter 2.2.1 Released - Winter is an Interpreted language for MediaWiki

Here is an update for Winter, the Wiki Interpreter.

Changes include
* added ^o and ^c escape characters
* added + to allowed characters in function names and functions
* added #reset_all_vars function
* added ++ and — functions
* fixed bug with #strpos and #substr returning false when it shouldn’t
* added #is_numeric, #is_int and #is_string functions
* fixed bug with array assignment
* other minor bug fixes

Winter Homepage on Mediawiki.org
Winter Documentation

Download Winter 2.2.1
Downloaded 1066 times

Monday, September 7, 2009

SwiftlyTilting Wiki (re)Launches!

The wiki at SwiftlyTilting.com has received a face lift. I’ve also added documentation for all of my MediaWiki extensions, and there is a new sandbox area for users to try out Winter and my other extensions as well.

wiki.SwiftlyTilting.com

Thursday, May 21, 2009

Winter 2.2.0 - Interpreted language for MediaWiki

It’s been quite a while since I’ve updated Winter, but recently I discovered how to access content from other pages so perhaps we’ll see some new features. For now, I’ve added #include and #include_raw. #include will include the text from another page and run it through the Winter engine. #include_raw is not run through the Winter engine before being dumped into the page. Wikitext markup is not interpreted during this stage.. if you need the content to be formatted, you should use the #include command within a <winterprewiki> block. I also fixed a few bugs.

Winter Homepage on Mediawiki.org
Winter Documentation

Download Winter 2.2.0
Downloaded 950 times

Thursday, November 1, 2007

Winter 2.1.1

Just a quick bugfix for Winter.

  • fixed NOTICE of undefined variable
  • fixed count command which would return the incorrect value

And since it’s been a while since I posted these links:
Winter Homepage on Mediawiki.org
Winter Documentation

Download Winter 2.1.1
Downloaded 1126 times

Sunday, September 2, 2007

Winter 2.1.0

One thing that has been bugging me about Winter is that code must be left aligned or else MediaWiki will format it with some HTML. This made it impossible to write neat code, especially in longer programs. I finally hit upon a decent workaround and now program code is much more readable.

Before:

{{#function | formatNum ||
{{#if | {{#1}} | {{#1}} | no more }} bottle{{#if | {{#1 == 1}} | | s }}
}}

{{#for | {{#i = 99}} || {{#i >= 0}} || {{#i --}} ||
{{#bottles | @= | {{#formatNum | {{#i}} }} }}
{{#ucfirst | {{#bottles}} }} of beer on the wall, {{#bottles}} of beer.
{{#if | {{#i}} |
Take one down and pass it around, {{#formatNum| {{#i - 1}} }} |
Go to the store and buy some more, 99 bottles
}} of beer on the wall

}}

After

{{#function | formatNum ||
   {{#if | {{#1}} || {{#1}} || no more }} bottle{{#if | {{#1 == 1}} || || s}}
}}

{{#for | {{#i @= 99}} || {{#i >= 0}} || {{#i --}} ||
   {{#bottles | @= | {{#formatNum | {{#i}} }} }}
   {{#ucfirst | {{#bottles}} }} of beer on the wall, {{#bottles}} of beer.
   {{#if | {{#i}} ||
      Take one down and pass it around, {{#formatNum| {{#i - 1}} }}
   ||
      Go to the store and buy some more, 99 bottles
   }} of beer on the wall.

}}

I’ve also added features to access the various template parameter variables used on a page, as well as various other upgrades and bug fixes.

  • changed syntax so that carriage returns are ignored if followed by a space
  • added template variable access
  • added time, microtime, date, urlencode, explode, implode, request_var, template_var, to_str, to_int, show_page_text, version, wordwrap, keep_nl
  • added ^. escape char
  • added <winterprewiki> tag which allows winter to be used before mediawiki processes it
  • added addVar for external user functions to add variables
  • added WinterBeforeProcess and WinterAfterProcess hooks
  • added various information available at runtime such as user name, page name, etc
  • fixed bug with nowinter tag
  • fixed bug when using foreach with noexistent array
  • fixed bugs with & and ? operators (they’re turned into html entities)
  • fixed bug caused by pipes being returned in error messages
  • updated error messages

Download Winter 2.1.0
Downloaded 800 times

Sunday, August 12, 2007

Winter 2.0.2

A user left a comment notifying me about a warning message which would appear if allow_call_time_pass_reference was set to off in PHP settings. I’ve fixed the problem along with a few other minor bugs for this release. I also added a new comment syntax {{#| You comment here }}

Change log:

* Fixed allow_call_time_pass_reference bug
* Fixed bug with <nowinter> tag
* Fixed bug when undefined variables were referenced
* Added alternative comment syntax

Download Winter 2.0.2
Downloaded 644 times

Friday, August 10, 2007

Winter 2.0.1 and Winter manual updated

I finished up the initial stages of the Winter 2.0 documentation today, so now you should be able to fully take advantage of all the new features. I noticed a few minor issues as I was documenting the code so I corrected them and have released the changes as Winter 2.0.1.

Change log:

  • Fixed some bugs with #eval
  • Changed the | (bitwise or) operator to ? since | is a reserved symbol in Winter (can’t believe I missed that one before!)
  • Improved #comment so that it does not evaluate code
  • Improved the escape character system

Download Winter 2.0.1
Downloaded 638 times

Saturday, August 4, 2007

Winter 2.0.0

It’s been over a year since I last released an update for Winter. Since then MediaWiki introduced support for parser function extensions, which provide some of the same basic functionality as Winter. Winter code does not interfere with parser functions, and they can be used on the same page, though care must be taken when combining both types of code together.

This new version of Winter has been in the works for a few months now. Many new features and functions have been added, and some bugs have been corrected as well. The program code has increased in size by nearly 80% since 1.5.0!

Download
Homepage on Mediawiki.org
Documentation

About Winter:

Winter is the Wiki Interpreter, a complete programming language plug-in for MediaWiki, the software which powers Wikipedia and many other wikis across the internet.

Change log:

  • Added installation settings $wgWinterMaxNesting, $wgWinterMaxOperations, $wgWinterMaxIterations, $wgWinterNotAllowed
  • fixed bug in operation count which severely under counted operations
  • fixed bug when trying to loop inside of a function
  • added external function definition support
  • improved tag
  • improved error messages
  • added - and $ to acceptable function and variable name characters, explicitly defined _
  • depreciated #define in favor of #str_replace_all
  • added @ 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
  • depreciated #default in favor of #set_param_default
  • 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

Download Winter 2.0.0
Downloaded 863 times

Wednesday, January 18, 2006

Winter 1.5.0

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

Download Winter 1.5.0
Downloaded 1023 times

Monday, January 2, 2006

Winter 1.4.1

* Added <nowinter> tag 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.

Download Winter 1.4.1
Downloaded 717 times

Tuesday, December 6, 2005

Winter v1.3

More bugfixes and other stuff.. added mod operator

Download Winter 1.3
Downloaded 788 times

Thursday, November 24, 2005

Winter v1.2

Released a new version of winter.. this one allows for a new variable syntax that should save some typing.

Download Winter 1.2
Downloaded 661 times

Thursday, November 17, 2005

Winter bug fixes

As expected, some bugs were discovered in Winter v1.0. I’ve fixed them and released a new version.

Download Winter 1.1
Downloaded 658 times

Wednesday, November 16, 2005

Introducing the Winter scripting language for WikiMedia

Recently I started playing around with MediaWiki, the software that powers Wikipedia and other similar wikis. The software has a useful template system, but as a programmer, I wasn’t satisified with the lack of basic useful features like conditional statements and looping.

I discovered MediaWiki is pretty easy to create extensions for, and so I set out to create useful scripting language that was easy to understand and matched the syntax of other WikiMedia commands. What I ended up with was a full fledged scripting language, with if statements, for and while loops, and even function declarations.

For more information, please see the Winter documentation over on MetaWiki.

Download Winter 1.0
Downloaded 742 times

Validate XHTML | Word Press