Wikipedia:Lua/Requests

From Wikipedia, the free encyclopedia
Jump to: navigation , search
  WP:Lua
Project
  WT:Lua
Project talk
  Help
 
  To do
 
  Requests
 
  Resources
en: m: mw: external
 
Shortcuts:

Lua scripts on Wikipedia are similar to templates but useful for performing more complex tasks for which templates are too complex or slow. Common examples include numeric computations, string manipulation and parsing, and decision trees. You can use this page to request help from Lua developers in writing a Lua module for a specific task on Wikipedia or another Wikimedia Foundation project. Both debugging help and full implementation are available.

To start a request, just make a new section below and describe what you need. You may wish to first check Special:PrefixIndex/Module: to see if you can find a suitable existing script.

It may help developers to provide examples of where the task is likely to be useful within Wikipedia. If the proposal would replace or improve upon existing templates, please note which ones.

Archive list[edit]

Is it possible to add another Archive title here (line 92)? So, By default (without adding any prefix) module will show Archive title 1 or Archive title 2 or both If archive title exist. I need this option for bengali wikipedia because on bn.wiki some user use their archive title as 'User:name/Songkolon 1' & some user use their archive title as 'User:name/Songrohoshala 1'. Here i tried to do this. Feel free to edit or make any changes here or here. Please help, Thanks --Aftabuzzaman (talk) 00:16, 26 April 2015 (UTC)

I have not studied this module or how it is used so my reply might not be accurate. I think the problem is that at bnwiki some users would like one name for "Archive", while other users would like another. My guess is that handling that automatically, or handling both if both are used, would require a lot of mucking around that would not be worthwhile. It would be much better to get people organized so one user has all their archive pages named in a consistent manner. You can change line 92 to replace "Archive" with the one most commonly used name. Users who want to use another name can simply add |prefix=whatever when invoking the module (that replaces "Archive" with "whatever"). They would probably want to also use |prefixspace=yes which adds a space to the end of "whatever". If wanted, prefixspace can be omitted, and prefix can be set like this: |prefix=whatever . Johnuniq (talk) 11:27, 5 May 2015 (UTC)
Thank you for reply. --Aftabuzzaman (talk) 12:08, 5 May 2015 (UTC)

Wrap new Graph tag[edit]

in one of the recent software updates, we received a new extension: mw:Extension:Graph. this can and should replace everythig we do, for instance, in Module:Chart: it can do barbraphs, pie charts, and so much more.

the problem with this extension is somewhat similar to the problem with mw:Extension:Timeline, which was the previous charting tool (it still exists, but is obsolete): it does not use syntax which is familiar and convenient to wikipedia editors.

now, some time ago i wrote Module:Chart, which plots pie charts and bar graphs. the implementation is disgusting, if i say so myself, because of the very limited support vanilla html provides for charting: the bars are generated by "div" elements with absolute positioning, and the pie chart is based on some obscure features of the way html renders borders (the exploitation itself is ingenious, IMO, and is taken from Template:Pie chart).

i kinda like the syntax used by Module:Chart - i think it lets the editors provide the meaningful data, and hides from them all the mundane details. i asked on this page, several times, for suggestions to make the syntax even better, but there was not much response.

the request here is simple: create a module that will receive parameters in the same syntax used by Module:Chart, but instead of using obscure and perverse methods to draw the graph, will use then new Graph tag.

as a second round, we should use this extension to support more chart types: line chart, scatter chart, horizontal bar graph, and if someone will gets really ambitious, maybe 3-d bar chart.

as a side, i'll mention that the graph extension can do more than just charts - this should be left as an exercise for other modules.

i believe the extension supports all the charts that can be found here: here, but i cant guarantee this is the case.

peace - קיפודנחש (aka kipod) (talk) 17:00, 8 May 2015 (UTC)

