Wikipedia talk:Lua/Archive 2

From Wikipedia, the free encyclopedia

Archive 1Archive 2Archive 3Archive 4Archive 5

Wikitext tables?

Apparently "it's an absolute nightmare coding wikitext tables in Lua". But a table opened with HTML <table> cannot have wikicode for any of its cells (try it in a sandbox if you don't believe me). So can we not convert to Lua templates that open tables until this is fixed? Otherwise we end up breaking an unknown number of articles. --NE2 07:07, 14 January 2014 (UTC)

Why should I have to deal with concatenations and string.format() calls to produce wikitext when I can just use Module:HtmlBuilder instead? It's certainly possible to use wikitext tables, but it's nowhere near as clean and simple as coding the HTML equivalent within Lua. In either case, NE2 is attempting to use the template/module in question, {{jcttop/core}}, contrary to its design. It is supposed to be used with templates of the {{jctint/core}} family, which properly uses HTML syntax. The use of wikitext with this template is unsupported, and otherwise violates the internal standards of the projects that use this template. Therefore, I don't feel I should have to design modules to support a technique that is destined for oblivion anyway. -happy5214 07:33, 14 January 2014 (UTC)
@NE2: I'm pretty sure you can actually use wikitext table syntax and html table syntax together. Could you give us an example of a page where this isn't working? — Mr. Stradivarius ♪ talk ♪ 08:00, 14 January 2014 (UTC)

Here's an example:

More information Heading 1, Heading 2 ...
Heading 1Heading 2
Foo Bar
Close

Mr. Stradivarius ♪ talk ♪ 08:03, 14 January 2014 (UTC)

I may have missed the point, but it looks as if NE2 is saying that a module is creating a table that starts with the html <table>, and that wikitext cannot then be used in the table. If I had time I would have a look at the module because there should be a way to conveniently build a table using wikitext. Johnuniq (talk) 08:51, 14 January 2014 (UTC)
I was just going to reply saying that you're right and doing it the other way around doesn't work. For example, this is what I get when I tried doing it that way round on this page:
<table class="wikitable">
<tr><th>Heading 1</th><th>Heading 2</th></tr>
|-
| Foo
| Bar
</table>
However, then I tried it inside {{collapse top}}, and something in that template's CSS makes it work:
More information same template inside {{collapse top}}, Heading 1 ...
Close
This makes me think that there must be a hack that we can use in the Lua module to make the insertion of wikitext table markup work somehow. — Mr. Stradivarius ♪ talk ♪ 09:12, 14 January 2014 (UTC)
Ok, now I see - {{collapse top}} itself uses wikitext table syntax, which is why the wikitable syntax works inside it, even when surrounded with HTML table markup. Happy5214, if you don't want to convert the whole of your module to use wikitext tables, you might be able get away with just replacing the opening and closing <table>...</table> tags with {| and |}. Although probably it would be best for someone to write Module:TableBuilder, which would do the same thing as Module:HtmlBuilder, only for wikitext tables rather than HTML. — Mr. Stradivarius ♪ talk ♪ 10:00, 14 January 2014 (UTC)
I added the change to the sandbox, which can be accessed with {{jcttop/core/sandbox}}. I'll hold off on changing Module:Jctbtm until we know if this fix works right. I second creating a TableBuilder module for these situations. -happy5214 10:17, 14 January 2014 (UTC)
Wikitext tables with Lua don't seem like all that big a problem. I've done some in things like Module:ImportProtein and Module:Module overview; I've even done one using rowspan in Module:TemplateTools. The big advantage of sticking with Wikitable format is that you can have an argument to produce nowiki output and wrap it in pre tags, and a human editor can copy the output table and more easily customize it further if the module output is somehow insufficient or inaccurate. Wnt (talk) 15:39, 14 January 2014 (UTC)

Any update? It shouldn't be hard to either change the single template {{jcttop}} to use wikicode, or alternately revert it to non-Lua until that's done. --NE2 18:12, 22 January 2014 (UTC)

It would make more sense to take {{jcttop}} out of articles that don't use the rest of the corresponding templates, since they are using the template incorrectly. No need to be a mule about this, use it correctly, as the documentation lays out. - Floydian τ ¢ 20:25, 22 January 2014 (UTC)
Who's to say what's correct usage? A bunch of self-selected template popo? --NE2 20:38, 22 January 2014 (UTC)
In any case, the sandbox code fixing this has been live for a week. If you're still having issues, try purging the page. -happy5214 06:33, 23 January 2014 (UTC)
So it is. Awesome. --NE2 00:56, 26 January 2014 (UTC)

Updated CodeEditor

I just updated the version of ACE in our CodeEditor. If you use this editor often, take a minute or two to test it out. Most interesting change is most likely the new improved Find and replace. Use ctrl-F or cmd-F to access it. There are options for case sensitivity, regexp etc. You can start typing and it will highlight all the matches as you type. Pressing ctrl-G brings you to the next match, ctrl-shift-G for the previous match. Pressing ctrl-F a second time brings up the replace dialog. cmd-, brings up the settings dialog (non-persistable). I'm in the process of writing a patch to add a 'show invisible characters' persisted toggle button to the CodeEditor. If there are other options in the settings dialog that you think we should offer in the toolbar with persisted settings, then please file a bug report with your idea. —TheDJ (talkcontribs) 07:41, 10 January 2014 (UTC)

This is excellent news - the search is now actually useful, which will be a great help when I am away from my main computer. (On the main one I use GVim, and I don't think it's possible to pry me away from that now.) Thank you for your work on this. :) — Mr. Stradivarius ♪ talk ♪ 08:32, 10 January 2014 (UTC)
One little peeve, and it's time for me to start taking care of stuff like this myself: I'd like to change "this" to "self" in ace/mode-lua.js line 216. I've signed up for an account on that server, and I've cloned CodeEditor in git and edited the file. I think I'm supposed to use the commit tool, set my identity as wnt, put in an email address, and push changes, but I haven't seen a style guide or set of do's and don'ts and I'm a bit worried I'll cause some sort of disturbance. (Also I'm not sure every tom dick and harry who signs up is authorized to propose changes to CodeEditor?) I'm not asking you to do this one for me; I want to figure out how to do it myself. Wnt (talk) 13:16, 15 January 2014 (UTC)
Yes, every Tom, Dick, and Harry who signs up is authorized to propose changes. Then people will (hopefully) review your changes, and if your change is good then someone with "+2" access will eventually merge it. Style guides are at mw:Manual:Coding conventions, and an introduction to the whole process is at mw:How to become a MediaWiki hacker.
In this particular case, though, it might be better to go upstream so it doesn't get undone the next time ACE-in-CodeEditor is updated. Anomie 13:44, 15 January 2014 (UTC)
Well.... I'd honestly been half hopeful that there might be some way to make a commit like a Wiki edit and preview it on one of those wmflabs projects, but that was wishful thinking. Instead I feel like I've been mugged on the pons asinorum, because the outcome of "vagrant up" is always an error that "AMD-V is disabled by the BIOS". Turns out that apparently the virtual Ubuntu relies on a feature which, though it is present on the chip, has quietly been turned off by many/most cheap manufacturers at the software or motherboard level. Leaving me to attempt the now not recommended manual installation... let's just that I'm not feeling so hopeful right now. Wnt (talk) 17:44, 15 January 2014 (UTC)
I should mention that I was able to get 1.23alpha running under XAMPP "the old way", so hopefully I should be able to continue. Wnt (talk) 21:55, 17 January 2014 (UTC)
@Wnt: I had this issue when I was trying to install Vagrant as well, and I just fixed it today. All I needed to do was turn on virtualisation in my BIOS, then do a fresh install of MediaWiki-Vagrant. After that, everything worked. — Mr. Stradivarius ♪ talk ♪ 13:49, 28 January 2014 (UTC)
That works great, if you can do it. (Incidentally, though my efforts were set back again by a disk failure on the computer I'd been using, I'm pretty sure the old way is the way I'll be doing it, because none of the cheap computers I've been using have an option to enable virtualization) Wnt (talk) 17:04, 28 January 2014 (UTC)
You should definitely do this upstream. And actually, since it is github it is EXTREMELY easy. Just sign up, then go to here. Click Edit at the top right. This will create a fork in your 'own' github space and open a JS based editor. Change the line in question and then add a commit summary and description and say "Commit changes". After that at the top there will be a "Compare and review" button that you can click to submit your changes to ACE itself. After that, we can do the MediaWiki part, which indeed is a bit harder. —TheDJ (talkcontribs) 18:08, 15 January 2014 (UTC)
Well, the plan was to move toward being able to contribute to Wikipedia, not the ACE project, but I ought to make a trip over there at some point, it's true. Wnt (talk) 19:13, 15 January 2014 (UTC)
I do apologize, but since I was working on a few other CodeEditor issues in ACE, I also fixed this issue. I hope to have all of this working properly in the next round of deploys. But there is quite a bit more that can be fixed in CodeEditor. Especially adding some toolbar options for a few of the ACE options would be very welcome. See also bugzilla:59924 and other CodeEditor issues. —TheDJ (talkcontribs) 22:14, 17 January 2014 (UTC)
Hey, no need to apologize for fixing that! I know I actually tried saving an edit with "this", no matter what the manual said, just because of the editor ... you just spared somebody else the effort. I'm not so sure about starting with these ACE options though - connecting two pieces of software can be a trickier exercise, and I might look for an even smaller bug to fool with. Either that, or (probably) waste my time trying to see if there's any way we could transclude a .SVG file after all. :) (I really want to be able to relabel those things on the fly, in the Wiki) Wnt (talk) 22:36, 17 January 2014 (UTC)

