<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.carnivault.org/index.php?action=history&amp;feed=atom&amp;title=Requests_for_comment%2FDocumentation_overhaul</id>
	<title>Requests for comment/Documentation overhaul - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.carnivault.org/index.php?action=history&amp;feed=atom&amp;title=Requests_for_comment%2FDocumentation_overhaul"/>
	<link rel="alternate" type="text/html" href="http://www.carnivault.org/index.php?title=Requests_for_comment/Documentation_overhaul&amp;action=history"/>
	<updated>2026-04-23T14:24:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.5</generator>
	<entry>
		<id>http://www.carnivault.org/index.php?title=Requests_for_comment/Documentation_overhaul&amp;diff=1345&amp;oldid=prev</id>
		<title>NepenthesOdyssey: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://www.carnivault.org/index.php?title=Requests_for_comment/Documentation_overhaul&amp;diff=1345&amp;oldid=prev"/>
		<updated>2025-02-25T09:35:27Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{RFC&lt;br /&gt;
| created = 2011-12-15&lt;br /&gt;
| authors = [[User:Krinkle|Timo Tijhof]]&lt;br /&gt;
| decision = Accepted, please implement. -- [[User:Tim Starling|Tim Starling]] ([[User talk:Tim Starling|talk]]) 06:29, 17 July 2013 (UTC)&lt;br /&gt;
| status = accepted&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Documentation in general is getting worse and more decentralized at a rapid speed. Are we going for auto-generated documentation ? Or not. If so, do we want this to go into wiki pages and be editable on the wiki, or perhaps as an extension through Special:Documentation ?&lt;br /&gt;
&lt;br /&gt;
== Current state of things ==&lt;br /&gt;
=== MediaWiki PHP code base ===&lt;br /&gt;
;Writing: The documentation of our PHP code base is written in code comments throughout the php files in the source code.&lt;br /&gt;
;Format: The Doxygen documentation style is used.&lt;br /&gt;
;Parser: Parsed by Doxygen.&lt;br /&gt;
;Location: Periodically ran and published on https://doc.wikimedia.org/. Also contains archives of older versions of MediaWiki&lt;br /&gt;
;Navigational features:&lt;br /&gt;
* Todo List (&amp;lt;code&amp;gt;@todo&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Deprecation List (&amp;lt;code&amp;gt;@deprecated&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Bug List (not sure what that is)&lt;br /&gt;
* Modules (&amp;lt;code&amp;gt;@ingroup&amp;lt;/code&amp;gt;) Shows all groups and the classes they contain (linked to Class documentation page) and a list of files they contain (linked to File documentation pages)&lt;br /&gt;
* Class List (all classes from A-Z, linked to Class documentation pages)&lt;br /&gt;
* Class Hierarchy (a tree based on which class extends which class, up to many levels deep. As well as a graphical presentation of this)&lt;br /&gt;
* File List (all files linked to their file documentation pages)&lt;br /&gt;
;Browser features:&lt;br /&gt;
* Class documentation pages (these show all the methods and variables defined in that class, including inherited methods. Grouped by public/protected etc.)&lt;br /&gt;
* File documentation pages (these show the classes, global functions and definitions defined in a file)&lt;br /&gt;
;Other&lt;br /&gt;
Although the primary documentation is indeed inline Doxygen, there&amp;#039;s also on-wiki Manual:-pages that contain the following points that Doxygen currently does not provide:&lt;br /&gt;
* Description of &amp;#039;&amp;#039;&amp;#039;entry-point files&amp;#039;&amp;#039;&amp;#039; ([[Manual:Code]], such as [[Manual:load.php]])&lt;br /&gt;
* Description of &amp;#039;&amp;#039;&amp;#039;[[Manual:Maintenance_scripts#List_of_maintenance_scripts|maintenance scripts]]&amp;#039;&amp;#039;&amp;#039; (such as [[Manual:refreshLinks.php]])&lt;br /&gt;
* Information about &amp;#039;&amp;#039;&amp;#039;hooks&amp;#039;&amp;#039;&amp;#039; (currently kept in {{git file|file=docs/hooks.txt|text=hooks.txt}} and [[Manual:Hooks]] sub pages)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Global variables&amp;#039;&amp;#039;&amp;#039; ([[Manual:Global object variables]], [[Manual:Configuration settings]])&lt;br /&gt;
&lt;br /&gt;
=== MediaWiki API modules ===&lt;br /&gt;
&amp;lt;!-- begin pseudo-{{outdated}} --&amp;gt;&lt;br /&gt;
{{ambox|type=warning|text=The content of this section is outdated. API documentation is now provided via i18n messages. [[Special:ApiHelp|ApiHelp]] produces HTML with links and anchors. If you have checked or updated this page and found the content to be suitable, please remove this notice.}}[[Category:Outdated pages{{#translation:}}]]&lt;br /&gt;
&amp;lt;!-- end pseudo-{{outdated}} --&amp;gt;&lt;br /&gt;
;Writing: The documentation for MediaWiki API modules is written as PHP strings and arrays inside a the module classes in the following methods &amp;lt;code&amp;gt;getParamDescription&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;getDescription&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;getHelpUrls&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;getExamples&amp;lt;/code&amp;gt;. The following functions are also re-used to extract documentation information: &amp;lt;code&amp;gt;getAllowedParams&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mustBePosted&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;isWriteMode&amp;lt;/code&amp;gt;,&lt;br /&gt;
;Format: PHP strings and arrays of strings&lt;br /&gt;
;Parser: The MediaWiki class &amp;quot;ApiHelp&amp;quot; parses these for each module&lt;br /&gt;
;Location: Run on-the-fly when accessing &amp;lt;code&amp;gt;/api.php&amp;lt;/code&amp;gt; of any wiki. Such as [{{SERVER}}{{SCRIPTPATH}}/api.php {{SERVERNAME}}{{SCRIPTPATH}}/api.php] (which is for the version of MediaWiki that is currently deployed on WMF wikis) or at your own localhost at any given moment.&lt;br /&gt;
;Navigational features:&lt;br /&gt;
* Index (shows all modules and all documentation; no navigation from this)&lt;br /&gt;
;Browser features:&lt;br /&gt;
* Per-module filter by opening urls like &amp;lt;code&amp;gt;api.php?action=help&amp;amp;modules=protect&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;api.php?action=help&amp;amp;querymodules=categorymembers&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MediaWiki JavaScript library ===&lt;br /&gt;
&lt;br /&gt;
;Writing: The documentation doesn&amp;#039;t have a final output location yet. So far we&amp;#039;ve been writing it similarly to the PHP code: inside the files above the code it&amp;#039;s documenting. Note that, due to the lack of a parser for these comments, people have written JavaScript documentation on-wiki at [[ResourceLoader/Default modules]]&lt;br /&gt;
;Format: &amp;#039;&amp;#039;Untitled&amp;#039;&amp;#039;. So far it&amp;#039;s been doxygen-ish, except for the trend of using &amp;lt;code style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;@param name {Type} description&amp;lt;/code&amp;gt; instead of &amp;lt;code style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;@param name Type: description&amp;lt;/code&amp;gt;. And of course the use of &amp;lt;code&amp;gt;@constructor&amp;lt;/code&amp;gt;. &lt;br /&gt;
;Parser: &amp;#039;&amp;#039;none&amp;#039;&amp;#039;.&lt;br /&gt;
;Location: &amp;#039;&amp;#039;none&amp;#039;&amp;#039; (you have to dive into the code to read the function documentation). The hand-written [[ResourceLoader/Default modules]] page covers most of the modules.&lt;br /&gt;
;Navigational features: &amp;#039;&amp;#039;none&amp;#039;&amp;#039;&lt;br /&gt;
;Browser features: &amp;#039;&amp;#039;none&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&lt;br /&gt;
This specification will not include PHP code base documentation. The PHP doxygen solution is acceptable. Although it&amp;#039;s not pretty or integrated into the wiki (ie. a special page), neither does it have a good search function, it has a lot of other features and most importantly, it does it well (it understands PHP very well. Such as classes that extend each other, methods that are inherited, which arguments a function takes etc.) and the navigation features of its output are very nice (look at https://doc.wikimedia.org/).&lt;br /&gt;
&lt;br /&gt;
What we would like to improve is the documentation for the API, Extension hooks and the JavaScript library. A web accessible solution that preferably is integrated into MediaWiki.org somehow.&lt;br /&gt;
&lt;br /&gt;
=== Features for API doc ===&lt;br /&gt;
The following are features that we currently have on &amp;lt;code&amp;gt;api.php&amp;lt;/code&amp;gt; or on the on-wiki documentation, as well as some extra features that are currently not available but should be available in our implementation.&lt;br /&gt;
&lt;br /&gt;
* A navigational structure that allows browsing pages or anchored sections on larger pages (e.g. permalinks) for each of the following:&lt;br /&gt;
** modules&lt;br /&gt;
** querymodules&lt;br /&gt;
** actions&lt;br /&gt;
* Search function that searches though module names and their descriptions&lt;br /&gt;
* Documentation per-module that shows:&lt;br /&gt;
** a short description&lt;br /&gt;
** MediaWiki version information (either something like &amp;quot;since MW ..&amp;quot; and/or archive per MW-version)&lt;br /&gt;
** whether POST is required&lt;br /&gt;
** which user rights are needed&lt;br /&gt;
** parameter names and descriptions, valid values for these parameters (if MULTI), the prefix (if applicable), default value and whether optional or required.&lt;br /&gt;
** Example queries and their result&lt;br /&gt;
** &amp;lt;s&amp;gt;Possible error codes&amp;lt;/s&amp;gt; &amp;lt;small&amp;gt;(removed in {{gerrit|152760}} as being basically impossible to keep up-to-date)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Features for JavaScript doc ===&lt;br /&gt;
A good example is http://api.jquery.com/&lt;br /&gt;
&lt;br /&gt;
* A navigational structure that allows browsing pages or anchored sections on larger pages (e.g. permalinks) for each of the object members of the &amp;lt;code&amp;gt;mediaWiki.js&amp;lt;/code&amp;gt; library (&amp;lt;code&amp;gt;mw.html&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mw.message&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mw.Map&amp;lt;/code&amp;gt;, etc.) as well as for jQuery plugins.&lt;br /&gt;
* Documentation for object constructor that shows the following in one view:&lt;br /&gt;
*:&amp;#039;&amp;#039;&amp;lt;code&amp;gt;Map&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Message&amp;lt;/code&amp;gt;, ..&amp;#039;&amp;#039;&lt;br /&gt;
** Function documentation of the root function. And possibility to add examples.&lt;br /&gt;
** Variable and function documentation of the object members (&amp;#039;static members&amp;#039;) And possibility to add examples.&lt;br /&gt;
** Function documentation of the constructor prototypers (&amp;#039;public members&amp;#039;) And possibility to add examples.&lt;br /&gt;
* Documentation for every public method and overview for sub-libraries&lt;br /&gt;
** Function documentation for methods like &amp;lt;code&amp;gt;mw.html.element()&amp;lt;/code&amp;gt; as well as an overview of all &amp;lt;code&amp;gt;mw.html&amp;lt;/code&amp;gt; methods with a description and some examples of how to use them together.&lt;br /&gt;
** MediaWiki version information (either something like &amp;quot;since MW ..&amp;quot; and/or doc archive per MW-version)&lt;br /&gt;
&lt;br /&gt;
== Implementation ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Extension:DocBrowser ===&lt;br /&gt;
An extension that would contain support for several sources, configureable in LocalSettings.php (or {{blue|Special:DocAdmin}}, like CodeReview&amp;#039;s RepoAdmin).&lt;br /&gt;
;Examples:&lt;br /&gt;
* {{blue|Special:DocBrowser/API}}&lt;br /&gt;
* {{blue|Special:DocBrowser/API/opensearch}}&lt;br /&gt;
* {{blue|Special:DocBrowser/API/query/list}}&lt;br /&gt;
* {{blue|Special:DocBrowser/API/query/list/allimages}}&lt;br /&gt;
** Parameters: &amp;lt;code&amp;gt;title=Special:DocBrowser &amp;amp; version=mwself &amp;amp; doc=API &amp;amp; id=query/list/allimages&amp;lt;/code&amp;gt;&lt;br /&gt;
* {{blue|Special:DocBrowser/mwJS}}&lt;br /&gt;
* {{blue|Special:DocBrowser/mwJS/Map}}&lt;br /&gt;
* {{blue|Special:DocBrowser/mwJS/html}}&lt;br /&gt;
* {{blue|Special:DocBrowser/mwJS/html.element}}&lt;br /&gt;
* {{blue|Special:DocBrowser/Hooks}}&lt;br /&gt;
* {{blue|1=Special:DocBrowser/Hooks/MakeGlobalVariablesScript?version=1.18}}&lt;br /&gt;
** Parameters: &amp;lt;code&amp;gt;title=Special:DocBrowser &amp;amp; version=1.18 doc=Hooks &amp;amp; id=MakeGlobalVariablesScript&amp;lt;/code&amp;gt;&lt;br /&gt;
* {{blue|1=Special:DocBrowser/Hooks?prefix=Parser}}&lt;br /&gt;
* {{blue|1=Special:DocBrowser/Hooks?group=Page Rendering}}&lt;br /&gt;
** Parameters: &amp;lt;code&amp;gt;title=Special:DocBrowser &amp;amp; version=mwself doc=Hooks &amp;amp; hooksgroup=Page%20Rendering&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;Note&lt;br /&gt;
These only covers the program interface, it does not cover (for example) the points listed under [[##MediaWiki_PHP_code_base|Other]] such as entry-point files, maintenance scripts and global variables.&lt;br /&gt;
&lt;br /&gt;
===Standalone===&lt;br /&gt;
Set up &amp;quot;docs.mediawiki.org&amp;quot; as a stand-alone version of the docs, without the wiki around it.&lt;br /&gt;
*Implemention idea 1:&lt;br /&gt;
**Point it to the same wiki as for &amp;quot;www.mediawiki.org&amp;quot; and rewrite / to &amp;quot;/wiki/Special:DocBrowser/$1[?&amp;amp;]format=standalone&amp;quot;, and configure &amp;lt;code&amp;gt;$wgDocBrowserStandalonePattern = &amp;#039;//docs.mediawiki.org/$1&amp;#039;;&amp;lt;/code&amp;gt; The Extension would, if it matches, take over output and do it&amp;#039;s own thing.&lt;br /&gt;
*Implemention idea 2:&lt;br /&gt;
** DocBrowser would provide a maintenance script that exports .html files, which we then sync to the docroot for docs.mediawiki.org.&lt;br /&gt;
** This option is probably better. One of the things we could do is provide option to point to the phase3-root, so it can be ran for different branches as well.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;Footnotes&amp;#039;&amp;#039;:&lt;br /&gt;
* Function documentation: This is the comment written right above the function itself. Usually containing a short description and one or more of the following keywords (&amp;lt;code&amp;gt;@constructor&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@param&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@context&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;@return&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Thread:Project:Current issues/Api documentation bot#Api documentation bot 6231]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Requests for comment]]&lt;/div&gt;</summary>
		<author><name>NepenthesOdyssey</name></author>
	</entry>
</feed>