I saw your work and was totally amazed at the brilliant result and excellent usability, but I haven't needed to use the module. The new graph extension is a typical triumph over common sense requiring mumbo-jumbo for the input, and this demo advises that external tools should be used. The first step in your idea of a module to generate the graph wikitext would be to do a simple test of what happens if a module outputs one of the demos—would it render as a graph, or is module processing too late for that? Johnuniq (talk) 23:23, 8 May 2015 (UTC)
You'll probably need to use frame:extensionTag to get the graph to render. Anomie 23:29, 8 May 2015 (UTC)
yes, i assumed as much... peace - קיפודנחש (aka kipod) (talk) 23:00, 11 May 2015 (UTC)
This is the biggest front-end development since Lua implementation, in my humble opinion. But, indeed—working with the tags directly is impossible. I don't think that's a bad thing necessarily, though: by going as verbose as possible the visualization engine is as extensible as possible, and once everything is neatly standardized and parametrized via templates, it'll be quite beautiful, I think. ResMar 03:20, 16 May 2015 (UTC)

Hi קיפודנחש (aka kipod), Anomie, Resident Mario, have a look at this by Mps:

Pong ball in flight.svg Atlasowa: Can't tell you how happy I am to see this; we need to port it over immediately. @DerHexer: you know anyone that would be willing to translate the documentation? ResMar 14:58, 12 June 2015 (UTC)
See also. ResMar 14:59, 12 June 2015 (UTC)
I went ahead and imported two bits: Module:Graph and Template:GraphChart. ResMar 18:04, 12 June 2015 (UTC)

Need a template to make and show list of pages in a category[edit]

Hi, I am from Bhojpuri wikipedia (bhwiki). I am designing our community portal and I need a template which can enlist and show all the pages in a category on the page where it is inserted. is it possible to get somthing like this?--Satyam Mishra --talk-- 18:58, 25 May 2015 (UTC)

There is an extension which provides some assistance, see Help:Category#Displaying category trees and page counts. In general, there might be over a million pages in a category, so listing them all would not be useful, and may not be possible in a module. Johnuniq (talk) 01:30, 26 May 2015 (UTC)
@Johnuniq: I don't need all. Just some of the pages, say, maximum 20 to 50 at once. And thanks for the link. I think "http://en.wikipedia.org/w/api.php?cmtitle=Category:Category_name&action=query&list=categorymembers&cmlimit=500&cmprop=title%7Csortkey%7Ctimestamp" will do this task but I don't know how to insert the result of this query on a page. Please help. It will be very kind of you if you write this program to populate my sandbox by 20 articles from the category:Geography (sort if possible by date to show recent most). Thanks !--Satyam Mishra --talk-- 04:19, 26 May 2015 (UTC)
Sorry, generating a list of pages in a category is outside my area. A quick look at the documentation at mw:Extension:CategoryTree indicates that the following would list up to a certain number of articles in Category:Geography, but the list is not in alphabetical order, and uses italics for some reason unknown to me, and you can't set the number. I'm confident that doing something like determining the date of last edit or of creation would be difficult and time consuming. That's the sort of thing which is best done by a bot.
{{#categorytree:Geography|hideroot|mode=pages|namespaces=0}}
Bear in mind also that the list would not be dynamic—it would not necessarily change when articles in the category change. That is because everything displayed is cached, and the page would need a WP:PURGE to update.
I think the proper procedure would be to use a bot if someone to write and maintain one were available, or more likely, use categorytree to display a list which a user can expand by clicking (I think they need Javascript enabled for that). The help page I linked earlier should lead to an example of that. Johnuniq (talk) 04:54, 26 May 2015 (UTC)
@सत्यम् मिश्र: One of the DynamicPageList extensions will do what you want, but you will need to ask for it to be enabled on your wiki before you can use it. It isn't possible to display the members of a category using only the standard version of Scribunto enabled on Wikimedia wikis. — Mr. Stradivarius ♪ talk ♪ 07:33, 26 May 2015 (UTC)
@Johnuniq and Mr. Stradivarius: Thanks a lot to both of you! I think for the time being my task can be done by "categorytree" (I tested) and I will try to get this extension on my wiki too. Thanks again for your kind help!--Satyam Mishra --talk-- 08:30, 26 May 2015 (UTC)

Replacement for Template:Val[edit]

See Template talk:Val § Behaviour on substitution. – Wbm1058 (talk) 15:12, 2 June 2015 (UTC)

There is an module in alpha stage at Module:Val. If you are willing to test it, then it will replace the wikicode sooner rather than later.--Snaevar (talk) 14:51, 10 June 2015 (UTC)