Wikidata calendarmodel

Hi, on Wikidata some dates are shown as Julian Calendar (internally instead they use Gregorian Calendar), documentation here. Is there some Lua utils/library for Gregorian=>Julian conversion? --Rotpunkt (talk) 21:28, 24 January 2014 (UTC)

A quick search turned up Module:JulianDay and Module:Sandbox/DixonD/Datetime/Julian, although neither of them appear to be in wide use, and I can't vouch for their contents. — Mr. Stradivarius ♪ talk ♪ 06:52, 26 January 2014 (UTC)
Thanks Mr. Stradivarius. Wikidata uses Julian calendar, but these modules seem to be related to Julian day. I found Conversion between Julian and Gregorian calendars, and I am not sure about the conversion: (1) gregorian calendar => julian calendar or (2) gregorian calendar => julian day => julian calendar. I could look at Wikidata code. --Rotpunkt (talk) 07:11, 26 January 2014 (UTC)
Actually the module you found, Module:JulianDay, converts also julian day => julian calendar, so the way to go seems to be: gregorian calendar => julian day => julian calendar.Thanks again. It would be nice to know if direct conversion is another choice or not: gregorian calendar => julian calendar (without julian day step). --Rotpunkt (talk) 08:16, 26 January 2014 (UTC)
The first of the links posted by Mr. Stradivarius appears to be from fr:Module:Date. I was tangentially involved in the latter because I wrote Module:Age which led to a discussion on my talk (here). Another discussion was here. I was going to get more involved but other work got in the way; I'm just offering these links in case they have anything that may interest someone who feels like investigating. Johnuniq (talk) 09:09, 26 January 2014 (UTC)
I will look into it, thanks. --Rotpunkt (talk) 10:55, 28 January 2014 (UTC)

Wikidata claims

Hi someone knows if entity.claims[property] is for sure a Lua sequence, and it remains a Lua sequence also after editing/removal from the wikidata web interface? I know entity.claims[property] has the oddity that it starts from 0 instead of 1, but apart from that:

  • can I always count the claims with: #entity.claims[property] + 1 ? ("+ 1" because claims starts from 0)
  • can I always iterate the claims with: for i = 0, #entity.claims[property] do ?

Thanks in advance. --Rotpunkt (talk) 11:11, 28 January 2014 (UTC)

I have asked on irc and I was told it's a sequence. The starting index (0 instead of 1) is meant to be changed (on a new interface). --Rotpunkt (talk) 12:45, 28 January 2014 (UTC)

Using require conditionally

At Template talk:Time ago#Suggesting to Module:TimeAgo there was a suggestion that we should move one of the require statements at the top of Module:TimeAgo inside an if block in the module body. The rationale is that this would prevent it appearing as a transclusion when it is not needed in the module. Is this a desirable thing to be doing, and would it have any appreciable effect on performance? — Mr. Stradivarius ♪ talk ♪ 10:37, 30 January 2014 (UTC)

Two words: job queue. Keφr 11:20, 30 January 2014 (UTC)
Efficiency is always good, provided it doesn't have a significant cost (such as making the code ugly or harder to maintain). I think it depends on the situation, but I commented at the above talk that doing require only if needed seems desirable. Johnuniq (talk) 11:38, 30 January 2014 (UTC)
Good points, both of you. Require on demand it is, then. (Also, @Kephir: that's short.) — Mr. Stradivarius ♪ talk ♪ 12:46, 2 February 2014 (UTC)

NaN question

Can anyone who knows their NaNs have a look at Module talk:TableTools? I'm wondering whether I should change the duplicate removal function based on Verdy p's post there. Thanks. :) — Mr. Stradivarius ♪ talk ♪ 12:49, 2 February 2014 (UTC)

Threads copied from Wikipedia talk:Lua/To do

The following subthreads were all copied from Wikipedia talk:Lua/To do per my suggestion above. I've redirected that page here to keep discussion centralised. — Mr. Stradivarius ♪ talk ♪ 14:00, 4 February 2014 (UTC)

Simpler templates?

Hi, converting wikitext templates into Lua templates is an interesting work for mw:Google Code-in. However, the templates listed here are very complex, and embed other templates. It would be great if we could split the tasks into smaller pieces. For instance, among the transcluded templates is there any that would be interesting to convert first?--Qgil (talk) 21:46, 3 December 2013 (UTC)

While sometimes subtemplates should go into different modules, most of the time they should all go into the same module. The main reason for having subtemplates is because that is the only way it is possible to call the same template code multiple times. If this is the case, it is usually best to implement the subtemplate as a function in the main module. For example, all the templates called from {{documentation}} could be implemented as functions, with the exception of {{pp-template}} and {{fmbox}} (the latter has already been converted to Lua anyway). I can see how converting these hugely complicated templates might not be the best for the students, though. :) I'll see if there are some easier ones lurking out there that I can find. — Mr. Stradivarius ♪ talk ♪ 08:04, 4 December 2013 (UTC)
Hi Mr. Stradivarius and Wnt, the two EASY templates have been already rewritten in Lua, while the same student (Theopolisme) has just claimed Template:Multiple_issues, tagged as MEDIUM. Do you have more easy templates for other Google Code-in students? Also, let me know if you think any of the "Other tasks" is suitable for GCI students.--Qgil (talk) 20:34, 8 December 2013 (UTC)

Grand plan?

Hi! I'm very new here - got to Lua templates from a hackaton, so I have no Idea what I'm talking about. If there is a wish to convert all templates to modules - I think that that's a great way to get people not currently in wikipedia involved. Unlike most open-source coding missions, template conversion is very easy to get into, it's a small app you do from scratch (most small missions are debugging other people's code, which no-one likes), and it will actually be used by wikipedia. It's a perfect programmer-version of maintaining wikipedia values. Collecting conversion candidates, testing modules (to match templates), and converting approved templates can be done by simple python-bots. All in all - great hackaton materia. Let me know if that makes any sense. Tsahee (talk) 08:22, 27 December 2013 (UTC)

Absolutely, that sounds like a great idea. :) The more people we can get involved, the better. How about bringing this up on the main project talk page? This page is meant for discussion about the To do page, rather than for discussion of Lua in general. Best — Mr. Stradivarius ♪ talk ♪ 08:39, 27 December 2013 (UTC)

External libraries?

So one nice thing about Lua is that there is some open-source code out-there that may prove useful for wikipedia too. I looked at [] which may not be a perfect example but it's close enough. How do we feel about trivially converting external libraries to modules? Can there be a licensing problem? Most request at least that "this disclaimer / license" is included when copying the code - is that o.k? Tsahee (talk) 08:22, 27 December 2013 (UTC)

Yep, that's all good. As long as the licence is compatible with Wikipedia's, then we can use it. You just need to copy the code over and make sure you do whatever is necessary to comply with the licence. A lot of Lua code is licensed with the MIT licence, and we can use that with no problems. If the licence allows the freedom to copy, modify, and distribute the software, including commercially, then we should be able to use it. But if you have any doubts, please ask. :) Also, this kind of thread will go better at the protect talk page at WT:Lua. — Mr. Stradivarius ♪ talk ♪ 08:37, 27 December 2013 (UTC)

Parameter listing

I've just begun Module:TemplateTools, and I've got working a feature that automatically lists all the parameters actually used by a template, and their default values (i.e. {{{parameter|default}}}). It's still at a very early stage, but maybe people doing translations could find it useful. Wnt (talk) 07:36, 8 January 2014 (UTC)

Looks interesting - I'll have a play around with it later. If you're looking to parse wikitext and don't want to reimplement the entire parser, you could try cribbing from mwparserfromhell, a wikitext parser written in Python that is already stable and used in some well-known Wikipedia bots (Legobot, for a start). Also, if you're looking for more AI-level tasks you could add automatic generation of metatables for memoisation. And maybe you could add a 5.5, "automatically convert subtemplates". Anything over number 5 or 6 sounds like a PhD-thesis-level task to me, though. :) — Mr. Stradivarius ♪ talk ♪ 08:03, 8 January 2014 (UTC)
Actually, I'm even reduplicating some of my own efforts from Module:FormatTemplate going about it a different way ... this is a bit of an exercise so far. (Also there's Module:TemplateDataGenerator which I haven't really looked at). I think my practical goal here is to split up the work of rewriting a template into several independent parts, so that you can do some one day and some the next, or have several volunteers work on different pieces, but I'm really not going to be sure how hard it is to do a nearly full conversion minus a small percent of leftover slag (like obscure parser functions) until I get neck deep in it. :) Wnt (talk) 16:29, 8 January 2014 (UTC)
Speaking of "neck deep in it".. I've gotten to the point where there's something almost resembling Lua code in places at Module talk:FormatTemplate. My, but it's a beast, and it's been a struggle. Still... I wouldn't give up hope yet. Wnt (talk) 00:00, 22 January 2014 (UTC)

Dts template

Hi! I made some progress with DTS template, and I have some questions. The best way seemed to be to write them down in Module_talk:Sandbox/Dts and ask you here to take a look. Thank you! Tsahee (talk) 20:45, 19 January 2014 (UTC)

Suggestion

How about Template:Val? It has limit issues too. --JulesWinnfield-hu (talk) 12:04, 1 February 2014 (UTC)

Anyone taking that on may want to review a discussion at my talk because {{convert}} is now able to show a unit name, optionally linked. I think {{val}} is still using some tricky logic and the old convert templates for that. Johnuniq (talk) 01:54, 2 February 2014 (UTC)

Redirect to Wikipedia talk:Lua

I've proposed redirecting this page to the main project talk page at Wikipedia talk:Lua. If anyone is interested, please join the discussion. — Mr. Stradivarius ♪ talk ♪ 12:54, 2 February 2014 (UTC)

Module localisation

I got a message on my talk page today suggesting that I put the message() function from Module:Documentation in a separate meta-module so that it can be reused by other modules. The message function works a lot like (a simplified version of) MediaWiki messages - it fetches a localised version of the message from a data table, and then swaps parameters $1, $2, etc. with their values. Unlike string.format, parameters can be specified in any order, which is necessary when putting the parameters in the "English order" would be unnatural in a given language. I think it would be useful to have a standardised way of localising modules like this, and I'd like to hear people's thoughts on how best to do that. Is the message() function a good model, or would you change it? Could this be integrated with the mw.message library? Let me know what you think. — Mr. Stradivarius ♪ talk ♪ 05:28, 4 February 2014 (UTC)

That's a great function. I have done similar stuff in Module:Convert but I was too tired to think about doing it properly with $1, $2 etc. I'm just using %s which displays multiple parameters in a fixed order. One point is that it seems people want all messages localized, including the "should never happen" messages like "message: no value found for key". That is not easy to do in a reasonable way, and I haven't done it (if the table-lookup fails, I just use "?"). I did some Q&D localization for hi:Module:अंक परिवर्तन and put unknown_error and mtext_hi at the top of the module.
The expectType parameter is pretty strange. I see it gets a workout with 'boolean', but if expectType is given and is not 'string', then valArray must be nil or there will be a runtime error. Is it really needed? For example, the 'boolean' usage could be replaced by having magic text like 1 (or 0) in the cfg table to represent true (or false).
For convert, I found it convenient to have a single "thing" for an error message, so convert has cfgKey and valArray in a single table. For example, where your code has message('doc-subpage'), convert would have message({'doc-subpage'}) (which can be just message{'doc-subpage'} but I'm not ready to go there).
While integration with mw.message library may be desirable, I suspect it might get complex quite quickly. I'm not sure what else would be in a localization module, although convert has some code for translating a number (a string of digits) to or from English (very similar to the code in the hi link above, although I had to use "to_international" and "from_international" to suit the Hindi wiki, whereas convert uses "to_en" and "from_en"—apparently even "en" is a bit sensitive over there).
By the way, I guess you know that it is not necessary to use ugsub (mw.ustring.gsub) if searching for ASCII text like $2 in a valid UTF-8 string (and if it's invalid, ugsub could do anything). Johnuniq (talk) 10:23, 4 February 2014 (UTC)
Well, Anomie's reply below has left much of this moot, but I'll just answer a couple of points. I was actually thinking of just forcing every message to be either a string, a number, or a boolean, but then I wanted a way for users to specify arguments to {{pp-template}} easily, which means using a table. After {{pp-meta}} gets converted to Lua, I'll probably remove the parameter. Also, I think there does need to be some type checking, otherwise for some messages, if the translator makes a mistake and deletes a message, it would just be dropped from the module output and wouldn't show up as an error.

About the mw.ustring.gsub thing, I will admit that I'm still a little hazy on the details of dealing with unicode. My modus operandi so far has been "if it might touch unicode, use the ustring library", although I'm guessing from your comment that using normal gsub to replace ASCII text with unicode text wouldn't cause any problems. I should probably read up on that some more. — Mr. Stradivarius ♪ talk ♪ 13:52, 4 February 2014 (UTC)

If your pattern is not using the percent-letter character classes listed at mw:Extension:Scribunto/Lua reference manual#Ustring patterns or their uppercased versions (%a, %d, and so on), bracketed character classes involving non-ASCII characters, %b or %f with non-ASCII characters, or quantifiers attached to non-ASCII characters, you should be fine to use string.gsub instead of mw.ustring.gsub. Anomie 16:36, 5 February 2014 (UTC)
Doesn't something like mw.message.newRawMessage("text"):params("$1", "$2", "etc"):plain() already do this? Anomie 12:51, 4 February 2014 (UTC)
Aha. I thought there might have been something I was missing there. I was under the impression that the mw.message library was only for parsing MediaWiki's existing messages or messages in the MediaWiki namespace, but I do remember thinking that it would be a bit odd to not have some easy way of localising modules that people were writing. Asking earlier might have saved me from reinventing the wheel. I think what we need here is a Scribunto guide for new and relatively new coders who need lots of examples to see how all of this works. I'm sure I would have got it straight away if I had seen an example or two. (Thinks - perhaps I should try and get a WMF grant to write it myself.) — Mr. Stradivarius ♪ talk ♪ 13:43, 4 February 2014 (UTC)
To test my understanding of Anomie's advice, I put some code at Module:Sandbox/Johnuniq/message. Johnuniq (talk) 00:26, 5 February 2014 (UTC)

(ab)use of mw.message

The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section.

The ability to use these techniques was an unintended consequence of exposing the message library to the parser and, as discussed below, resulted in several odd behaviors when used in this way. Effective February 20, mw.message will only be able to output messages in the plain format, rendering both of these techniques ineffective. Jackmcbarn (talk) 22:53, 6 February 2014 (UTC)

"Hacking" into Wikidata to get properties of miscellaneous articles

I just noticed the interesting mw.message library in the Scribunto documentation, and even though the syntax documented on the Meta page doesn't work, this does: I was able to get the thing to tell me that the capital of Germany was in Bonn while running from the sandbox.

p.misc = function(frame)
    msg = mw.message.newRawMessage("hmm {{#property:capital}}"):title("Germany"):text()
    local out = msg .. "{{#property:capital|of=Germany}}"
    return out
end

Delivers "hmm Bonn, Berlin{{#property:capital|of=Germany}}" while running from Module talk:User:Wnt/Sandbox. Without nowiki, that tag "" still delivers nothing for me.

Is someone in the process of fixing this or should I make it a module? Wnt (talk) 19:17, 12 January 2014 (UTC)

On second thought, it looks like the message library was added last February, I just didn't pay attention to it until recently. So I doubt any change in #property is coming soon ... I should just write up Template:property, which is actually a redlink right now. Wnt (talk) 19:55, 12 January 2014 (UTC)
@Wnt: It sounds like you're looking for mw:Extension:WikibaseClient/Lua. It's a little hard to work with, and the documentation could be better, but it will let you access all the Wikidata properties you want from Lua. — Mr. Stradivarius ♪ talk ♪ 20:06, 12 January 2014 (UTC)
Ah, wait a second - you need to get the properties of arbitrary articles, but the mw.wikibase library doesn't allow for it, right? This sounds like something to submit to Bugzilla, or perhaps for something for one of us to actually fix ourselves. Anyway, this is probably Wikipedia's way of telling me that I need some sleep. :) — Mr. Stradivarius ♪ talk ♪ 20:10, 12 January 2014 (UTC)
There is a reason it is not available. It does not track this stuff, so if you would update the property, the pages that use this Lua module would currently not be updated. This is a known problem that the WikiData team is still working on. 'Hacking it' would be ill advisable. —TheDJ (talkcontribs) 20:38, 12 January 2014 (UTC)
I didn't try mw.wikibase - actually, I hadn't seen it until now - but I don't see a ready way to access another page's data there. The lack of updating doesn't seem very important for many articles (Actually, the "Bonn" bit it returns isn't very up to date at all). And if an article is edited fairly often, won't it be updated then? Worst come to worst, you could transclude some special page to abolish caching ... 😈. Wnt (talk) 20:53, 12 January 2014 (UTC)
No worst come to worst Anomie will take your toys away :) —TheDJ (talkcontribs) 11:28, 13 January 2014 (UTC)
Acessing other pages data from Wikidata has been reported at bugzilla:47930, by the way.--Snaevar (talk) 14:38, 13 January 2014 (UTC)

