r/mediawiki

Is there a tool to copy a Wikipedia template together with all of its dependencies?

Every time I try to create a new Wikimedia/Wikipedia project, I eventually give up because of templates.

You can't simply copy a template by copying its source code.

A template may depend on dozens or even hundreds of other templates, Lua modules, subtemplates, documentation pages, styles, etc. And those dependencies can have dependencies of their own.

So if I want to migrate a relatively complex template from one Wikimedia project to another, I basically have to play dependency detective:

Copy template → find missing template → copy it → find missing Lua module → copy it → find another dependency → repeat...

This becomes extremely tedious, especially with complex templates used on Wikipedia.

Is there any tool, script, MediaWiki extension, or special export/import method that can copy a template together with all of its dependencies automatically?

Ideally, I'd like to be able to say:

"Copy this template and everything it depends on."

and have it recursively collect and export/import the required templates, Lua modules, and other relevant pages.

I know about Special:Export and copying templates manually, but I'm specifically looking for something that handles the dependency tree automatically.

Does anything like this exist?

reddit.com
u/xKerim — 12 days ago