Page MenuHomePhabricator

Don't require Module: prefix to be repeated in titles of modules that are being tested using TemplateSandbox
Open, Needs TriagePublicFeature

Description

Feature summary

It would be less redundant and (to me) more intuitive if Module: didn't have to be repeated in the names of modules that are being tested using Special:TemplateSandbox.

Reasoning

Initially when I tried to test a custom version of Module:grc-conj with dependencies, I edited Module:User:Erutuon/grc-conj and I didn't understand why it didn't work. I gave up for a while, and then sometime later figured out that I had to move it to Module:User:Erutuon/Module:grc-conj. Now that I've done it once, I know what to do, but I still don't like the redundancy.

I am not sure why Module: has to be repeated in the title. Repetition is helpful for disambiguating wikitext templates (User:whatever/Template:template name) because there are usually other things at the top level of a person's User namespace besides modules. The repetition might not be necessary for Scribunto modules because they can only exist in the Module: namespace, and almost everything in the Module: namespace is a module except documentation pages, sanitized CSS, and JSON, and those are distinguishable by content model. (I tried creating User:Erutuon/module test and changing it to the Scribunto content model, but Scribunto wasn't on the list.)

Removing repetition would permit shorter titles for a set of modules that you want to test using Special:TemplateSandbox, and it's possible that other newbies to the template sandbox would not realize they need repeat the Module: and give up on using the feature, like me when I was first trying to use it.

Possible breakage

A problem is when there is a module that has the name of a documentation subpage. Documentation pages are wikitext and can't be used by Scribunto. On Wiktionary, documentation subpages are at /documentation and we have https://en.wiktionary.org/wiki/Module:documentation. Under this proposal the sandbox version would be situated at Module:User:Erutuon/documentation under this proposal, but that is actually a wikitext documentation page which can't be used by the template sandbox. I would propose the solution that the sandbox, when retrieving require("Module:documentation"), check for Module:sandbox_prefix/documentation and then Module:sandbox_prefix/Module:documentation and use the first one (if any) that is a Scribunto page.

Possibly not requiring the Module: duplication would change which sandbox modules are retrieved in real uses of the template sandbox. Perhaps there is a way to test this, even if there isn't a record of TemplateSandbox inputs, by finding prefixes before a Module: inside module titles and finding cases where a base-level module could be retrieved two different ways using that prefix.