Nice hack :). Please just consider it a hack and wait for us to implement this properly, we have good reasons for not enabling this right now. Stay tuned... I'm currently totally overhauling Wikibase's Lua interface (these changes will get deployed within the next couple of weeks, probably). This wont yet include the ability to access "foreign" entities, for that please see bugzilla:47930. Cheers, Hoo man (talk) 18:41, 19 January 2014 (UTC)

Ifexist alternative

Reviewing mw.message library pointed out in the message above, I tried an alternative to parser function #ifexist solving bugzilla:12019. It does not create pagelinks anymore and I think it is not expensive. See my sandbox. Any thought about it? --Vriullop (talk) 11:06, 13 January 2014 (UTC)

Hmm. That'll have to be fixed. Anomie 11:24, 13 January 2014 (UTC)
As I understand it, #ifexist needs to make an entry in the links table so that it gets updated by the job queue if the corresponding page is created or deleted. With your alternative this won't happen, so if the page being tested is created or deleted, your function won't be updated until the page it is run on is next edited. (Purging the page cache would also do the trick.) A proper solution would have to be more integrated with the database, I would think. — Mr. Stradivarius ♪ talk ♪ 11:51, 13 January 2014 (UTC)
The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Module localisation

I got a message on my talk page today suggesting that I put the message() function from Module:Documentation in a separate meta-module so that it can be reused by other modules. The message function works a lot like (a simplified version of) MediaWiki messages - it fetches a localised version of the message from a data table, and then swaps parameters $1, $2, etc. with their values. Unlike string.format, parameters can be specified in any order, which is necessary when putting the parameters in the "English order" would be unnatural in a given language. I think it would be useful to have a standardised way of localising modules like this, and I'd like to hear people's thoughts on how best to do that. Is the message() function a good model, or would you change it? Could this be integrated with the mw.message library? Let me know what you think. — Mr. Stradivarius ♪ talk ♪ 05:28, 4 February 2014 (UTC)

