Extension talk:Capiunto

About this board

Creating Module:CapiuntoTest fails with Error

1
MvW.nl (talkcontribs)

Hi!

Downloaded and installed according to the instructions, however setting up Module:CapiuntoTest fails with a bold Error: Lua error: failed to create process: proc_open(/dev/null): failed to open stream: Operation not permitted

Warning: proc_open(): open_basedir restriction in effect. File(/dev/null) is not within the allowed path(s): (/var/services/web:/tmp:/var/services/tmp) in /volume1/web/mediawiki/extensions/Scribunto/includes/engines/LuaStandalone/LuaStandaloneInterpreter.php on line 153

Warning: proc_open(/dev/null): failed to open stream: Operation not permitted in /volume1/web/mediawiki/extensions/Scribunto/includes/engines/LuaStandalone/LuaStandaloneInterpreter.php on line 153


Now i am kind of lost, suspecting this might have something to do with access to the lua file, however it is executable.

I'm installing on a Synology NAS and running Mediawiki version 1.35

Do you have any suggestion how to get this solved?

Reply to "Creating Module:CapiuntoTest fails with Error"

Any chance it will be used on Wikimedia sites

1
Amire80 (talkcontribs)

Hello!

This extension is deployed on some of Wikimedia's testing wikis, but it looks like there hasn't been any development on it in a while.

Is there a plan to ever deploy it on production Wikimedia sites, or not really?

Reply to "Any chance it will be used on Wikimedia sites"

Question about multiple images in infoboxes

1
Flyingratchet (talkcontribs)

I wonder if there is a way of having images displayed anywhere but the top of the infobox? I noticed that although the :addRow and :addHeader commands output to the infobox in the order they are listed in the Lua Module—:addImage insertions always float to the top with no way to separate multiple images with formatting or headers. Thought I'd post the question here in case I'm missing something.

Reply to "Question about multiple images in infoboxes"

Simple way to use conditional :addRow commands in Module?

2
Flyingratchet (talkcontribs)

I'm sure I'm missing something but after much reading of documentation and Googling I can't figure out how to have conditional control of the Capiunto :addRow command. First and foremost I'm just trying to say that if there is no information provided by the template call then don't add the row to the infobox.


I found the following code from here

if args.myArgs then retval:addRow('My Args', args.myArgs) end

that seems to be for this purpose but when I add a line like this among other just regular :addRow lines—I get an error "unexpected symbol ":" near "addRow". I'm sure I'm just doing something boneheaded but can't figure it out. Here is the full code in my module.


local capiunto = require 'capiunto'

local p = {}

function p.main(frame)

local args = frame:getParent().args

local headerStyle

if args.headerstyle and args.headerstyle ~= '' then

headerStyle = string.format('background-color:%s;', args.headerstyle)

else

headerStyle = 'background-color:#bae4bc;'

end

local retval = capiunto.create( {

Title = args.Title,

headerStyle = headerStyle,

} )

    :addRow( 'Type', args.Type)

    if args.myArgs then retval:addRow('My Args', args.myArgs) end

    :addRow( 'Focus', args.Focus )

:addRow( 'Focus_keywords', args.Focus_keywords )

:addRow( 'Geographic purview', args.Geographic_purview )

    :addRow( 'Website', args.Website )

return retval

end

return p

Flyingratchet (talkcontribs)

I figured out my own question finally—just a problem with my ignorance of syntax. The Capiunto ":addRow" commands that are inside control loops need to be explicitly prefaced by the name of the local variable, in this case "retval", so "retval:addRow" not ":addRow". The latter version works when the commands are outside the control loops.

Reply to "Simple way to use conditional :addRow commands in Module?"
Proactive programming (talkcontribs)

Has anybody tried to use this extension with Cargo? Do you have some examples?

Flyingratchet (talkcontribs)

Late reply and probably not terribly useful. I'm certainly not the best to ask as I only know enough to be dangerous and been teaching myself slowly but I have gotten Capiunto and Cargo working together. Unfortunately don't have great examples as everything is on a private wiki I'm building so far. I ended up adding the cargo_declare and cargo_store commands on the same template that contains the command which invokes the Lua Infobox Module (middle column labeled "Template" text for the quick start info here Extension:Capiunto). Happy to answer other questions if you have them.

Reply to "Capiuno and Cargo"

Row-styling function

3
Mr. Stradivarius (talkcontribs)

We had a discussion on the enwiki Template:Infobox talk page a while back about having different styles for odd- and even-numbered headers in infoboxes. At the moment this happens in en:Template:Infobox baseball biography, for example in the en:Ichiro Suzuki article, which alternates the colour of the header cells between each of Ichiro's two team colours. At the moment it does this by using a horrible hack; each second header in the infobox is in fact a child infobox with the headerstyle set to the team's secondary colour. It would be nice to be able to specify conditional styles for rows or headers so that we can do away with hacks like this.

