Template talk:Documentation

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Edit request[edit]

Please add parameters to specify the location of the template testcases page and template sandbox page, if they are not in the expected /sandbox and /testcases pages. (both {{template sandbox notice}} and {{template test cases notice}} support specifying the location of the pages, so this should as well) -- (talk) 11:24, 14 June 2015 (UTC)

I think it probably better if they are in the standard locations. What is the advantage of allowing them to be anywhere else? — Martin (MSGJ · talk) 20:06, 14 June 2015 (UTC)
Red information icon with gradient background.svg Not done: please establish a consensus for this alteration before using the {{edit protected}} template. --Redrose64 (talk) 23:12, 14 June 2015 (UTC)
If you check their contrib history, they're actually having trouble with the namespace, not paths. When {{Documentation}} is placed in the Draft namespace, the sandbox and testcases links are not shown. Alakzi (talk) 23:14, 14 June 2015 (UTC)
"template test cases notice" and "template sandbox notice" support alternate locations because they exist in such a manner in Templatespace, not because of Draftspace. Especially, with unified testcases for multiple templates, just as documentation template supports a source for where the documentation comes from which can be shared between multiple templates. -- (talk) 06:40, 16 June 2015 (UTC)

Incorrect protection icon[edit]

Jackmcbarn. Mr. Stradivarius: When a template has {{Documentation}} and is protected, the {{Documentation}} displays any prot icon that may be appropriate. This normally works well.

However, there appears to be a problem in the way that Module:Documentation decides whether to show the icon when the |page= parameter is used. Consider User:Cpiral/sandbox/B: this version has {{documentation|page=Template:Convert}} and is in Category:Wikipedia pages with incorrect protection templates whereas this version does not have {{documentation|page=Template:Convert}} and is not in Category:Wikipedia pages with incorrect protection templates. If I remove that |page=Template:Convert and preview, the Category:Wikipedia pages with incorrect protection templates does not appear. So the presence of the page in that error cat is something to do with {{documentation|page=Template:Convert}}. As I understand it, the purpose of the |page= parameter is to pull in the doc subpage for a different template, so in this case it brings in Template:Convert/doc. It appears to be deciding whether to display a protection icon based on the current protection level of Template:Convert when it should be testing the current protection level of the page where the {{documentation}} actually appears - in this case User:Cpiral/sandbox/B, which is not protected (and never has been). --Redrose64 (talk) 22:25, 1 August 2015 (UTC)

"Mirror" link is broken and misleading[edit]

It's been brought up a few times over the past four years, but the "mirror" link to create a sandbox doesn't actually mirror the main template. Instead, because it just preloads the main template, it strips out anything in <noinclude> tags. This has the effect of not only removing documentation, but it also breaks any statements such as {{safesubst<noinclude />:. This is not the expected behavior of a link that is labeled "mirror". I can't think of an obvious way to fix this without creating a gadget or an external tool on toollabs, but unless there is a way to fix it in Lua, the link should probably be removed as it has the potential to do more harm than good. --Ahecht (TALK
) 14:34, 26 August 2015 (UTC)

We could preload a page containing <includeonly>{{subst:msgnw:{{subst:BASEPAGENAME}}}}</includeonly>, which would then require saving before it takes effect. This could also be achieved in Lua with mw.title:getContent(). Alakzi (talk) 15:14, 26 August 2015 (UTC)
@Alakzi: Ooh, I didn't know about msgnw, that's handy. I had to modify that string to include the namespace and created Template:Documentation/mirror, which seems to work in my sandbox tests. I've implemented it in {{Documentation/sandbox}}. Can someone check my work before it goes into the main version of the module? --Ahecht (TALK
) 16:56, 26 August 2015 (UTC)
The namespace check is probably redundant: ":Article" is the same as "Article". Alakzi (talk) 17:04, 26 August 2015 (UTC)
@Alakzi: Good point. The double colons had looked wrong, but they seem to work. --Ahecht (TALK
) 17:58, 26 August 2015 (UTC)
Well, it all looks good to me now. Alakzi (talk) 18:04, 26 August 2015 (UTC)

That's probably been enough time for feedback. Shall we? Alakzi (talk) 16:26, 28 August 2015 (UTC)

Good idea. I made the changes live. --Ahecht (TALK
) 16:35, 28 August 2015 (UTC)