articles - The articles you wish to import. See the locating articles section below for more information on what to put here.
Any number of modules can be passed into importArticles(). However, all of the articles within a module must be of the same type.
Links generated by importArticles() (and the advanced techniques described below) are cached for a maximum of 10 minutes. So whenever you make a change you can assume that after 10 minutes all the users coming to your wiki will be served the updated version of js and css files if importArticles() is used.
In order for us to locate the articles you're trying to import, we have provided a simple syntax for locating articles. This syntax is very similar to, and compatible with Interwiki links:
Anything in parentheses above is optional, and anything in brackets above denotes user input. The colon character is used to separate the string into different segments for parsing. Prefixes tell us how you want to look up the article and are generally followed by a wiki name, except in the case of a local wiki.
Articles on the local wiki can be located by title in the same way that you would link to them normally. They do not require a prefix or wiki name, though, for convenience, there is a local prefix (or "l" for short). For example, if you wanted to import the article MediaWiki:Common.js, any of the following would work:
Articles from external wikis can also be located the same way that you would link to them normally. However, unlike local articles, external articles require the use of a prefix and wiki name to determine which wiki you will be importing them from and how you will identify that wiki. Currently we support looking up wikis by their database name, which is typically the English name for the wiki, and by its URL. Database lookups are performed for the external prefix (or "remote" or "w" for short) and URL lookups are performed for the url prefix (or "u" for short). For example, if you wanted to import the article Highlight/code.css from the Dev wiki, any of the following would work:
Performing sanity checks on the modules provided to assure they are properly formatted
Providing the user feedback in the case of an error.
While there are many parameters you can include in the URL, the following are probably the most useful:
Tells ResourceLoader that we will be loading articles. Should be set to "articles."
The list of articles. If multiple articles are provided, they should be separated by a pipe "|" character.
The type of articles to import. Should be set to either "scripts" or "styles."
This parameter is not necessary by default but can be set to "true" to disable minification to allow for easier debugging of problems within the imported articles.
In the end, you should end up with a URL that looks something like this: