Template talk:Documentation/Archive 8: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Fixed Lint errors on this page (missing end tags)
 
(9 intermediate revisions by 2 users not shown)
Line 79:
 
[[Special:Contributions/90.222.250.124|90.222.250.124]] ([[User talk:90.222.250.124|talk]]) 10:40, 11 January 2013 (UTC)
:{{done}}. <big>[[User:-- -- --|<span style="color: #6633cc">'''--'''</span>]] [[User talk:-- -- --|<span style="color: #6633cc">'''--'''</span>]] [[Special:Contributions/-- -- --|<span style="color: #6633cc">'''--'''</span>]]</big> 04:38, 16 January 2013 (UTC)
 
{{Collapse top|title=List of interwiki links}}
Line 212:
 
Thank you. – '''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%;">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 20:42, 20 June 2013 (UTC)
:[[File:Pictogram voting question.svg|20px|link=|alt=]] '''Question:'''<!-- Template:EP --> I've just tried viewing some template doc pages when logged out - and they all look normal: there is [[:File:Template-info.png|an image]] and the heading "Template documentation" at the left, then a gap, then "[view] [edit] [history] [purge]" at right. The relevant styling is <sourcesyntaxhighlight lang=css>.mw-content-ltr .editsection, .mw-content-rtl .mw-content-ltr .editsection { float: right; margin-left: 5px; }</sourcesyntaxhighlight> Do you have any custom CSS that is moving the links? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 20:56, 20 June 2013 (UTC)
::The links are showing wrong (left of the heading) for me, too. Sandbox looks fine. Changing the class name to "mw-editsection" also allows to float the links right (default behavior before the MediaWiki change) instead of next to the heading with some custom CSS (also provided as Gadget here on enwiki). --[[User:Patrick87|Patrick87]] ([[User talk:Patrick87|talk]]) 21:26, 20 June 2013 (UTC)
:::{{done}} -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 21:31, 20 June 2013 (UTC)
Line 278:
::The subtemplate [[Template:Documentation/preload]] is not protected, so you may make the required changes yourself. Regards &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 08:51, 3 September 2013 (UTC)
:::You are quite right. I need to get more sleep. [[User:Pigsonthewing|Andy]] has now made the change. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:28, 3 September 2013 (UTC)
 
== Avoid categorizing template sandboxes ==
 
Template categories are polluted by template sandboxes. I suggest to modify [[Template:Documentation/preload]] in such a way that categories are not added in sandbox subpages, as shown [https://en.wikipedia.org/w/index.php?title=Template:Documentation/preload/sandbox&diff=prev&oldid=580957727 here]. Of course, this won't help for existing docs, but maybe we could run a bot or script to deal with those. [[User:Cenarium|Cenarium]] ([[User talk:Cenarium|talk]]) 22:46, 9 November 2013 (UTC)
:I concur. I've occasionally made {{diff|Template:Service awards/doc|prev|503649690|the same change}} to /doc pages myself (I think I borrowed this trick from someone else, though I don't remember who). It would be a good idea to have it in the preload for new doc pages. I don't think the &lt;includeonly> tags you added are really needed though (it doesn't make any difference if the #ifeq is parsed on the preload page itself). –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 15:22, 10 November 2013 (UTC)
::Yes those aren't necessary. Debresser reverted this proposed solution at [[Template:Reviewer topicon/doc]] so I've asked for input. With regards to the stated objections, the sandbox preload includes the doc template and according to past discussions here, it can be helpful to have it there (it shows the template sandbox template for example), so simply removing the doc from the sandbox doesn't seem advisable. It is problematic to have those template sandboxes in categories, one reason being it becomes harder to find the templates one is searching for - mechanically by increasing the number of categorized pages (some categories have a proportionally large number of template sandboxes). The added code is small and outside of the space users normally edit, so it shouldn't bother them. [[User:Cenarium|Cenarium]] ([[User talk:Cenarium|talk]]) 23:03, 13 November 2013 (UTC)
::: I reverted mainly because this is not regularly implemented on documentation pages and would need wide consensus, probably on the village pump. Some short reactions to this proposal. 1. It is ugly code. 2. It should probably filter both "sandbox" and "Sandbox", or is this code capitalization neutral? 3. I'd prefer a more general change to the software that would remove all categories automatically from sandboxes, apart from an automatically generated "sandbox" category. [[User:Debresser|Debresser]] ([[User talk:Debresser|talk]]) 00:30, 14 November 2013 (UTC)
:::: The code could be moved to a template and the template used instead of the #if on the doc pages. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 07:57, 14 November 2013 (UTC)
::::The proposed code could easily be made case-insensitive. However, this is a rare case where the normal fix is to move the page to the right title. Most templates linking to sandboxes only check for /sandbox (e.g. {{tl|Documentation/end box}}, {{tl|Used in system}}, the [[Template:Editnotices/Namespace/Template|edit notice]], etc). Odd /Sandbox cases do not merit extra preload code that is unnecessary on most pages. If there's a special case, the /doc page for that special case can be edited directly.
::::Regarding the software changes, I'm not sure that's likely to happen; we shouldn't avoid acting because we the hope the developers might make a change. On-wiki changes are faster to make than changes to MediaWiki's core.
::::The normal MediaWiki mechanisms for treating pages differently from others are [[mw:Help:Namespaces|namespaces]] and [[mw:Help:Magic words#Behavior switches|behaviour switches]] (e.g. <nowiki>__DISAMBIG__</nowiki>). I don't like the idea of core MediaWiki code treating pages differently based on title. If a change were to be made in MediaWiki, I'd like to see a &lt;nocat> tag to suppress categories from wiki code inside it. If the Documentation template detected it is not on the main template page, it would wrap the transclusion of /doc in &lt;nocat>. This would also be a clean way to suppress categories when demonstrating templates in examples. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:29, 14 November 2013 (UTC)
::::: The more I think about this, the more I get to agree with the proposal of adding the code. [[User:Debresser|Debresser]] ([[User talk:Debresser|talk]]) 18:59, 1 December 2013 (UTC)
:{{od|::::}}I've {{diff|Template:Documentation/preload|prev|584583741|made the change}}. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:28, 4 December 2013 (UTC)
 
== Module:Documentation ==
 
{{Edit protected|answered=yes}}
Hi could someone help me do the rest of [[simple:module:documentation]] because all I need to add is mirror and diff and few other things from documentation start box and end box please visit [[simple:template:documentation/sandbox]] to see the preview I doint know how script in lua but someone helped me to do it because they did it on fr wiki and I ask them to help me do it on simple wiki they doint know how to do it all so pull someone who knows how to script in lua please help me [[Special:Contributions/86.159.74.81|86.159.74.81]] ([[User talk:86.159.74.81|talk]]) 11:52, 4 August 2013 (UTC)
:[[File:Red information icon with gradient background.svg|20px|link=|alt=]] '''Not done:'''<!-- Template:EP --> Sorry, but if your code is incomplete then it's too early to file an edit request. Edit requests are for code that is already finished and ready to be added to protected pages - have a look at [[Wikipedia:Edit requests]] for more details. I see you've posted on [[Wikipedia:Lua requests]], which is the right place to get help with this kind of thing. Have patience, and someone will look at your code eventually. This is quite a big job you're asking people to do, so it shouldn't be surprising that people haven't replied straight away. Best — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 13:17, 4 August 2013 (UTC)
::ok [[Special:Contributions/86.159.74.81|86.159.74.81]] ([[User talk:86.159.74.81|talk]]) 13:20, 4 August 2013 (UTC)
:::someone has created [[Module:documentation]] and is being tested in [[template:documentation/sandbox]] on en wiki [[Special:Contributions/86.176.186.77|86.176.186.77]] ([[User talk:86.176.186.77|talk]]) 11:49, 25 August 2013 (UTC)
::::hi it I have asked someone to do it because I doint know how to code in lua. he has done some more but all that needs to be added is mirror and diff and some other things to it [[Special:Contributions/94.0.201.140|94.0.201.140]] ([[User talk:94.0.201.140|talk]]) 17:38, 6 December 2013 (UTC)
 
== Integrating TemplateData ==
I want to standardize the inclusion or placement of TemplateData. As it is now, TemplateData is included on doc pages in several different ways; sometime included in the documentation, other times in template itself, either directly or transcluded from /TemplateData. This is not a desirable situation. I would like to establish a standard on where and how to include TemplateData into the documentation (or elsewhere). So,
 
* Where should TemplateData be placed?
*# In the template page
*# In the /Documentation (/doc) sub page
*# In the /TemplateData (/[...]data) sub page
* Where should it be placed visually?
*# Inside the documentation area
*# Outside/below the documentation area
* How should it be displayed?
*# Plain/text only
*# With its own background color
 
Let the discussion commence! Personally, I'd prefer 3/2/2. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 12:24, 15 December 2013 (UTC)
 
:Regarding placement I'd vote for ''"3. In the /TemplateData sub page"''. It's the most flexible possibility and allows us to easily change the appearance you're asking for in the other two bullet point whenever necessary. If we want another placement we can quickly change the position of the transclusion in the template &ndash; something we're not able to when we put TemplateData into the /Doc subpage or even the template page itself. For the other two bullet points I have no real preference. --[[User:Patrick87|Patrick87]] ([[User talk:Patrick87|talk]]) 15:00, 15 December 2013 (UTC)
* 3/2/2 --<span style="color:Turquoise">''''' &nbsp;[[User:Gadget850|Gadget850]]'''''<sup>[[User talk:Gadget850|&nbsp;''talk'']]</sup></span> 21:00, 15 December 2013 (UTC)
*I would support /doc/data, /TemplateData, or similar (/data is probably no good because it may contain raw data lookup for the template), and would further suggest that {{tl|documentation}} should be rewritten to automatically include some sort of interpretation of the template data file after the documentation page. This may require splitting the "The above documentation is transcluded from Template:X/doc." and "Editors can experiment in this template's sandbox and testcases pages. Please add categories to the /doc subpage. Subpages of this template." footers. [[User:Vanisaac|Van]][[User talk:Vanisaac|Isaac]]<sub><small>[[WP:WikiProject Writing systems|WS]] [[WP:WikiProject Heraldry and vexillology|Vex]]</small></sub><sup style="margin-left:-7.0ex">[[Special:Contributions/Vanisaac|contribs]]</sup> 02:00, 16 December 2013 (UTC)
:Portuguese Wikipedia uses a /Dados subpage and transcludes it to the /doc subpage using [[:pt:Template:Documentação dos parâmetros]], but what I would prefer is the [[bugzilla:54140|new namespace proposed on bugzilla]] (see also [[bugzilla:50512#c0]]). [[User talk:Helder.wiki|Helder]] 11:38, 18 December 2013 (UTC)
 
Not much input, but 3/2/2 seems to have consensus; a separate sub page, below the documentation, in its own color. I suggest we put the template data in /doc/data and auto-transclude the (raw) data from there to put below the documentation footer. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 13:59, 14 January 2014 (UTC)
:One additional thing. I've been wondering for a while why the VE team didn't go with a json contentmodel blob on a fixed page, but with a tag. We should ask them, because these JSON in wikitext blobs are just weird to me and if there is nothing blocking a transition to fix that, then I think we should move them into a pure separate JSON page at some point. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 17:08, 14 January 2014 (UTC)
:{{ping|Edokter}} Nah, don't put it into <code>/doc/data</code>. A simple <code>/data</code> subpage (or <code>/templatedata</code> if we want a more descriptive name at the cost of slightly less convenience) as a direct subpage of the template itself is totally suitable. Let's avoid unnecessary nesting. --[[User:Patrick87|Patrick87]] ([[User talk:Patrick87|talk]]) 18:08, 14 January 2014 (UTC)
::I'd agree with /data or /templatedata . Do you want to get something done in the sandbox for any interested to view? Could also be worth updating {{tl|Documentation subpage}} to work on both /doc and whatever the subpage ends up being called and it could include pages into [[:Category:Template data pages]]. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 19:15, 14 January 2014 (UTC)
:::Not set on anything myself, but as Helder pointed out, /data may be used by some templates for their own purposes. /templatedata it is then. Go ahead with the sandbox. I have some CSS [[User:Edokter/common.css|here]] for some basic styling ready. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 19:59, 14 January 2014 (UTC)
::::Anybody has an idea on how to search for such potential <code>/data</code> subpages used for other purposes? This way we could evaluate if it is a real or only an academic problem (if we want to use the abbreviated name at all; personally I like <code>/templatedata</code> more anyway). --[[User:Patrick87|Patrick87]] ([[User talk:Patrick87|talk]]) 20:07, 14 January 2014 (UTC)
 
:::::I've done a start in {{tl|documentation/sandbox2}} and it's on {{tl|Big}} as a demo. Needs more work doing on it. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 22:19, 14 January 2014 (UTC)
::::::Looks good so far, but I would separate the header (not nest them). Then both can be styled using the .mw-templatedata-doc-wrap and .templatedata-header classes. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 22:45, 14 January 2014 (UTC)
::::::Two suggestions: (i) reduce the gap at the top so that it's the same as the one above [[Template:Documentation/end box|the end box]]; (ii) use a background colour that is not the same as the documentation background - possibly a light blue? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 22:49, 14 January 2014 (UTC)
:::::::The reason I suggested the following CSS. I can put it in Common.css. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 22:58, 14 January 2014 (UTC)
<syntaxhighlight lang="CSS">
/* TemplateData box */
.mw-templatedata-doc-wrap,
.templatedata-header {
border: 1px solid #AAA;
background-color: #ECF4FC;
margin: 0.2em 0;
padding: 0 1em;
}
</syntaxhighlight>
 
:Also, would it be better to put the templatedata in-between the documentation and the bottom box rather than at the end? -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 23:11, 14 January 2014 (UTC)
::Technically, it is not part of the documentation. I would say no. <span style="font-family:'Trebuchet MS'"> — [[User:Edokter|<span style="color:#008"><i>E</i>dokter</span>]] ([[User talk:Edokter|<span style="color:#080">talk</span>]]) — </span> 23:17, 14 January 2014 (UTC)
 
== Module:Documentation ready to deploy ==
 
I've been working on [[Module:Documentation]] for a while now, and it is just about ready for deployment. It is intended to be a workalike of the current {{tl|documentation}} template, so it should have all the familiar features. It is also intended to be portable, and it has a configuration module at [[Module:Documentation/config]] that can be edited for use with different languages and wiki setups. It also has one new parameter, the {{para|page}} parameter, where you can set the "current" page for testing purposes. You can use {{tl|documentation/sandbox}} to test it on wiki pages. Test cases are at [[Module:Documentation/testcases]] ([[Module talk:Documentation/testcases|run tests]]), and there are also some old test cases at [[Template:Documentation/testcases]]. Having {{tl|documentation}} in Lua means that we have a lot more flexibility, so if there are new features that people have been wanting to put in then now would be a good time to ask. And please have a play around with it, see if you can find any bugs, and generally see what you think. <small>Pings for recent participants on this talk page: {{ping|Edokter|Redrose64|Patrick87|PartTimeGnome|Cenarium|Debresser|WOSlinker}} {{ping|Gadget850|TheDJ|VanIsaac|Helder.wiki}}</small> — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 07:26, 28 January 2014 (UTC)
 
:Excellent work! Would it be possible to have a show/hide button at the top right? Would be very useful when previewing/editing a template with a large doc page. Thanks. --[[User:NSH002|NSH002]] ([[User talk:NSH002|talk]]) 12:55, 29 January 2014 (UTC)
 
::That's an interesting idea. I've created a mock-up of how this would look in [https://en.wikipedia.org/w/index.php?title=User:Mr._Stradivarius/Sandbox&oldid=593070827 my sandbox]. I think it may be more useful for Lua modules than templates, as the template output almost always comes above the documentation, whereas for Lua modules it is the other way round. Are you thinking that it would save scrolling back to the edit window ''after'' you have previewed the template output? Also, this would be quite a big change internally for the template, as we have to switch everything from {{tag|div}} tags to {{tag|table}} tags or the collapsing doesn't work. For that reason, I'd want to make sure that there's a consensus for this change before deciding to implement it. (Perhaps this could be discussed after the initial switch to the module.) — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 05:29, 30 January 2014 (UTC)
 
:::To clarify, the idea is to reduce the amount of scrolling up/down between the edit box at the bottom and the template output at the top. I like to do my edits in one big go, so I do a lot of tweak/preview cycles. Would be even better if it maintained its state between change/preview cycles, but I don't suppose that would be easy! I trust your judgement on the best way to proceed. --[[User:NSH002|NSH002]] ([[User talk:NSH002|talk]]) 11:00, 31 January 2014 (UTC)
 
::::That's fair enough. I don't think it's possible for it to save its state, though, at least not just with template/module code. I think we should wait to see what others say about this, and then implement it on the module's next iteration if it seems to have support. In fact, I think I will go and make the switchover now. Please keep an eye out for documentation templates that behave strangely! — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 11:12, 31 January 2014 (UTC)
 
:A feature suggestion: It would be nice if there were some way to automatically change the content in the template sandbox to match that in the main version, or the other way around (e.g. by clicking a link that says "Update sandbox" or something like that). This would be useful since many edits of that kind are done when work on a sandbox version is finished and it's being migrated to the main template. There already is functionality of this kind (the "clone" link), but it only works when the sandbox version does not exist. [[User:APerson|APerson]] ([[User talk:APerson|talk!]]) 17:38, 31 January 2014 (UTC)
 
::Unfortunately, the cloning isn't perfect, as the MediaWiki feature it is based on wasn't originally designed for this kind of use. Anything that is contained in {{tag|noinclude}} tags would not copied across, which would mean we would lose the documentation. Copying and pasting is probably the way to go until we can work out a way to transfer everything over without being altered. I will note that it works very well for Lua modules, however, as they generally don't (can't?) use tags like {{tag|noinclude}}. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 18:07, 31 January 2014 (UTC)
 
:::I wasn't talking about the documentation being copied, just the template code. This would be useful when working with large and complex templates. [[User:APerson|APerson]] ([[User talk:APerson|talk!]]) 18:48, 31 January 2014 (UTC)
 
::::I did mean the template code. Specifically, the part that looks like this:
<pre>
<noinclude>
{{documentation}}
</noinclude>
</pre>
::::You generally want to include this when copying code to and from the sandbox, but this isn't currently possible as the {{tag|noinclude}} tags and all the code contained within them are stripped. We would need to change the MediaWiki software in order to copy code with no changes at all. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 03:05, 1 February 2014 (UTC)
 
== VisualEditor makes [view] become [edit source] ==
 
When I enable VisualEditor, "[view]" from the row besides "Template/Module documentation" ([view] [edit] [history] [purge]) becomes [edit source]. Can you fix it? Thank you. --[[User:Nullzero|Nullzero]] ([[User talk:Nullzero|talk]]) 13:59, 31 January 2014 (UTC)
:The {{tl|documentation}} template has been behaving this way for a while now, and I agree that it is a bit annoying. We could fix it with inline styling, once we figure out what the correct styling is, but I have a feeling that it might be better to fix it at the source. The first step would be to find out where the mw-editsection class lives, as that's the one that is being altered by VisualEditor. I'm not sure where it is off the top of my head though. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 14:57, 31 January 2014 (UTC)
::Use <code>mw-editsection-like</code> instead of <code>mw-editsection</code> see discussion at - [[Wikipedia:Village_pump_(technical)/Archive_117#Template_documentation_header_problem]] --[[User:Lam-ang|Lam-ang]] ([[User talk:Lam-ang|talk]]) 15:35, 31 January 2014 (UTC)
:::Nice find, thank you. :) It should be fixed now. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 17:55, 31 January 2014 (UTC)
::::Ah, one problem with this: [[MediaWiki:Gadget-righteditlinks.css]] ("{{int:gadget-righteditlinks}}") no longer works on these links now the class has been changed. The simplest fix would be to update the gadget to function on both <code>.mw-editsection</code> and <code>.mw-editsection-like</code>. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:36, 31 January 2014 (UTC)
:::::Ok, I've applied a fix to [[MediaWiki:Gadget-righteditlinks.css]]. It appears to be working in my tests, but let me know if you notice anything strange. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 03:41, 1 February 2014 (UTC)
:{{od|::::}}Thank you! That looks fine. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 16:21, 1 February 2014 (UTC)
 
== Script error ==
 
[[Template:Infobox element]] is currently showing a script error indicating that "The time allocated for running scripts has expired." [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 16:37, 3 February 2014 (UTC)
:The problem appears to be in the <code>content</code> function&#160;– replacing the {{tlc|documentation}} on that template with {{tlc|<nowiki/>#invoke:documentation|content}} generates the same error when I preview the page.
:I'm not an expert on Lua scripts, but I think the problem is related to the <code>[[mw:Extension:Scribunto/Lua reference manual#frame:preprocess|frame:preprocess]]</code> call that reads the /doc page. {{abbr|AIUI|As I understand it}}, it causes the time taken to parse the /doc page to count as time used by the script. [[Template:Infobox element]] has a largish /doc page that transcludes a few complex templates, so it takes longer to parse and exceeds the limit on script execution time.
:The Scribunto documentation indicates <code>[[mw:Extension:Scribunto/Lua reference manual#frame:expandTemplate|frame:expandTemplate]]</code> is faster than <code>frame:preprocess</code> for expanding a single template. However, I'm not sure the speed improvement would be enough. [[User:Mr. Stradivarius|Mr. Stradivarius]], you've got more experience at this than me. Any ideas how we could handle this? Did I get anything wrong in my analysis? –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:58, 3 February 2014 (UTC)
::Nope, your analysis seems spot on. I've changed the module to use frame:expandTemplate instead of frame:preprocess, and now it shows the full doc page when used with <code><nowiki>{{#invoke:documentation|content}}</nowiki></code>. But it still isn't fast enough when using plain {{tl|documentation}}. Part of the reason is that it also needs to expand {{tl|pp-template}}, which is itself a fairly heavy template. I removed the navboxes from the bottom of the /doc page, and that did the trick. Frietjes' suggestion of removing {{tl|Periodic table}} from the navbox template would likely also work, as that template is pretty heavy too. If you don't want to remove anything from the /doc page, though, you could either use {{tl|documentation/old}}, which I've just copied from the pre-Lua {{tl|documentation}}, or you could convert some more of the templates on that page to Lua. {{tl|Periodic table}} seems the best target to me. Also, {{tl|pp-meta}} will probably be undergoing a rewrite soon, so that should speed things up. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 23:05, 3 February 2014 (UTC)
:::{{reply to|Mr. Stradivarius}} I now get a "Cannot find section" error when I try to edit any of the transcluded sections from the page transcluding the documentation. the links work fine from the /doc page, but not from the main template (e.g., clicking on a section edit link in [[template:Infobox dam]]). [[User:Frietjes|Frietjes]] ([[User talk:Frietjes|talk]]) 15:23, 6 February 2014 (UTC)
::::Hmm... The links are trying to edit a section on the template itself, not the documentation. I think this might be a limitation/bug of Scribunto: when a Lua script expands a template, MediaWiki doesn't keep track of where the headings came from as it does for templates transcluded normally. This is possibly one for [[mw:Bugzilla|Bugzilla]]. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:30, 6 February 2014 (UTC)
:::::Yes, this is a Scribunto bug, and will need to be fixed in the extension itself. Now that you post this here, I do remember reading about this bug somewhere before. I couldn't find it in Bugzilla when I looked just now, though. — '''''[[User:Mr. Stradivarius on tour|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius on tour</span>]]''''' <sup>[[User talk:Mr. Stradivarius on tour|♪ talk ♪]]</sup> 22:54, 6 February 2014 (UTC)
:::::Perhaps this is serious enough that we should revert back to the old template until it is fixed? — '''''[[User:Mr. Stradivarius on tour|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius on tour</span>]]''''' <sup>[[User talk:Mr. Stradivarius on tour|♪ talk ♪]]</sup> 23:03, 6 February 2014 (UTC)
::::::Aha, this bug doesn't occur when frame:preprocess is used, only frame:expandTemplate. I've reverted back to the frame:preprocess version, even though it may take some pages over the 10-second limit. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 04:46, 7 February 2014 (UTC)
:::::::I've found the Bugzilla bug - it's [[bugzilla:55525]], and has already been fixed. The fix should be live on Wikipedia on the 13th Feb, which is why it was still affecting us here. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 06:13, 7 February 2014 (UTC)
:{{od|::::::}}Good work, both to you and the developers! I did look for a bug last night, but wasn't able to find it. I was also worried we might be waiting a while for a fix; it's excellent to find it's already fixed! –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:05, 7 February 2014 (UTC)
 
== Module sandbox now shows main doc ==
 
[[MediaWiki:Scribunto-doc-page-show]] now uses {{tl|documentation}} which uses [[Module:Documentation]], and I think that is responsible for a new, possibly unintended, feature. In the past, viewing [[Module:Convert/sandbox]] would show [[Module:Convert/sandbox/doc]] at the top. It now shows [[Module:Convert/doc]] instead. Can it be fixed to show the main doc only if a sandbox doc page does not exist? [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 10:27, 7 February 2014 (UTC)
:That's an intended feature - the intention was to imitate what the {{tl|documentation}} template does in the template namespace. This was also the behaviour for sandbox modules without /doc subpages since my edit [https://en.wikipedia.org/w/index.php?title=MediaWiki:Scribunto-doc-page-does-not-exist&diff=587369069&oldid=585167583 here], and you're right, it became the behaviour for sandbox modules with documentation pages after [[MediaWiki:Scribunto-doc-page-show]] was switched to use {{tl|documentation}} [https://en.wikipedia.org/w/index.php?title=MediaWiki:Scribunto-doc-page-show&diff=593276252&oldid=585167540 here]. [[Module:Convert/sandbox/doc]] is the only place I'm aware of that does something like this - would you be able to manage with putting it in the main docs or in an edit notice instead? — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 16:29, 7 February 2014 (UTC)
::Now works after [//en.wikipedia.org/w/index.php?title=MediaWiki:Scribunto-doc-page-show&diff=594413429&oldid=593276252 this edit]. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 20:01, 7 February 2014 (UTC)
:::I agree with [[User:Mr. Stradivarius|Mr. Stradivarius]]; that sandbox doc page would be better as an edit notice; it's whole content is only relevant to people editing the page. –&#160;'''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 21:12, 7 February 2014 (UTC)
::::Thanks WOSlinker. Not many people will want to inspect a module sandbox with no thought for editing it, and IMHO the general docs are not much help on the sandbox page. After saving an edit to the sandbox, it is useful to see the info in the sandbox doc page. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 22:12, 7 February 2014 (UTC)
:::::I don't think we should have a hack that only works for modules. If this is the desired behaviour, how about putting it into the module proper so that it will work this way for templates and other pages too? — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:31, 8 February 2014 (UTC)
::::::Yes, I think that would be desirable. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:22, 8 February 2014 (UTC)
 
