Template talk:Documentation

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Section headings

[edit]

This template breaks section headings. See [1]. -- Bryan (talk to me) 15:18, 23 February 2008 (UTC)[reply]

Color change

[edit]

I propose to add " clear: both; border: 2px dotted #666666; padding: 0.6em; background-color: #f5f5f5;" to the style tag of the first div. That would make the documentation template be easier to distuingish from the actual content of the containing template. That's standard on all Wikipedias using Template:Documentation. --Slomox (talk) 21:14, 17 January 2009 (UTC)[reply]

Ah, I'll just do it, it's clearly an improvement. --Slomox (talk) 00:31, 18 January 2009 (UTC)[reply]

Some updates

[edit]

It would be nice if this version of the template could take over some of the features of the English wikipedia version. Especially the sandbox and testcases detection is highly useful for editors. Although perhaps it should be at the bottom of the template, and not at the top. I also think we should remove the "view" option, like they have done on en.wp. It's not really useful. A selflink indentation on "This documentation is transcluded" part might be useful as well. TheDJ (talk) 21:31, 14 September 2009 (UTC)[reply]

{{#switch: {{SUBPAGENAME}}
   |sandbox|testcases=<!--**DO NOT SHOW THESE LINKS ON THE SANDBOX/TESTCASES PAGES**-->
   |#default=
    {{#switch: {{SUBJECTSPACE}}
     |{{ns:template}}
     |{{ns:user}}=
      {{#ifexist: {{FULLPAGENAME}}/sandbox
       |This template has a [[/sandbox|sandbox]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /sandbox }}|action=edit}} edit])</small> <!--
        -->{{#ifexist: {{FULLPAGENAME}}/testcases
         |and [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small>}} for editors to experiment.
       |{{#ifexist: {{FULLPAGENAME}}/testcases
        |This template has [[/testcases|testcases]] <small style="font-style: normal">([{{fullurl:{{ #rel2abs: /testcases }}|action=edit}} edit])</small> for editors to experiment.}}
 }}}}}}

This is the code for sandbox/testcases detection. TheDJ (talk) 11:27, 15 September 2009 (UTC)[reply]

Format when creating a subpage without template

[edit]

As I had some troubles with the template for /doc subpages, I wrote a description an just inserted standard section header(s). Currently one needs to insert a blank line before the first section header, otherwise the header appears unformatted, e.g. as == Usage ==. -- User:Docu at 17:15, 21 April 2010 (UTC)[reply]

I fixed it. --Slomox (talk) 17:37, 21 April 2010 (UTC)[reply]
Thanks. For some reason, I didn't consider trying it myself. -- User:Docu at 19:33, 21 April 2010 (UTC)[reply]

Edition

[edit]

Hi. I looked for ways that this template is translated so it must be auto-translated {{{Autotranslate|1={{{1|}}}|2={{{2|}}}|base=documentation}}. Can anyone say if you can? Thanks--Diego Sanguinetti (talk) 17:59, 16 July 2010 (UTC)[reply]

Excusme is:
{{LangSwitch
|en={{documentation/en|1={{{1|}}}|heading={{{heading|}}}}}
|es={{documentation/es|1={{{1|}}}|heading={{{heading|}}}}}
}}

--Diego Sanguinetti (talk) 17:34, 17 July 2010 (UTC) {{Editprotected}} There are a lot of translations on the subpages but they are not used. Either unprotect this template for autoconfirmed users or invent a solution. -- RE rillke questions? 14:34, 21 July 2011 (UTC)[reply]

✓ Done, template is now autotranslated. Regards, -- ChrisiPK (Talk|Contribs) 14:44, 25 July 2011 (UTC)[reply]
Thank you :) -- RE rillke questions? 17:04, 25 July 2011 (UTC)[reply]

{{Editprotected}}

Now, we have a problem (template-loop) in the example section. -- RE rillke questions? 18:09, 31 July 2011 (UTC)[reply]
Don't know what the problem is. I partially expanded the examples to avoid a loop on the above page. If you have a solution, please post it. – Adrignola talk 19:19, 26 August 2011 (UTC)[reply]
So one case is fixed but there are many other. Really complicated ... -- RE rillke questions? 19:52, 26 August 2011 (UTC)[reply]
Checkmark This section is resolved and can be archived. If you disagree, replace this template with your comment. RE rillke questions? 21:00, 14 November 2011 (UTC)

template sandbox

[edit]

I would like to propose that if this page is transcluded on page with "sandbox" {{SUBPAGENAME}} than only Category:Sandbox templates is added. --Jarekt (talk) 15:05, 2 August 2011 (UTC)[reply]

Template loop problem solution

[edit]

{{editprotect}} Hi there. For or {{Recent}}, {{MIT}} and some other templates, I've got the same template loop problem as User:Rillke got in {{PermissionOTRS}} (see #Edition). The problem is: If a template contains a documentation through the template {{Documentation}}, and the documentation transcluded other templates localized through {{Autotranslate}}, there will be the warning due to the loop of {{Autotranslate}}, because {{Documentation}} is also localized through {{Autotranslate}}. To solve the problem, we may use the method of {{Autotranslate}}, but not the {{Autotranslate}} template directly. So, plz change the whole page source of Template:Documentation to:

{{documentation/{{Fallback
|documentation
|{{{lang|{{int:Lang}}}}}}}
|1={{{1|}}}
|2={{{heading|{{{2|}}}}}}
}}<noinclude>
[[Category:Autotranslated templates|Documentation]]
</noinclude>

I've tested in my sandboxs User:Tomchen1989/sandbox and User:Tomchen1989/sandbox1, it works just fine. --Tomchen1989 (talk) 15:32, 21 September 2011 (UTC)[reply]

✓ Done --Jarekt (talk) 15:54, 21 September 2011 (UTC)[reply]

purge button

[edit]

Somemone could add a purge button {{Purge}} like in en:Template:Documentation ? --Pixeltoo (talk) 17:26, 14 November 2011 (UTC)[reply]

In Template:Documentation/layout there seem to be some mechanism to call Template:Documentation/preload. I do not think it is working, or I do not know how to get it to work. Anybody familiar with it? --Jarekt (talk) 15:32, 14 December 2011 (UTC)[reply]

Just look at Template:Use VisualFileChange and click on an "edit"-link generated by this template. -- RE rillke questions? 15:50, 14 December 2011 (UTC)[reply]
Thanks, I never noticed "edit" so I always clicked the red link and was annoyed by the lack of preload. I guess for other clueless people like me, I modified Template:Editnotices/Namespace/Template to add a link above the edit box to allow preload with Template:TemplateBox/preload. I will merge 2 preload pages. --Jarekt (talk) 16:04, 14 December 2011 (UTC)[reply]

Import for en.wikipedia

[edit]

What was the rationale for doing so? If I am not mistaken, we lost internationalisation in the process. Jean-Fred (talk) 17:01, 24 July 2012 (UTC)[reply]

It was overwritten when I imported {{Infobox user}}. I have deleted the version created by me. Thanks for bring this up. --Sreejith K (talk) 20:18, 24 July 2012 (UTC)[reply]
You deleted the history-entry that you imported the template from wp but not the version you imported. -- Rillke(q?) 20:48, 24 July 2012 (UTC)[reply]
My bad. Apologies. --Sreejith K (talk) 22:18, 24 July 2012 (UTC)[reply]
Ok, thanks! Jean-Fred (talk) 08:36, 25 July 2012 (UTC)[reply]

Content=

[edit]

{{Edit protected}} en:Template:Documentation has a "content" parameter allowing the documentation to, "be fed directly as text."

<!--Last line of your template code--><noinclude>
{{Documentation
 | content =
(some documentation)
}}
</noinclude>

This would be convenient on Commons. For example, Template:Columns. Hyacinth (talk) 22:56, 11 August 2014 (UTC)[reply]

 Support This is needed to get some template docs work. Please add it. --Rezonansowy (talk) 16:36, 14 February 2015 (UTC)[reply]
What exactly does not work with the template as of now? And it would be kind if you could post a sample of what you expect that I or the admin fulfilling this request can history merge or copy&paste with this or into this template. -- Rillke(q?) 16:41, 14 February 2015 (UTC)[reply]
@Rillke: Hi, the template version on Commons lacks the {{{content}}} parameter which is used to embed doc context on template page (same page for transluction). I suggest to sync it with the last revision before the transition to Lua. It contains this parameter and some others, which are helpful in many tasks. The appearance of this template should be same or at least similar on every Wikimedia wiki, I think. There're some good sample on en.wiki doc – en:Template:Documentation#Usage. --Rezonansowy (talk) 21:51, 14 February 2015 (UTC)[reply]
@Rezonansowy: Neglecting the fact that on Commons, there is a translation system, it would be possibly look similar. What I'd like to know is what the Content parameter would be useful for. I understood what it does but on Commons, you can expect a lot of edits to template documentation as it has to be translated. So a separate page is favourable in most circumstances. However, if you convince me that this assumption is too narrow, no problem, then I'll see what I can do (including amending zillions of subpages for keeping i18n support). -- Rillke(q?) 22:06, 14 February 2015 (UTC)[reply]
@Rillke: OK, I'll show where I want to use it. I'd like to use {{Source template doc}} to got same apperance like on {{Wellcome Images}}. There's one doc template for all Source templates, but the present implementation of {{Documentation}} (our template) lacks the needed parameter and prevents me to to this well. With {{{content}}} it would be possible to create a documentation with a full translation with parameters template inside. That's why this parameter is needed. Basically, I need the ability to wrap custom text into the {{Documentation}} on the same page. And this feature is present already on en.wiki. Example:
<!--Last line of your template code--><noinclude>
{{Documentation
 | content =
{{Source template doc|desc=Images bearing this tag are placed in the category [[:Category:Images from Animalandia|Images from Animalandia]].
Most images from Animalandia are published under {{tl|GPL-3}}, but some are published under a Creative Commons License including the non-free {{tl|cc-by-nc-sa}}, which is not suitable for commons. See [http://herramientas.educa.madrid.org/animalandia/aviso-legal.php Aviso legal].}}}}
</noinclude>
--Rezonansowy (talk) 12:32, 16 February 2015 (UTC)[reply]
Mhm, sorry I still don't get the point why one can't place what is intended to pass to the content= parameter on the documentation subpage (Template:Lorumipsumdolor/doc, e.g. replacing Template:Wellcome Images/doc's content with {{Source template doc|desc=This tag places images in the category [[:Category:Files from Wellcome Images|Files from Wellcome Images]].}}) instead. -- Rillke(q?) 13:19, 16 February 2015 (UTC)[reply]
That's because we don;t want to create a /doc subpage for every template. --Rezonansowy (talk) 19:53, 16 February 2015 (UTC)[reply]
What kind of advantage to you expect by managing the template and its documentation in one page? -- Rillke(q?) 20:24, 16 February 2015 (UTC)[reply]
Less mess. I think it is time to make this parameter live on Commons. --Rezonansowy (talk) 23:33, 16 February 2015 (UTC)[reply]
If you find someone. I am not convinced. Less mess presumably means "easier to copy & paste". -- Rillke(q?) 23:49, 16 February 2015 (UTC)[reply]

Rezonansowy, it sounds like you are trying to create page similar to Template:GeoName/doc where one documentation template is used for over 1000 templates (without /doc subpage), or Template:Creator/documentation (used for 19k creator templates). I am still a little shaky on the purpose of "Content" as defined on English wikipedia, but from what I gathered you want to use it in order to pass a parameter or parameters to {{Source template doc}}, so the content of the documentation is created by {{Source template doc|1=...|2=...}} template. I can see that being useful. Documentation templates Template:GeoName/doc and Template:Creator/documentation only required template name which was provided by {{PAGENAME}}, but other documentation templates might require more parameters. --Jarekt (talk) 04:31, 17 February 2015 (UTC)[reply]

Yes! That's exactly what I mean. --Rezonansowy (talk) 18:06, 17 February 2015 (UTC)[reply]
@Rillke: ? --Rezonansowy (talk) 15:48, 19 February 2015 (UTC)[reply]
As previously said, not convinced and I won't spend my time with facilitating another approach of template documentation. Jarekt is admin, too. -- Rillke(q?) 08:48, 21 February 2015 (UTC)[reply]
@Jarekt: Pomożesz? I can help with documentation. --Rezonansowy (talk) 09:27, 21 February 2015 (UTC)[reply]
✓ Done the template, but still need to do documentation. --Jarekt (talk) 16:08, 21 February 2015 (UTC)[reply]
Also done with documentation update. --Jarekt (talk) 13:57, 26 February 2015 (UTC)[reply]
It's no nonsense, if it allows to display inline documentation with the look and feel of a /doc subpage. On m:Template:Documentation/doc there was still an esoteric Caveat about one additional transclusion (of the /doc subpage) that could be one transclusion too much. But I've never seen that outside of Patrick's hardcore tests, therefore I removed the Caveat on Meta. Meta is still at the last state without content=, maybe add it there, too, if it is useful for any copy+paste or import/export transwiki. –Be..anyone (talk) 01:05, 23 April 2015 (UTC)[reply]

Misleading notice when content= is used

[edit]

When |content=documentation text… is used, the notice "This documentation is transcluded from Example/doc." still appears on the page even if subpage /doc does not exists. For an example of such issue, see Template:Legend-small. I suggest suppressing showing this notice when parameter content= is used. —⁠andrybak (talk) 00:10, 23 August 2018 (UTC)[reply]

✓ Done: fixed it. Please take a look and check if the new conditional is OK in the template code. —⁠andrybak (talk) 00:26, 23 August 2018 (UTC)[reply]

Purge

[edit]

Is "purge" really not translated anywhere, or is it a problem on my side (I tested de es fr), or a problem on Meta with system messages only available here? I copied some languages as is today (de es fr pl pt ru), but stopped it, because it would be pointless if all languages (notably with other scripts, el ja ru uk zh etc.) will get updated translations "soon" here. –Be..anyone (talk) 01:05, 23 April 2015 (UTC)[reply]

@Be..anyone: I suggest using {{#invoke:TNT|msg|lang={{{lang|}}}|I18n/Documentation.tab|purge-link-display}}, which becomes: purge — ExE Boss (talk) 01:30, 31 July 2021 (UTC)[reply]

Subpages are not always sandboxes

[edit]

@AntiCompositeNumber: Your recent edit changed the behavior of this template on all template subpages, regardless of whether they’re sandboxes or not. For example, Template:Incorrect biology template usage/AssertIsNumber now shows the documentation of its parent templaate, even though it has one on its own. Even sandboxes may have their own documentation, for example Template:Century/sandbox/doc transcludes the sandbox template instead of the production one in the examples section. While falling back to the parent template’s documentation is nice, it should be just a fallback in case the subpage doesn’t have its own documentation, and maybe only if the subpage is a /sandbox subpage, as other subpages are likely to work entirely differently than their parent templates. —Tacsipacsi (talk) 22:09, 25 August 2021 (UTC)[reply]

@Tacsipacsi I've added some #ifexists. If {{Doc}} is transcluded from Template:Foo/bar, it will try Template:Foo/bar/doc, then Template:Foo/doc, then redlink Template:Foo/bar/doc. Just sandboxes would have probably covered most usecases, but I think it's better to do it this way unless it breaks something else. AntiCompositeNumber (talk) 22:44, 25 August 2021 (UTC)[reply]
@AntiCompositeNumber: Thanks! I don’t have actual examples where this newest behavior would cause issues, although theoretically parameter documentation (especially TemplateData, where the consumer has no clue about this smart transclusion thing) may be problematic. —Tacsipacsi (talk) 23:49, 25 August 2021 (UTC)[reply]
[edit]

Was something like what was proposed in #Some updates ever implemented? For an example, see the footer of w:Template:Documentation#See also.  —wqnvlz (talk·contribs);  19:56, 4 April 2022 (UTC)[reply]

Error

[edit]

Lua error: expandTemplate: template loop detected. Turkbenizistan (talk) 08:46, 15 January 2023 (UTC)[reply]