Topic on Project:Support desk

Is it possible to reverse engineer Lua modules?

9
NeedAGoodUsername (talkcontribs)

A lot of popular template on Wikipedia (like {{Ambox}}) now use Lua modules.

If it possible to reverse engineer these so that those who don't know Lua can use them?

AhmadF.Cheema (talkcontribs)

You don't need to know Lua to be able to use them. If you can import them to your Wiki, they can be used just like any other templates (i.e. by using {{ }}).

NeedAGoodUsername (talkcontribs)

But the issue is customising them to suit your wiki's needs, for example adding a new type of Ambox, or using an ambox in a different way than what Wikipedia uses (like having an ambox on a talk page).

AhmadF.Cheema (talkcontribs)

From what I know, it will be a lot of work to reverse-engineer the templates (if someone doesn't know Lua).

It will probably be easier to start from scratch and try to come up with a template that looks the same on the surface.

Also, for talk pages there is the Wikipedia:Template:Tmbox.

NeedAGoodUsername (talkcontribs)

Right, and that's the problem - I doubt someone would want to reverse engineer things and would simply resort to saying "just learn lua".

Another problem might be that, if you looked at how the templates were made back before they got converted to Lua ones, is that they never uses a table or anything conventional in HTML to make them.

AhmadF.Cheema (talkcontribs)

By-the-way, have you looked at the older versions of Ambox, like the ones in 2007, they do not use Lua and might give the same surface result.

NeedAGoodUsername (talkcontribs)

I have, the issue there is that they use other templates in them, and you would need to get every template used from ~2007 to make it work properly.

AhmadF.Cheema (talkcontribs)

No, I don't think that's the case. I tried this one and it seemed to work.

The templates and modules that are shown underneath the source code are probably being used in the template documentation (which is being transcluded from the present /doc page) and not the template itself.

137.147.181.133 (talkcontribs)

These message boxes are ultimately just a table with an image in one cell and the message in the other. They have a ton of extra functionality on top of that, that you're unlikely to really need which makes them much more complicated. If you just want a box to display a message in, it doesn't need any of this complication.

{| style="margin:0 10%; border:1px solid #aaa; border-left: 10px solid #1e90ff; background:#fbfbfb"
| style="padding:2px 0 2px 0.5em" | [[File:Information icon4.svg|40px|link=]]
| style="padding:0.25em 0.5em; width:100%" | {{{text|Your message here}}}
|}
Your message here

A basic message box is as simple as that.

Reply to "Is it possible to reverse engineer Lua modules?"