Module:Article history/doc explained

This module implements . Please see the template page for documentation of how to use it.

Technical details

This module has a configuration module at, which can be used to translate/modify the template for use on other wikis. See the config module for instructions on how to modify it. The configuration for the English Wikipedia is very complicated, but it is also possible to use it much more simply. If you want to use the more advanced features provided by the module, you can consult the class documentation below.

There is also a Category class at, which is used by both the main module and the config module.

Class documentation

This is technical documentation for Lua programmers who are looking to adapt this module for use on different wikis.

Category

The Category class is used to generate all of the module's categories. It is loaded in both and . You can create a category with Category.new:

Category.new(cat, sort)

The cat variable is the category text, and sort is its sort key.

Once category objects are created, they have the following properties:

They can be rendered into category links by calling tostring on them.

Message

The Message mixin contains common message-related methods which are available in all classes apart from the Category class. These methods are:

ArticleHistory

An ArticleHistory object does the main work of the module. It fetches the different Row objects, renders the box, renders the error messages, and renders category links. ArticleHistory objects can use all methods from the Message mixin. They also have the following public properties:

ArticleHistory objects have the following public methods:

Calling tostring on an ArticleHistory object gives you the HTML table made with ArticleHistory:renderHtml concatenated with the category links made with ArticleHistory:renderCategories.

Row

Row objects can use all methods from the Message mixin. They also have the following public properties:

Row objects have the following public methods:

Status

Status objects generate the row detailing the current status of the article. They inherit all properties and methods from Row objects, including the Message mixin methods. They have the following additional properties:

MultiStatus

MultiStatus objects are variations on Status objects for articles that can have multiple current statuses, e.g. Good Article and Former Featured Article. They can be used interchangeably with Status objects.

Notice

Notice objects generate rows containing notices about the article that aren't part of its current status, e.g. the date the article was featured on the Main Page. They inherit all the properties and methods from Row objects, including the Message mixin methods. They don't have any additional properties or methods.

Action

Action objects generate rows detailing a single action in the history of an article, e.g. a Featured Article candidacy. They inherit all properties and methods from Row objects, including the Message mixin methods. They have the following additional properties:

Action objects have the following additional methods:

CollapsibleNotice

CollapsibleNotice objects generate rows containing notices that go in the collapsible part of the template, underneath the list of actions. They can also include a collapsible text field. This is used for notices that are not important enough to be displayed as a (more prominent) Notice object, e.g. DYK notices. CollapsibleNotice objects inherit all the properties and methods from Row objects, including the Message mixin methods. They don't have any additional properties, but they have the following additional methods: