A script to allow wiki communities to create dynamic wizards for contributing content through article skeletons
GPL-3.0 License
First introduced in the 2018 Wikimedia Hackathon in Barcelona.
This script is meant, for the moment, to be a user script on wikis.
For Wikimedia-run wikis, the script is maintained on MediaWiki.org and can be loaded directly by adding it to your User:YourUsername/common.js
with the following:
// Set up your article repository
mw.config.set( 'articlesandbox-article-repo', '[PAGE NAME FOR THE TOP LEVEL OF THE ARTICLE REPOSITORY]' );
// Load the script
mw.loader.load('//www.mediawiki.org/w/index.php?title=User:Mooeypoo/wikiArticleWizard.js&action=raw&ctype=text/javascript');
If you want to add this to your non-Wikimedia wiki, you should first build the full script, then put it on your wiki for your users to load (or for the wiki to load automatically in its general common.js
as you choose).
See Insalling for local use and contribution
If you want to use this locally for testing, or to contribute to the script, or to produce the full user script to be copied into a wiki, you'll need to first build the full script itself:
npm install
grunt build
to build the final scriptdist/wikiArticleWizard.userscript.js
into the wikiThis is also useful for testing.
Note: Because this script is already available on mediawiki.org, any Wikimedia-operated wikis will automatically gain an update if they use the original script. See Installation for Wikimedia wikis
The script relies on having an article repository on the wiki to display article skeletons for users. In order to provide and control that, you should decide where the article templates/skeletons reside first, then create an initial page with this structure.
The system then reads, automatically, the structure of the sub-pages of that page to display the hierarchy of the article skeletons, and some information for the users:
For example, if our article repository is at MediaWiki:ArticleWizard
:
MediaWiki:ArticleWizard
page contains a welcome messageMediaWiki:ArticleWizard/Person
is a category of skeleton articles. Its content doesn't matter.MediaWiki:ArticleWizard/Person/Singer
is a skeleton article; it will appear as an option to the user, and its content will be used as the pre-filled content for the new article.MediaWiki:ArticleWizard/Person/Artist
is a skeleton article; it will appear as an option to the user, and its content will be used as the pre-filled content for the new article.MediaWiki:ArticleWizard/Animal
is a category of skeleton articles. Its content doesn't matter.MediaWiki:ArticleWizard/Animal/Dog
is a skeleton article; it will appear as an option to the user, and its content will be used as the pre-filled content for the new article.Note: You could continue with sub-categories, but overdoing that is not advised, as they tend to look very weird in the wizard itself.
For the moment, this tool is a user script. Because user scripts and gadgets don't go through any of our usual CI, the code is hosted here with tests, linting, and tools that help proper development.
npm install
grunt build
which will produce a distribution file that can be copy/pasted as a user script on local wiki for testing.If there is much need and use for this tool, it may become an extension and be transferred to the normal Gerrit code hosting.
This is a collaborative effort -- please feel free to contribute pull requests and/or submit issues!
This script was initially based on the idea of {{User sandbox+}} on English Wikipedia, by User:ManosHacker
There was a request to bring this tool to other communities, which created the need to create something scalable and translatable. This is how wikiArticleWizard was born.