(source) C. Scott Ananian: Ideas/A Dozen Visions for Wikitext/Grunge

Grunge

Goals for Grunge

So let’s say I can set a page as “wikitext 2.0” instead of “wikitext 1.0”. What would wikitext 2.0 look like?

One of the difficulties of current wikitext is the lack of a written spec, and the complexity of its implementation.

Grunge is an attempt to radically simplify wikitext, to something you could describe “on a single sheet of paper”, and which eliminates the excessive look-ahead and backtracking in the current parser.  It was designed to map to and from HTML, just like Parsoid does with “wikitext 1.0”, so that you can in fact use MediaWiki DOM Spec HTML as an intermediate representation to convert between wikitext 1.0 and Grunge.  An article stored as wikitext 1.0 can be edited as Grunge by converting first to HTML and then into Grunge, and vice versa. (This is a useful property for any "wikitext 2.0" proposal, not just Grunge.)

Comparison between Grunge and wikitext 1.0

Here’s what it would look like.  I tried to make this “look like wikitext”, while also squashing ambiguities in wikitext 1.0.  For example, in current wikitext you can put 5 single-quotes in a row and create something which could resolve into either bold or italics or quotes.  In Grunge most constructs start and end with curly braces to eliminate the ambiguities.  We also add block headings and block list items, which are missing from wikitext 1.0.  We’ve made some changes to magic words and extension tag syntax, which we’ll return to later.

Grunge syntax
 
Links
Internal link: [[Title|label]]
External link: [[https://x.org|label]]
Headings
Single-line heading: == heading ==
Multiple-line heading: {= longer heading =}
Lists
Single-line list item: * list item
Multiple-line list item: {* longer list item *}
Tags
Basic HTML tags: <div>...</div>
Extension tags with fragment: <pre#id>...</pre#id>
Formatting
Italics: {'italics'}
Bold: {''bold''}
Language converter: {- language -}
Transclusions
Template: {{Template|arg1|name=arg2}}
Parser function: {{#function|arg1|name=arg2}}

This ends up looking very much like wikitext.  Here’s an example of editing a page with Grunge: 

Using the "source editor" to edit a page written in Grunge

This is boring, because Grunge is exactly the same as wikitext 1.0 in this simple example.  But that’s kind of the point.

Next section: Markdown

C. Scott Ananian [[User:cscott]]