Template talk:Documentation

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

Add a line to Template:Documentation/preload[edit]

I suggest that we add the following line to Template:Documentation/preload directly above the <include<includeonly></includeonly>only>{{sandbox other|| line.

For help with this template, please post a comment on the [[Template_talk:{{ROOTPAGENAME}}|template talk page]].

This will help novice users get assistance. Yours aye,  Buaidh  04:14, 10 March 2017 (UTC)

But a similar notice would be needed on every page at Wikipedia (other than talk pages). People who do not know that questions should be on the talk page are very unlikely to see any messages in the documentation (banner blindness). Presumably the proposal arises from this TfD. Johnuniq (talk) 04:29, 10 March 2017 (UTC)

Suggestion: Add "Purge" suggestion to the "Create" link[edit]

At Wikipedia:Village pump (technical)#Template doc isn't transcluding, Mathglot (talk · contribs) has suggested that the "Create the missing documentation" link should be followed by something like "[Have a doc page but not seeing it? Try a purge.]" - with "purge" linked to do the action. This seems reasonable to me. -- John of Reading (talk) 19:29, 28 May 2017 (UTC)

  • I'd be ok with it. Many editors may not know that they need to purge a template page when creating or updating its documentation to see the most recent version of the /doc subpage. Matter of fact, it may be useful to update the [Purge] link on templates with created /doc subpages with something similar so editors actually know what the button does. Gestrid (talk) 19:39, 28 May 2017 (UTC)
  • And I'd appreciate it, as on the surface, it's a light-weight fix, but so annoying to track down on your own when you don't know what's going on. (I was trying this and trying that at home, changing cache, browsers, wondering about content distribution networks, all sorts of rabbit holes, not wanting to bother the good folks at Village Pump before making a reasonable effort to solve it on my own, finally giving up and getting the answer in a flash from John and Gestrid.) In retrospect, just a link would have been enough to short-circuit all that. Thanks again to both of you for responding and being proactive on this, and thanks in advance to unknown contributor who I hope can fix this! Mathglot (talk) 19:49, 28 May 2017 (UTC)
    At one time, making such a change would indeed have been a light-weight fix (example). But in January 2014, the whole documentation system was altered to Lua, and is now in Module:Documentation. Now, RexxS (talk · contribs) told me that when confronted with a Lua module, you start with the lines return p (at the bottom) and local p = {} (near the top). These apparently declare a table, named p, and send it back to the caller. But what fills in this table? At least in C, you have a fair chance of finding a function named main, from where you can start tracing it through. But there isn't an equivalent in Lua. This is why I state that it is unmaintainable (and indeed incomprehensible) to anybody outside the cabal. --Redrose64 🌹 (talk) 23:29, 28 May 2017 (UTC)
    @Redrose64: Well, the difference between what we think of as conventional C functions and Lua as implemented via Scribunto is that a single Lua module can contain an unlimited number of "main" functions. The table (often called 'p') is just a list of these functions, which is why it's returned. To find these functions, you have to read through the Lua module looking for 'public' function declarations that contain something that looks like this: p.some_name = or function p.some_name (assuming that the module returns 'p'). Then you've got the name of a function, "some_name", that can be invoked from wiki-text.
    In the case of Module:Documentation, the public functions are called message, makeWikilink, makeCategoryLink, makeUrlLink, makeToolbar, main, getEnvironment, sandboxNotice, protectionTemplate, startBox, makeStartBoxLinksData, renderStartBoxLinks, makeStartBoxData, renderStartBox, content, contentTitle, endBox, makeDocPageBlurb, makeExperimentBlurb, makeCategoriesBlurb, makeSubpagesBlurb, makePrintBlurb, addTrackingCategories
    Not that that's much help as Module:Documentation ironically has very little documentation in its /doc page. However, the comments in the module code are helpful. The section dealing with creating a /doc subpage is in function makeStartBoxLinksData, starting at line 495. I'll see if I can track down where the actual text is stored tomorrow, as it's by no means obvious (and it's getting a bit late here). --RexxS (talk) 00:30, 29 May 2017 (UTC)

Green box[edit]

Hello, I'm trying to localize the Module to Hebrew Wikipedia but I'm having troubles. I understand that I shall only edit the Module:Documentation/config. However when I try to test case it the green background don't appear. However, the green box below is working fine. How can I fix it? What shall I check? (Please tag me) Sokuya (talk) 18:51, 14 June 2017 (UTC)

Sokuya, the styling is set in the main site css. see MediaWiki:Common.css and search for the "template-documentation" class definition. so, you probably want to add the same thing to he:MediaWiki:Common.css. Frietjes (talk) 00:53, 15 June 2017 (UTC)