That's a great function. I have done similar stuff in Module:Convert but I was too tired to think about doing it properly with $1, $2 etc. I'm just using %s which displays multiple parameters in a fixed order. One point is that it seems people want all messages localized, including the "should never happen" messages like "message: no value found for key". That is not easy to do in a reasonable way, and I haven't done it (if the table-lookup fails, I just use "?"). I did some Q&D localization for hi:Module:अंक परिवर्तन and put unknown_error and mtext_hi at the top of the module.
The expectType parameter is pretty strange. I see it gets a workout with 'boolean', but if expectType is given and is not 'string', then valArray must be nil or there will be a runtime error. Is it really needed? For example, the 'boolean' usage could be replaced by having magic text like 1 (or 0) in the cfg table to represent true (or false).
For convert, I found it convenient to have a single "thing" for an error message, so convert has cfgKey and valArray in a single table. For example, where your code has message('doc-subpage'), convert would have message({'doc-subpage'}) (which can be just message{'doc-subpage'} but I'm not ready to go there).
While integration with mw.message library may be desirable, I suspect it might get complex quite quickly. I'm not sure what else would be in a localization module, although convert has some code for translating a number (a string of digits) to or from English (very similar to the code in the hi link above, although I had to use "to_international" and "from_international" to suit the Hindi wiki, whereas convert uses "to_en" and "from_en"—apparently even "en" is a bit sensitive over there).
By the way, I guess you know that it is not necessary to use ugsub (mw.ustring.gsub) if searching for ASCII text like $2 in a valid UTF-8 string (and if it's invalid, ugsub could do anything). Johnuniq (talk) 10:23, 4 February 2014 (UTC)
Well, Anomie's reply below has left much of this moot, but I'll just answer a couple of points. I was actually thinking of just forcing every message to be either a string, a number, or a boolean, but then I wanted a way for users to specify arguments to {{pp-template}} easily, which means using a table. After {{pp-meta}} gets converted to Lua, I'll probably remove the parameter. Also, I think there does need to be some type checking, otherwise for some messages, if the translator makes a mistake and deletes a message, it would just be dropped from the module output and wouldn't show up as an error.

About the mw.ustring.gsub thing, I will admit that I'm still a little hazy on the details of dealing with unicode. My modus operandi so far has been "if it might touch unicode, use the ustring library", although I'm guessing from your comment that using normal gsub to replace ASCII text with unicode text wouldn't cause any problems. I should probably read up on that some more. — Mr. Stradivarius ♪ talk ♪ 13:52, 4 February 2014 (UTC)

If your pattern is not using the percent-letter character classes listed at mw:Extension:Scribunto/Lua reference manual#Ustring patterns or their uppercased versions (%a, %d, and so on), bracketed character classes involving non-ASCII characters, %b or %f with non-ASCII characters, or quantifiers attached to non-ASCII characters, you should be fine to use string.gsub instead of mw.ustring.gsub. Anomie 16:36, 5 February 2014 (UTC)
Doesn't something like mw.message.newRawMessage("text"):params("$1", "$2", "etc"):plain() already do this? Anomie 12:51, 4 February 2014 (UTC)
Aha. I thought there might have been something I was missing there. I was under the impression that the mw.message library was only for parsing MediaWiki's existing messages or messages in the MediaWiki namespace, but I do remember thinking that it would be a bit odd to not have some easy way of localising modules that people were writing. Asking earlier might have saved me from reinventing the wheel. I think what we need here is a Scribunto guide for new and relatively new coders who need lots of examples to see how all of this works. I'm sure I would have got it straight away if I had seen an example or two. (Thinks - perhaps I should try and get a WMF grant to write it myself.) — Mr. Stradivarius ♪ talk ♪ 13:43, 4 February 2014 (UTC)
To test my understanding of Anomie's advice, I put some code at Module:Sandbox/Johnuniq/message. Johnuniq (talk) 00:26, 5 February 2014 (UTC)

Test Case fail?

I've written a new module called NumberUsers and I'm having a problem with my test case. It says that it fails, but it looks identical. Could someone figure this out? Techman224Talk 05:16, 11 February 2014 (UTC)

I'll mention that in general the way to investigate would be to put the following into Special:ExpandTemplates:
"{{#invoke:NumberUsers | users}}"
"{{NUMBEROFUSERS}}"
However, in this case, that's no use because the outputs are identical. My guess is that Module:UnitTests is seeing the text {{NUMBEROFUSERS}} and giving "failed" because that text does not match. However, something is expanding that to give the number when it is displayed on the results page. Johnuniq (talk) 06:04, 11 February 2014 (UTC)
Fixed The proper method to use is preprocess_equals_preprocess. The second argument wasn't being parsed within Lua. -happy5214 07:28, 11 February 2014 (UTC)

mw.loadData

Hi, I have a question about this function. I would like to know if loading the same module multiple times from the same module has performance issues (or instead it's the same for some internal cache). Example:

local a = mw.loadData("Module:MyModule")
-- ... in the same module, somewhere else ...
local b = mw.loadData("Module:MyModule")

is it more expensive or is it just the same than:

local a = mw.loadData("Module:MyModule")
...
local b = a

Thanks in advance. --Rotpunkt (talk) 12:45, 20 February 2014 (UTC)

mw.loadData evaluates the module only once per article. I'm assuming that means the module data is cached internally, so the performance of both of your examples shouldn't be appreciably different. -happy5214 13:05, 20 February 2014 (UTC)
The second might be slightly more efficient, because it doesn't create a new wrapper object for the loaded data. It's probably not worth worrying about though. Anomie 22:18, 20 February 2014 (UTC)
Thanks to both of you, and thanks Anomie for the detailed informations. --Rotpunkt (talk) 23:56, 20 February 2014 (UTC)

Redirect Wikipedia talk:Lua/To do here

While I'm thinking about it, would anyone object to redirecting Wikipedia talk:Lua/To do to this page? At the moment, I think the discussions are too fragmented. We already have two talk pages - here, and Wikipedia:Lua requests. A third seems too much. — Mr. Stradivarius ♪ talk ♪ 12:52, 2 February 2014 (UTC)

No objection here. Edokter (talk) — 13:20, 2 February 2014 (UTC)
Good idea. Johnuniq (talk) 01:23, 3 February 2014 (UTC)
Good, improvement. -DePiep (talk) 04:58, 2 March 2014 (UTC)

Code editor not showing up?

On my work computer the code editor shows up fine, but my home computer doesn't load it at all (no toolbars, no syntax highlighting, no line numbers). Both computers are running Chrome, but the work computer is on XP and the home computer is on Win7. I would expect the newer home computer to load better but it's been the other way around :/ Any ideas why this is happening and how this can be fixed? Thanks. _dk (talk) 16:38, 28 February 2014 (UTC)

You need Javascript enabled in your browser, and the code editor needs to be enabled if it has been disabled. There is an icon at the left of the toolbar just above the edit window which can be clicked to enable/disable. Johnuniq (talk) 22:28, 28 February 2014 (UTC)
Javascript has always been on (the toolbars are right above me as I type!), but in the Module namespace the toolbars don't even show up, let alone the enable/disable button. _dk (talk) 15:49, 1 March 2014 (UTC)
We need to get specific. If I enable Javascript and edit Module:Sandbox/Johnuniq/message, I see the following at the top:
Content that violates any copyrights will be deleted...
Toolbar with "/*" icon at left.
Toolbar with "Heading" and "Format" and more.
First line of code: "-- Adapt message() from..."
The "/*" icon is the enable/disable button. On mouse-over it shows "Toggle code editor". There is possibly something in Special:Preferences that controls this, but I can't see it. In my preferences, under the Editing tab, I see "Show edit toolbar (requires JavaScript)" and "Enable enhanced editing toolbar", but I have both of those off. If you can't find anything, please try WP:VPT. Johnuniq (talk) 01:35, 2 March 2014 (UTC)
Going from your example, this is what I see:
Content that violates any copyrights will be deleted...
Preview of the code
First line of code: "-- Adapt message() from..."
I suspect it's a memory issue, like how gadgets on Wikipedia will just shut down and not load when I don't have enough RAM? I found that it loads once in a while if I refresh a few times. Thanks for the help anyways. _dk (talk) 18:23, 2 March 2014 (UTC)
If it shows up every once in a while, then it sounds like either a connection problem or a lack of system resources on your computer. Sometimes on slow connections the page takes long enough to load that the browser gives up on trying to download the JavaScript, and CodeEditor is implemented in JavaScript, so that means that it won't be run. Also, if your system doesn't have the necessary memory or other system resources to run the JavaScript, then that means it won't be run either. If you are experiencing the same kind of issues with Wikipedia gadgets, then the system resources explanation would make the most sense. You could dry disabling some of your user scripts and see if that helps. — Mr. Stradivarius ♪ talk ♪ 00:38, 3 March 2014 (UTC)

Page-global variables

Is there a (documented) way of defining a variable whose value is kept in subsequent invocations of a module? For instance, say that I have a module MyTableGenerator. I would first call {{#invoke|MyTableGenerator|set_default_background_color|red}} and then, every call to {{#invoke|MyTableGenerator|generate_a_table|...}} would generate a table with a red background.

On the French Wikipedia, some modules simulate this by calling getContent() on the page itself and doing a regexp search in the source code. I am looking for an alternative.

Orlodrim (talk) 21:38, 5 March 2014 (UTC)

There is no mechanism for allowing information to persist from one invoke instance to the next. Dragons flight (talk) 21:45, 5 March 2014 (UTC)
In fact, it is specifically intended that there not be a way to transfer information from one invoke to the next. VisualEditor and Parsoid want to be able to reparse portions of the page without having to worry about reparsing the whole thing. Anomie 22:21, 5 March 2014 (UTC)
  • Even worse, there (wa|i)s a way when there is not suppose to be. This will be fixed very shortly if it has not already been fixed... — {{U|Technical 13}} (tec) 23:04, 5 March 2014 (UTC)

os.date() not working properly?

A week or so ago as the result of a new topic at Module talk:Citation/CS1, I did and experiment in the debug console using this: =os.date("Y") which returned the current year. Today, after adding that code to Module:Citation/CS1/sandbox, I got series of script errors that eventually showed that os.date("Y") is returning Y. I didn't test them all, but the several format characters that I did test simply returned the format character.

If the functionality of os.date has been changed, then the os.date documentation is also in need of change.

I got round the problem with os.date("*t").year.

Trappist the monk (talk) 15:28, 7 March 2014 (UTC)

I doubt =os.date("Y") ever worked. os.date uses the same syntax as strftime, as is documented, so you'd need =os.date("%Y"). Anomie 19:34, 7 March 2014 (UTC)
Argh! Facepalm. Thanks.
Trappist the monk (talk) 19:44, 7 March 2014 (UTC)

Minor bug

I noticed that if I add a strip marker for <references /> with nothing in front of it, it generates no text, but adding an "x" in front of it makes it spit out the last reference in an unused variable. There are a bunch of things that could affect that, and I know the code was being worked on because of side effects from ref tags carrying from one routine to the other. I doubt it matters to real-world examples unless it's something more general, but might as well ask if anyone recognizes the problem. Wnt (talk) 18:14, 21 March 2014 (UTC)

I see what's going on. Calls to frame:preprocess are cached somewhere, so the first time you run frame:preprocess("<references />") it caches the blank result, then the next time, instead of actually parsing it, it returns the blank result again. When you do frame:preprocess("x<references />"), it doesn't have it cached, so you get the right result. If you change both functions to frame:preprocess("x<references />"), then it's cached again, so it stops working again. @Anomie: ping. Jackmcbarn (talk) 19:37, 21 March 2014 (UTC)
(Also, as a side note, you have to unstrip it to see it). Jackmcbarn (talk) 19:38, 21 March 2014 (UTC)
Thanks - I verified the bug does behave as you suggest (I should clarify that the unstrip is not required to see the change in output, though it may be useful in debugging it) Wnt (talk) 21:42, 21 March 2014 (UTC)
I just tried a different test that doesn't use strip markers, and those aren't cached: a set of frame:preprocess() of things like "#. Pennsylvania" doesn't repeat the numbers. So far I can't think of a strip marker other than <references /> that should change while the page is put together (well, the system timestamp should change a little, but it's neither predictable nor guaranteed...), so maybe a very specific fix would work, and it may indeed be quite minor of a bug anyway. Wnt (talk) 21:54, 21 March 2014 (UTC)
I think you're correct that as of right now, only <ref> and <references /> have side effects. This is a general issue with Extension:Cite that there's really no good fix for. Jackmcbarn (talk) 22:30, 21 March 2014 (UTC)
I tried to fix it, but the Parsoid people wouldn't go for it. They'd rather add a whole extra pass to the parser, basically re-parsing the page to handle the references after the normal parse put in placeholders. Anomie 03:26, 22 March 2014 (UTC)
Wow. Looks like this bug has been known a long time and does have a very serious effect, if you still can't use {{reflist}} twice on the same ordinary wiki page without bugged output. I'm surprised people have put up with that. Your reaction reminds me a little of when I was on about those beloved mw.message hacks before -- I think those words "not encourage" tend to have that effect on a person -- though admittedly life with multiple developers revising a mountain of code with a Freddy Krueger pedigree may teach people to think differently about these things. But... to me that last comment by GWicke "I guess it *is* different if you see this as just a temporary and internal flag to be used by Cite only. I'm fine with that if documented clearly." sounds like it was leaving the door open a crack, maybe? Wnt (talk) 14:55, 22 March 2014 (UTC)

CodeEditor Feedback desired

Please read and give your input about what you are looking for in the CodeEditor toolbarTheDJ (talkcontribs) 00:14, 26 March 2014 (UTC)

Module:Yesno update

I'm thinking of updating Module:Yesno from the version at Module:Yesno/sandbox - please see Module talk:Yesno#New version if you're interested in commenting. — Mr. Stradivarius ♪ talk ♪ 15:25, 7 April 2014 (UTC)

Trouble of template inheriting module parameters

I've created module:MTR and its "icon" function is invoked by {{HK-MTR icon}}. The icon function apparently looks OK when the arguments "text" and "link" are given values directly as shown in the module doc. But when I transclude the module in the said template with parameters 2 and 3 inheriting arguments "text" and "link" of the module respectively with parser function #IF:, the values for these 2 arguments are seemingly ignored completely. Please help. -- Sameboat - 同舟 (talk) 08:40, 10 April 2014 (UTC)

I've simplified the template invocation. Let me see what I can make of the module. — Mr. Stradivarius ♪ talk ♪ 09:45, 10 April 2014 (UTC)
Hmmm, I should retire. I took a quick look at the template and thought that there was no reason to pass the template's parameters in that fashion, and then blanked that out of my mind and used what "should" have worked (local args = frame:getParent().args), but that failed with the way it is actually used. I started just before you replied here, so I'll leave this to you. Johnuniq (talk) 10:13, 10 April 2014 (UTC)
(edit conflict) Ok, I've finished. I actually had second thoughts and used frame:getParent, so there are now no parameters in the template invocation. I've also moved the data to Module:MTR/data so that it can be loaded with mw.loadData. @Sameboat: using frame:getParent means that the arguments are passed straight through to the module from template invocations like {{HK-MTR icon|IL}}. And using mw.loadData means that we cache the data so that it only has to be processed once per page, rather than once per #invoke, which should boost performance. It also has the bonus that we can put the data in a more easily-readable format. Let me know if it's all working as it should, and feel free to ask if you have any questions about the code. You've made a great start programming in Lua, and I'll be happy to help you improve. :) — Mr. Stradivarius ♪ talk ♪ 11:35, 10 April 2014 (UTC)
Sadly your simplification for the template doesn't work. You can see the result in the examples of the template doc (may need purge). -- Sameboat - 同舟 (talk) 11:24, 10 April 2014 (UTC)
@Sameboat: Ah, sorry about that. That's because I made it so that accessing the module directly via #invoke won't work, but accessing it through a template will. That's easy to fix, but it will make the module slightly slower, and should probably be avoided if it's going to be used many times on one page. I've updated the examples on the module page to use the templates rather than to use #invoke. — Mr. Stradivarius ♪ talk ♪ 12:02, 10 April 2014 (UTC)
Thank you very much. I'm relatively new to lua and this is the first ever real module I've ever created as you can tell from the original layout, so I need some time to catch up to your optimization. -- Sameboat - 同舟 (talk) 12:34, 10 April 2014 (UTC)
@Mr. Stradivarius: Just one more thing. The "colorbyname" function also needs to change the argument value to all caps as in "icon" function. I simply copy code = code:upper() to the "colorbyname" table. Is it possible to simplify this step so the same uppercase command doesn't need to repeat in case more functions are implemented to the module later? -- Sameboat - 同舟 (talk) 14:40, 10 April 2014 (UTC)
Yes, you can put something like this in the makeInvokeFunction function:
local code = args[1] or ''
code = code:upper()
args.code = code
That way you only have to do it once. It also means that args[1] will always be retrieved from wikitext, but that's fine here as it's going to be used in both functions anyway. — Mr. Stradivarius ♪ talk ♪ 14:57, 10 April 2014 (UTC)

ucfirst

What would be the code to produce an {{ucfirst:}} (first character into uppercase)? I am expecting string functions and patterns. -DePiep (talk) 20:29, 13 April 2014 (UTC)

@DePiep:
mw.ustring.upper(mw.ustring.sub(str, 1, 1)) .. mw.ustring.sub(str, 2)
Jackmcbarn (talk) 20:36, 13 April 2014 (UTC)
Aaahrgh ... no pattern needed. Thanks. (I consider, my last frustrating hours & edits were a "learning experience"). -DePiep (talk) 20:43, 13 April 2014 (UTC)
You can also use mw.language.getContentLanguage():ucfirst(str). — Mr. Stradivarius ♪ talk ♪ 12:30, 22 April 2014 (UTC)

The Lua editor

What is a (the) basic Lua editor, and how do I get one? Right now, I can't even search & replace, and irregularly (or Byzantine) every next Lua edit mode alters editor. -DePiep (talk) 22:28, 30 March 2014 (UTC)

The default is CodeEditor, which loads automatically when you edit a module page (or a .js or .css page). Do you see it when you edit a module page? It looks like this, although the colour scheme has changed since that screenshot was taken. A lot of the settings are only available through keyboard shortcuts at the moment - for example, search and replace is accessible by pressing CTRL+F twice (CTRL+F once is just search). See here for a list of default shortcuts. Myself, I use a combination of GVim and It's All Text, but the setup process for that is fairly involved, and GVim has a steep learning curve. — Mr. Stradivarius ♪ talk ♪ 02:04, 31 March 2014 (UTC)
One subtle point is that if you ever click the "/*" icon at the top left of the "looks like this" link from Mr.S's post, you will switch the code editor off, and it stays off until you click that icon again. On the point of an external editor, I saw the recent discussions regarding enhancements to the amazingly feature-rich CodeEditor, and personally I would worry a lot about the prospect of using a browser for a serious coding session. Like many people, my network and computer and software are very reliable, but I would never spend more than five minutes editing in a browser edit window because the slightest glitch would cause everything to disappear. I once investigated things like "It's All Text", but in the end decided that copying between browser and editor was sufficiently simple that I wouldn't bother with another layer. Johnuniq (talk) 03:15, 31 March 2014 (UTC)
I agree about the external editor point. When I've edited with CodeEditor in the past, I've lost my work on more than one occasion by pressing CTRL+R instead of CTRL+F. In most browser setups, CTRL+R refreshes the page, which means that you lose everything that you've done since your last edit. I understand that there's a fix in the works to bring up a dialogue in CodeEditor if you try and navigate away from the page, but in general it is still safer to stick with an external editor. — Mr. Stradivarius ♪ talk ♪ 04:20, 31 March 2014 (UTC)
I also use an external editor for most coding. I'm partial to Vile instead of Vim, but that is only because of starting to use it a long time ago. At this point, Vim is probably a better choice, given its popularity (implies more developers). However, I have not really compared the two.
I have not done a large amount of editing using the CodeEditor. For normal Wikipedia page editing I rely on the Firefox extension Textarea Cache to auto-save the textbox data. It appears to work reasonably well. Recovering from a Firefox crash – dramatically more frequent for me starting about 2 months ago – is easy and results in minimal loss. It, unfortunately, does not work on the CodeEditor edit box. I must admit that I had assumed that Textarea Cache would save the text area when using CodeEditor. However, I just tested it and it does not. I have not looked for an automatic solution to auto-saving the CodeEditor text area yet. If I don't find something easily, I'l probably hack Textarea Cache. On the other hand, I'll probably end up just using Vile.
As to the ctrl+R issue in CodeEditor: At least on Firefox, once you have clicked on either "Show preview" or "Show Changes" the ctrl+R will result in a pop-up asking if you want to resend the data instead of automatically re-loading the page. Thus, a workaround for that issue is to click "Show changes" every time you start editing a page with CodeEditor. For most other pages, Firefox already pops up a confirm dialog if you are leaving the edit page once the contents of the textbox change.  Makyen (talk) 05:52, 31 March 2014 (UTC)

Thank you all for your careful replies. Still, I am not looking for any 'external' solution, nor for a CE manual. I just want the default editor for modules to function. CE does not. And up in the tree (via WP:VPT to mw:) I have not met a single interest about for this. One peculiar recent branch is Wikipedia:VPT#CodeEditor_Feedback_desired OP by TheDJ, which shows activity but does not gave me a single useful link. -DePiep (talk) 20:26, 13 April 2014 (UTC)

CodeEditor is the default. If you have a problem, please come talk to me about it and I'll see what I can do. The above and earlier comments don't really give me enough context. There is a known problem with WikEd leading to unexpected behavior, and that will eventually be solved. If you have OTHER problems (so you have fully disabled the WikEd gadget in your preferences and still have problems), then please describe them, tell me your browser/OS version, file bug reports in bugzilla, make screenshots or basically ANYTHING that makes it actionable instead of vague remarks. Also, don't expect me to solve it within a week, I'm a volunteer and I don't always have time to solve complicated problems within short notice. But currently, i simply still don't understand what your problem is, proving that in 3 threads you have not done enough to explain it to me. —TheDJ (talkcontribs) 12:47, 23 April 2014 (UTC)
@DePiep: Yes, it's very hard for us to know what the problem is if you don't do some troubleshooting first. Try and disable WikEd, bypass your cache, and then see if CodeEditor works. If not, try and disable other gadgets and user scripts until you find what the conflict is. — Mr. Stradivarius ♪ talk ♪ 13:00, 23 April 2014 (UTC)
Or look in the console. If CodeEditor fails to load, then it'll probably throw an error and that's shown in your browser's JS console. — lfdder 13:19, 23 April 2014 (UTC)

Creating a central, CS1-like Module to standardize Infobox template code?

Odd problem with new template/module

Metatables will now work on export tables

Move this page

Versioning the scripts and modules

Duplicated template parameters

Use cases for frame.uargs

Anyone else having trouble with CodeEditor?

Infinite loop not cut at 10 seconds ... more like 141.

"Three-column" table

Another "I don't get this"

Get mw.wikibase.entity object of non-current page

mw.html library nil behaviour

Lua module needed at the Tigrinya Wikipedia (TI.WIKIPEDIA.ORG)

Most-used Lua modules

How to round?

Random question: Why are there no redirects in the Module: namespace?

Related Articles

Wikiwand AI