Different infoboxes will have different requirements for conditional styling, though. One infobox might require every even-numbered header to be a certain colour, and another might require every second data row after a header to be a certain colour. Because of this, I think the functionality may be best implemented as a function that can be passed to the infobox object. It would take a few different parameters as input: the row number, the header number, isHeader, and the number of rows since the last header. And as output, it could produce a table that would then be passed to mw.html:css. Is this idea workable?

Proactive programming (talkcontribs)

Old comment, but with modern CSS3 this is very easy to do with standard CSS. No hacking needed.

Mr. Stradivarius (talkcontribs)

I guess this should be easier now that we have Extension:TemplateStyles. I haven't checked to see if this is possible with the subset of styles that are allowed in the extension though.

Reply to "Row-styling function"

1.35 with Scribunto and Capiunto ?

1
Summary by Karima Rafes

Capiunto works with the version 1.35 of Mediawiki and Scribunto.

Karima Rafes (talkcontribs)

Hello,

I installed Mediawiki 1.35 with Scribunto but Capiunto does not work. Anyone else having this problem?

Thanks

Testing on lmo.wp and nap.wp

2
Sannita (talkcontribs)

@Hoo man: As I already told you at Wikimania 17, I might have found someone who can be interested in testing your extension on minor WP project. Pinging @Sciking: for lmo and @Ruthven: for nap (who's also a it.wp admin), who kindly volunteered. :) I'll try to stick around and give a hand, as much as I can too.

Ruthven (talkcontribs)

Hi, I'm here. Feel free to write me whenever you want/can.

Reply to "Testing on lmo.wp and nap.wp"

Tutorial or instructions?

9
209.252.234.128 (talkcontribs)

I am a total newb at MediaWiki and am trying it out on a WIMP stack.
MediaWiki 1.23.8 on IIS 7.5
PHP 5.6.5 (cgi-fcgi)
MySQL 5.6.22-log
Lua 5.1.4

After much frustration trying to get the Wikipedia infoboxe templates to work I decided to look into Capiunto. Got the extension and enabled it, but I am at a total loss for how to use it. I see here that it involves Lua code, but where am I supposed to put this? How do I use it?

Hoo man (talkcontribs)

Hi :) I assume you got MediaWiki, Scribunto and Capiunto installed correctly. After you've done that, you can create Lua modules on your Wiki by creating Module:NameOfYourModule with the Lua code for your module. The Lua code there returns a table with methods which you can invoke from your Wiki pages. More detailed instructions for that can be found at the English Wikipedia (although that's a Wikipedia help page all information there will apply also to your local setup).

After you have a basic idea how to make these Lua modules work, you can experiment with the Capiunto methods outlined in the documentation.

If you have further questions, feel free to ask me (but poking me on meta or on my user talk page here might be necessary, as I barely check my watchlist over here).

DksDev064 (talkcontribs)

Thank you for the quick response! I think you left out the links, though?

I will get working on adding these and playing around with them. I am a pretty quick learner but this is all totally foreign to me as a lowly windows developer :/

Hoo man (talkcontribs)

Oh sorry, the link to that help page got lost... fixed.

DksDev064 (talkcontribs)

I'm still missing something here I think.
I added the code at the top of this page to a module page in my wiki, but when I added {{#invoke:testInfobox|create}} to a test page I got a script error saying Lua error in package.lua at line 80: module `capiunto' not found.

Hoo man (talkcontribs)

Please make sure you have the latest version of Capiunto, that was changed only recently (but will stay stable now, in preparation to deploying it to the Wikimedia Foundation sites)

DksDev064 (talkcontribs)

I am downloading from the extension page on mediawiki.org, which I assume is the latest version. I have 1.23, but tried the 1.24 version just in case and still get the same error.

On my version page says - in the column for version of Capiunto

Hoo man (talkcontribs)

You need to download the master version, which is said to be a development version, but should work with 1.24 just fine.

DksDev064 (talkcontribs)

Okay I had to upgrade to 1.24 for a number of reasons, and now I am back to working with Capiunto. Still getting a lua script error when trying to invoke the module, but now it is simply

Script error: The module returned a nil value. It is supposed to return an export table. No further details are available.

Reply to "Tutorial or instructions?"

Multi-column infoboxes

2
Mr. Stradivarius (talkcontribs)

On enwiki we have en:Template:Infobox3cols, which makes it possible to specify one label and two data cells on each row. This is used in quite a few sports-related infoboxes for career statistics, e.g. en:Template:Infobox AFL biography. Infobox3cols has about 150,000 transclusions on enwiki at the moment. Would it be possible to add support for another data cell so that infoboxes that use infobox3cols can be converted to Capiunto easily? I'm not aware of any infoboxes that use more than three columns, but I shall have another look around and report my findings.

Mr. Stradivarius (talkcontribs)

It's been pointed out to me that infobox3cols actually allows four columns, despite its name. See en:Teddy Sheringham for an example of an infobox with the full four columns in use.

Reply to "Multi-column infoboxes"
There are no older topics
Return to "Capiunto" page.