This site is supported by donations to The OEIS Foundation.

Help talk:Documenting templates

From OeisWiki
Jump to: navigation, search

Standard

I strongly disagree with the idea, that the current en:Wikipedia template documentation style constitutes any kind of standard.  For starters we are obviously unable to fix {{documentation subpage}}, and somehow {{documentation}} added {{!!}} to category:Templates requiring documentation, but {{!!/doc}} clearly exists.

Any templates imported from en:Wikipedia are highly suspicious for the reasons outlined in Help:Interwiki linking#Caveats, and they often come with a zoo of completely unmaintainable helper templates, e.g., the very important set of cite templates is in essence still unusable here, and sadly that's not limited to their /doc or /test subpages.

I've castrated {{documentation}} (again) and {{documentation subpage}} to something that apparently works now, but couldn't say why {{documentation subpage}} tries to add itself to a here non-existing category:Template documentation.  That's no standard, it's unmitigated cruft  if we both can't get it right in less than five minutes.  For editors not interested in any advanced template features it's a nightmare on wheels.

By now, the classic MediaWiki templates will have been supplemented with more flexible programming extensions, further reducing the need of advanced editors to work with markup directly.

Brion Vibber about templates in 2017 on the MediaWiki Future/Parser plan page. –Frank Ellermann 21:08, 9 August 2011 (UTC)

I tried without success (yet) to get the {{documentation subpage}} template (template that you created, with a reference to a /doc subpage, with code obviously imported from Wikipedia) to work properly. I'll try some more to get it to work properly. I thought it was a good idea to separate the code from the documentation, and have a separate /test subpage if there are lots of tests, as does Wikipedia. Also, the citation templates work properly if they don't contain a URL, whereas those that contain a URL add that spurious URL link at the end of the citation (I didn't succeed in fixing that but yet,) otherwise they function properly. Yes, that was quite a task to untangle the citation templates from the zoo of helper templates of Wikipedia, but to create the citation templates from scratch would have been a lot more work! — Daniel Forgues 03:06, 10 August 2011 (UTC)
The {{documentation subpage}} template, imported from Wikipedia, doesn't seem useful for OEIS Wiki... should we delete it? — Daniel Forgues 03:51, 10 August 2011 (UTC)
One missing word, sigh… Kill it anyway, unless you think that causes more work in the long term for other imports; after all you now fixed the last known bug, and I somehow got {{!!}} out of the give me my existing /doc dungeon. Thanks. –Frank Ellermann 14:31, 10 August 2011 (UTC)
On wikipedia:Template documentation you have the following two main motivations for the “template doc page pattern” (which are less relevant for simple templates and/or short documentation, I admit)

Template documentation is often placed in a subpage of the template itself, which is then transcluded at the end of the template page. This separates the often complex template code from the documentation, making the documentation easier to edit. It also allows templates to be protected where necessary, while allowing anyone to edit the documentation. This method is sometimes referred to as the “template doc page pattern”.

Documentation of any sort on a template page should always be enclosed by a <noinclude>…</noinclude> container, so that it does not show up when the template is used on another page. Text on the template page itself adds to the amount of text that must be processed when displaying the template, which is limited for performance reasons. Placing the documentation in a subpage avoids this (MediaWiki developers have recommended it for this reason).

I think \doc subpages for nontrivial templates are a good idea. — Daniel Forgues 18:16, 10 August 2011 (UTC)
I'm trying to get {{documentation subpage}} to work properly. On mediawikiwiki:Help:Magic words#Page names it shows that
Page names
Variable Output Description Versions
{{FULLPAGENAME}} Help talk:Documenting templates Namespace and page title. 1.6+
{{PAGENAME}} Documenting templates Page title.
{{BASEPAGENAME}} Documenting templates Page title excluding the current subpage and namespace ("Title/foo" on "Title/foo/bar").

For more complex splitting, use {{#titleparts:}} from ParserFunctions extension.

1.7+
{{SUBPAGENAME}} Documenting templates The subpage title ("foo" on "Title/foo"). 1.6+
{{SUBJECTPAGENAME}} Help:Documenting templates The namespace and title of the associated subject page. 1.7+
{{TALKPAGENAME}} Help talk:Documenting templates The namespace and title of the associated talk page. 1.7+

Subpages in template namespace

The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See Manual:$wgNamespacesWithSubpagesMediaWiki.org. for information on enabling subpages.

but on OEIS Wiki

  • {{BASEPAGENAME}} gives "Title/foo" instead of "Title" !?
  • {{SUBPAGENAME}} gives "Title/foo" instead of "foo" !?

this is what prevents {{documentation subpage}} from working properly! — Daniel Forgues 21:01, 10 August 2011 (UTC)

Works as expected on a quick /test subpage. Version 1.7 is at least six years old, we are at 1.15 here at the moment, it should work in all ordinary namespaces including templates. Where did you find a page here, where it does not work? It should — but it is no compelling reason to use a complex en:w: documenting style designed for the biggest wiki in the world also here, unless you must for some reason, e.g., import from en:w: required. Template documentation with noinclude is good enough if anything with the en:w: subpage style doesn't work immediately. –Frank Ellermann 01:08, 15 August 2011 (UTC)
Another thought, you get this /doc stuff (working or not) mostly on templates imported from en:w:. That would allow to remove it manually, and add <noinclude>For the source and more info see [[wikipedia:Template:{{PAGENAME}}]], the version here is now likely older and slightly simplified/different, e.g., template categories and documentation here are not as on Wikipedia.</noinclude>. And if that is a good blurb we can put it in yet another template :-) –Frank Ellermann 01:21, 15 August 2011 (UTC)
Look at the {{test}} template, you will see that the {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words don't work properly in the Template namespace. The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See Manual:$wgNamespacesWithSubpagesMediaWiki.org. for information on enabling subpages. — Daniel Forgues 02:56, 15 August 2011 (UTC)
Got it, that can't be okay, and might well be the reason for unclear /doc issues. IMO subpages in the template namespace should work per default in MW, import templates as is from en:w: can't be an unusual plan. But I won't create a new mediazilla: account if I can somehow avoid it: I've destroyed old en:w:+m:+mediazilla: accounts intentionally five years ago, before single sign on existed. –Frank Ellermann 15:15, 15 August 2011 (UTC)
Complaints posted on meta and mediawiki, but a more straight forward solution would be to fix it here. Where can I post general wiki admin requests without bothering Neil, because they are clearly no OEIS requests? –Frank Ellermann 17:19, 15 August 2011 (UTC)
I left a note on User talk:N. J. A. Sloane. — Daniel Forgues 01:26, 16 August 2011 (UTC)