User:Cyrius/MediaWiki extension ideas

Note: these are just some ideas that have popped into my head. I currently have no intention of implementing them, nor do I have any intention of bothering the developers to get them implemented for me. I just felt the need to write them down.

Hidden edit

The ability to collapse the standard table of contents has been desired for arbitrary blocks of text. It would be useful in the context of spoilers, and for question/answer sections in Wikibooks textbooks.

A possible syntax:

<hidden title="Title" default="hide">
Arbitrary MediaWiki text
</hidden>

On page load, this would render similarly to:

Title [show]

When the [show] link is clicked, it would change to:

Title [hide]

Arbitrary MediaWiki text

Values for the default attribute are:

Hide
always hidden on page load
Show
always shown on page load
Auto
determined by a user pref

Comment edit

A common complaint about talk pages is the lack of structure. The problem with using a dedicated comment system is that it requires dedicated pages, and breaks the wiki editing model. This extension would allow for a comment structure without seriously affecting users' ability to edit the page as MediaWiki markup.

The actual syntax would not be edited by humans, but could look something like this:

<comment commentid="autogenerated id" title="A comment" reply-to="other comment's id">
The text of the comment.
</comment>

This would render as:

A comment

The text of the comment.

[Reply to this]

Where [Reply to this] is a link containing the commentid and the talk page name. Clicking the link would lead to a page similar to the current "Post a comment" page.

Indentation is handled automatically on parsing using the reply-to attribute. If the reply-to attribute is missing, the comment is assumed to have an indent level of zero. Comments generated by [Reply to this] are placed immediately after the last comment with the same reply-to value, or after the comment being replied to if there are no existing replies.

The "+" add a comment link would function as it does now, except the comment would be wrapped in the <comment> tags.