Extension:MintyDocs

MintyDocs is a MediaWiki extension that can be used for product documentation. It is based conceptually in large part on the PonyDocs extension, though the underlying code is totally different. In MintyDocs (as in PonyDocs), wiki pages can be defined as being of one of four types: product, version, manual or topic. A version page must be a subpage of a product page, while a manual page must be a subpage of a version page. Topic pages, for the most part, should be subpages of manual pages, although a topic can also be defined as being "standalone".

Download and installation
You can download the MintyDocs code, in .zip format, here.

You can also download the code directly via Git from the MediaWiki source code repository. From a command line, you can call the following:

(To view the code online, including version history for each file, go here.)

Then, in the file ' ', add the following line:

Authors
MintyDocs was written by Yaron Koren.

Defining structures
There are four basic types of pages within MintyDocs: product, version, manual and topic.

To define a new product page, you need to do two things: add a call to #mintydocs_product to that page (directly or via a template), then add the name of that page to the global variable $wgMintyDocsProductPages in LocalSettings.php. So to add a new product at the page "Product X", you would add the following to LocalSettings.php:

A version page must be a subpage of a product page; an example would be "Product X/1.0".

A manual page must be a subpage of a version page; an example would be "Product X/1.0/Getting started".

Topic pages are usually a subpage of a manual page; an example would be "Product X/1.0/Getting started/Installing the software". However, topic pages can actually be placed anywhere; a topic can be used as a "standalone topic", so that it can be included in more than one manual.

Inheritance
One important feature of MintyDocs is inheritance: that is, you can have a page for a manual or topic simply display the contents of the same manual or topic for a previous version.

Let's say that you have three versions for a product: 1.0, 1.1 and 2.0. All three contain a manual called "Getting started". If this manual for version 1.0 is fully defined, then the page for the "Getting started" manual for version 1.1 can simply contain the following text:

It will then display the same content as the version 1.0 "Getting started". Or you can add additional parameters to the #mintydocs_manual call - these will take effect, while everything that is not specified will be inherited.

The same goes for the manual in version 2.0 - if such a page is set to inherit, the code will go backward through the versions until it finds the first non-inheriting manual page (in this case, for 1.0) and inherit the content and settings from that.

This same logic applies to topic pages as well, which can also inherit from "earlier" topic pages.

User permissions
For any product, there are four permission levels:
 * admin - can view and edit all pages for the product
 * editor - can view and edit all pages for the product, except for versions marked "closed"
 * previewer - can edit all pages for versions marked "released", can view all versions except those marked "closed"
 * the default level - can view and edit all pages for the product, for versions marked "released"

There are two ways to be assigned to a specific permission level for a product: either have that permission set across the entire wiki, via user group permissions; or have it set for a particular product, via a setting in the main page for that product.

For user group permissions, there are three relevant permissions:,   and. By default,  is set for the 'sysop' user group; that is the only default setting.

To create a new user group, let's say "md-editors", that are "editors" for all MintyDocs products, you could add the following line to LocalSettings.php:

Product-specific user permissions are set within the call to #mintydocs_product; see below.

Parser functions
Five parser functions are defined for MintyDocs: #mintydocs_product, #mintydocs_version, #mintydocs_manual, #mintydocs_topic and #mintydocs_link. The first four of these functions, when called from a page, define that page as being of a certain type; these functions also have other parameters that set various attributes of that page. These four parser functions can be placed directly on a page, or (as is recommended) can be placed within a template that is then called from various pages.

The last function, #mintydocs_link, displays a link to another page within the MintyDocs system.

mintydocs_product

 * 1) mintydocs_product defines a product page. It is called with the following parameters:
 * - sets the display title for this page
 * - takes in a comma-separated list of usernames and makes them "admins" for this product; see "User permissions", above
 * - takes in a comma-separated list of usernames and makes them "editors" for this product
 * - takes in a comma-separated list of usernames and makes them "previewers" for this product

mintydocs_version

 * 1) mintydocs_version defines a version page. It is called with the following parameters:
 * - should be one of,   and   (  is the default).
 * - holds a comma-separated list of the manuals for this version.

mintydocs_manual

 * 1) mintydocs_manual defines a manual page. It is called with the following parameters:
 * - sets the display title for this page
 * - holds a bulleted hierarchy of topic names. Names that begin with a "!" are considered "standalone topics" - these are topic pages that are not defined as being part of this manual, and their full page name must be specified. Any "topic name" that does not actually correspond to a topic is simply displayed as text, instead of a link - this can be useful for having section headers within the table of contents.
 * - holds the name of a page that in turns holds a bulleted hierarchy. Only one of this parameter and "topics list=" should be specified.
 * - takes no value; if it is specified, this page's contents come from the corresponding topic in an earlier version; see "Inheritance", above.
 * - takes no value; if it is specified, this page's contents come from the corresponding topic in an earlier version; see "Inheritance", above.

mintydocs_topic

 * 1) mintydocs_topic defines a topic page. It is called with the following parameters:
 * - sets the display title for this page
 * - sets the display title for this page within the manual's table of contents
 * - takes no value; if it is specified, this page's contents come from the corresponding topic in an earlier version; see "Inheritance", below.

mintydocs_link
At least one of the first four parameters must be set. The "lowest" parameter that is set determines what kind of page is being linked to. For example, if "manual=" is set but "topic=" is not, a manual page will be linked to. Whatever parameters are not set, above the "lowest" one, will instead get their values from the page on which #mintydocs_link is called. So, for example, if a page called "Product X/1.0/Getting started/Installing the software" contains the following call:
 * 1) mintydocs_link displays a link to another MintyDocs page. It is called with the following parameters:
 * - a product name
 * - a version number
 * - a manual name
 * - a topic name
 * - the text for the link

...then the call will display a link to the page "Product X/1.1/Starting the engine".

Page variables
MintyDocs defines the following three "variables", which can only be used on pages that are part of the MintyDocs structure:
 * - displays the name of the product for this page
 * - displays the name of the version for this page
 * - displays the name of the manual for this page

MintyDocs and PonyDocs
Though MintyDocs borrows quite a bit of its approach to page structuring from PonyDocs, the two extensions differ substantially in their implementation. PonyDocs may be abandoned software at this point (it has not been actively maintained since early 2017), so this may be a pointless comparison, but nevertheless here are some major differences between the two extensions:
 * PonyDocs does URL rewriting (requiring changes to the Apache configuration), whereas MintyDocs does not.
 * PonyDocs requires all pages to be subpages of the page "Documentation/", whereas in MintyDocs pages can be placed anywhere.
 * PonyDocs generates additional user groups for each product, whereas MintyDocs does not.
 * In PonyDocs, there are additional pages for storing information about tables of contents, etc., while in MintyDocs all information is stored in the product, version etc. pages.
 * PonyDocs requires a top-line header (surrounded with '=') at the top of every page, whereas MintyDocs does not - this enables MintyDocs to be used together with the Page Forms extension.
 * PonyDocs is available only in English, whereas MintyDocs is fully translated.