Help:DebateTree

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Other languages:
English • ‎dansk • ‎español • ‎français • ‎українська • ‎العربية

DebateTree is a MediaWiki implementation of the DebateTree algorithm. It computes the status (sustained or refuted) of any argument out of the structure (rather than the content) of its debate tree. DebateTree is currently enabled on the English and Spanish Wikiversity (see Wikiversity:Wikidebate) and can be easily installed on any wiki.

Installation[edit]

To install DebateTree on any wiki, first create a template called "Argument" (or whatever) with the following basic wikitext:

<span class="debatetree-argument">'''Argument'''</span>

Then create a template called "Objection" (or whatever) with the following basic wikitext:

<span class="debatetree-argument">'''Objection'''</span>

Finally, add the following code to the MediaWiki:Common.js of your wiki:

/**
 * Initialization script for DebateTree
 * Documentation at https://commons.wikimedia.org/wiki/Help:DebateTree
 */

// Only load on debate pages
if ( $( '.debatetree-argument' ).length ) {

	// Only load when viewing or previewing
	var action = mw.config.get( 'wgAction' );
	if ( action === 'view' || action === 'submit' ) {

		// Load the code directly from Commons
		mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:DebateTree.js&action=raw&ctype=text/javascript' );
		mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:DebateTree.css&action=raw&ctype=text/css', 'text/css' );
	}
}

Then you can start building debate trees with the following wikitext pattern:

*{{Argument}} Argument about something.
**{{Objection}} Objection to the argument.
***{{Objection}} Objection to the objection.
**{{Objection}} Second objection to the argument.
*{{Argument}} Second argument.
**{{Objection}} Objection to the second argument.

The key element of the templates is the debatetree-argument class, which tells the DebateTree script that the current list item is an argument or objection, as opposed to other list items that may be present in the page, such as lists of external links or bibliography.

See also[edit]