Module:Downloadlinks/doc

Description
This module creates download links based on hashes stored in submodule /hashes. It looks up hashes there based on template calls.

It is highly recommended to also have some JavaScript which removes empty  elements. Those are apparantly also generated by the module, yet there doesn't seem to be any good reason to do so.

Table
In here:
 * : Module where process arguments are located.
 * : Module where hashes are stored.
 * : (including namespace) Category where pages should be added to when no download link could be constructed.
 * : What to show when no version could be found in the hash module.
 * : What to show when no variant could be found (e.g.,  , etc.).
 * : What to show when no hash could be found.
 * : Default text for a client download link.
 * : Default text for a server download link.
 * : Default text for a Windows server download link.
 * : Default text for a JSON download link.
 * : Default text for JSON shown in-browser.
 * : Name of template where a self-closing  element is located. This is necessary to prevent the module from generating illogical  s.

Getting
Using the module gets the mandatory arguments from the template call.

NOTICE: If a previous version of this module has not been used ever before, the deprecated argument checks may be safely removed.

Checking
After the module got the arguments, a further check is done to find out if all arguments are valid, that is, if the given mandatory parameters (version and variant) in the template are in the hashes module. If version or variant do not pass this test, the module stops, returns an error message and adds the page to the given category (category = if the page is in the main namespace).

If the hash is somehow  (either set to that or unintended) in the hashes module, the module returns a 'download link' with text explaining no hash could be found (this might be redundant after the version and variant checks, but better safe than sorry).

Downloaded and in-browser JSON
By utilising the module checks if there's also a  hash in the hashes module for the specified version. If there's such a hash found, it'll construct a link based on  rather than a download link. To prevent this from happening, set parameter.

shorthand
If, rather than,   is used for a Windows server download link, the module converts that to   internally by utilising

Custom link text
If default text is unwanted, the module can add custom text using

NOTICE: If a previous version of this module has not been used ever before, the deprecated argument check may be safely removed.

Other
When a link is returned by the module, it will be an external link, plus the  template put behind it. This will prevent unwanted s from happening.