== Line 402 (protectionlevel) ==
{{Edit protected|ans=yes}}
In line 402 of Module:Documentation an lua protectionlevel function - mw.title.new("text").protectionLevels["action"], should be used instead of the parser function "protectionlevel". See also [[mw:Extension:Scribunto/Lua_reference_manual#Title_objects]], where the Lua function protectionLevels is documented.--[[User:Snaevar|Snaevar]] ([[User talk:Snaevar|talk]]) 16:56, 28 February 2014 (UTC)
* {{Ping|Mr. Stradivarius|Jackmcbarn|Anomie}} as I know you are all Lua geniuses and competent with protection level stuffs... — <span class="nowrap">&#123;&#123;U&#124;[[User:Technical 13|Technical 13]]&#125;&#125;</span> <sup>([[User talk:Technical 13|t]] • [[Special:EmailUser/Technical 13|e]] • [[Special:Contribs/Technical 13|c]])</sup> 01:19, 13 March 2014 (UTC)
::I'll take a look at it. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:22, 13 March 2014 (UTC)
:::{{ping|Jackmcbarn}} I see that <code>title.protectionLevels</code> gives a table like this:
<syntaxhighlight lang="lua">
{
["edit"] = {
"sysop"
},
["move"] = {
"sysop"
}
}
</syntaxhighlight>
:::Why not just like this?
<syntaxhighlight lang="lua">
{
["edit"] = "sysop",
["move"] = "sysop"
}
</syntaxhighlight>
:::Can there be more than one protection level for each protection type? And am I always guaranteed to find the highest protection level by using <code>title.protectionLevels.edit[1]</code>? Enquiring minds need to know. :) — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 02:21, 13 March 2014 (UTC)
::::For now, yes, just use [1]. In the future, an update to MediaWiki could allow multiple protection levels on the same action. (Beware that if the page is unprotected, the return value may be {}, not always { edit = {} } as you might expect. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 02:50, 13 March 2014 (UTC)
:::::Thanks, that helps a lot. I've now updated the module to use protectionLevels, so I guess we can consider this request answered. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 04:08, 13 March 2014 (UTC)
 
== Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value). ==
 
I've exported a few modules and templates from MediaWiki and imported them into my own wiki and as soon as I open a template (e.g. Template:Documentation, Template:Divbox, Template:Ombox), I get the following script error:
 
<pre>
Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value).
 
Backtrace:
 
(tail call): ?
Module:Documentation:409: in function "protectionTemplate"
Module:Documentation:132: ?
(tail call): ?
mw.lua:553: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:73: in function "handleCall"
MWServer.lua:266: in function "dispatch"
MWServer.lua:33: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?
</pre>
 
I searched for hours on Google to find a solution, but no luck. Any help would be highly appreciated. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 23:07, 18 March 2014 (UTC)
:This module relies on features new to MediaWiki 1.23 and/or the latest git version of [[mw:Extension:Scribunto]]. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 00:01, 19 March 2014 (UTC)
::I've fixed the module so that it won't produce a script error if protectionLevels is not present. However, if you don't have protectionLevels on your wiki you might want to use [https://en.wikipedia.org/w/index.php?title=Module:Documentation&oldid=598387866 this version] of the module which uses the <code><nowiki>{{PROTECTIONLEVEL}}</nowiki></code> parser function, as otherwise the protection icons in the top-hand-corner of the page won't work. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 00:54, 19 March 2014 (UTC)
:::Thanks, but I have no idea what you are suggesting. I have installed MediaWiki 1.22.4, I have no clue why/how I should or should not have protectionLevels on my wiki. I'm not entirely sure what I shall do now. Shall I use the old version or your fixed version? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:06, 19 March 2014 (UTC)
::::Either upgrade your Scribunto extension to the latest version available, or use the version of the module that Mr. Stradivarius showed you. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 01:13, 19 March 2014 (UTC)
:::::I tried the latest version of Scibunto, but it didn't help. Then I tried the latest Module:Documentation and it seems to work. But I'm still missing all the images which the templates depend on. Also the background of the template documentation is green on wikipedia, white on my wiki. Well, it's not really an issue, just a difference. Do you know, if there is a way to grab all the necessary images from wikipedia (e.g. Imbox_notice.png) which are necessary for a template? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:26, 19 March 2014 (UTC)
::::::Not sure about the images. For the green background, you also need to import [[MediaWiki:Common.css]]. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 03:22, 19 March 2014 (UTC)
:::::::Yep, did that, or at least parts of it. I guess I was not thorough enough. Thx for all your help. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:16, 19 March 2014 (UTC)
::::::::The important class from Common.css is the <code>template-documentation</code> class. It looks like you also need to import [[MediaWiki:Common.js/IEFixes.js]] to make the <code>iezoomfix</code> class work properly, but that only matters if you are interested in supporting Internet Explorer 8. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 05:36, 19 March 2014 (UTC)
:::::::::Info for using images from Wikimedia Commons - [[mw:Manual:$wgUseInstantCommons]] and [[mw:InstantCommons]]--[[User:Lam-ang|Lam-ang]] ([[User talk:Lam-ang|talk]]) 06:03, 19 March 2014 (UTC)
::::::::::Thanks for all your help and info. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:17, 20 March 2014 (UTC)