Jump to content

Welcome to FTB Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Photo

Lua infoboxes

infobox template lua module

5 replies to this topic

#1
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

So I've been working on a Lua port of the wiki's various infoboxes for quite some time now, but never really said anything about what I was actually planning, so here we go.

 

The main reasons why I started working on it in the first place was that the Template:Item got really crowded with parameters exclusive to certain block types. What I thought of was a modular and extendable system, meaning that all infoboxes are based on either a basic infobox or a similar one.

For example, we have a base infobox. The block infobox would be the base one, but with a few new rows added. The block one could then be used, for instance, in infoboxes for container blocks or EU storage blocks.

The advantages of that would be that we would have multiple more specific templates rather than a single crowded one, and we could also have specific default values, e. g. blocks stack to 64 and have "block" as default type.

 

What I've gotten so far is a single Lua module containing code for blank, modpack and item infoboxes. You can find a full list of them on my user page. The basic and pack boxes are working fine, so I thought about integrating them into the mainspace. Would that be fine with everyone? Anyone got any suggestions, opinions, criticism, questions? This would be quite a major thing, so I don't want to do it without talking about it first.


  • ostPavel likes this

#2
RZR0

RZR0

    Administrator

  • Operator
  • 1980 posts
  • IGN:RZR0
  • Modpack:Private Pack

You won't get any argument from me... Aside from the advantages you listed, Lua is way faster and less intensive for the server to process than wiki code is, so either way it'd be a massive improvement. The only downside is that it's less accessible for inexperienced users to work with. But I think the benefits certainly outweigh any disadvantages.



#3
felinoel

felinoel

    Steampunk Alchemist

  • Administrators
  • 3860 posts
  • Location:Somewhere, possibly?
  • IGN:felinoel
  • Modpack:FTB Mage Quest

So I've been working on a Lua port of the wiki's various infoboxes for quite some time now, but never really said anything about what I was actually planning

lol I was considering asking you what you were doing with all of that. :P
Watch all of my different Let's Play series, Minecraft and more!
player.me/felinoel


We need to make default article pages! Discuss their designs here!

#4
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Heh, unexperienced users will also have a hard time understanding regular wiki code infoboxes. In the end the Lua system may even be easier, appending new rows to the string of existing rows is fairly simple. Although you do still have to integrate it into the wiki template.
Is there a way to pass on all arguments from a template call directly to the invoked module? Wikipedia seems to do that, but somehow it didn't work for me.
And another thing - I'm not sure if I should keep all infoboxes in one module, or if one module per box would be better. Both would be possible.

 

PS:

It'll probably be better to have one module per box, that way I can move them over one by one.

 

PPS:

Another thing that I forgot... in the process of porting the infoboxes I created Module:dgelessus, which is supposed to be an all-purpose library, which currently only contains a Lua version of Template:Animate and the isGiven check. As those are also useful for things other than my personal projects we should probably move it to some other name, but what? GeneralLibrary? FTBWikiCore? RandomFunctions?



#5
dgelessus

dgelessus

    Advanced Member

  • Administrators
  • 1424 posts
  • IGN:dgelessus
  • Modpack:FTB Tech World 2

Progress! The modpack infobox has now been ported to Lua and makes use of the new system. Because the entire code has been completely rewritten from scratch, some aspects of the infobox may not work as expected. If you notice that a modpack infobox does not work as expected, please tell me and I will look into it.



#6
DiamondDoctor

DiamondDoctor

    Advanced Member

  • Validating
  • PipPipPip
  • 411 posts
  • Location:On this Plane Of Existence..?
  • Modpack:FTB Monster

Ahh lua so simple


  • ZL123 likes this

 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Did i help? If so, click that like button! (And then, click Here! This is a feedback poll! Help me Help you and others!) (Stalk me here on the forums!)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Bored? Watch these!(-IN THE FACE-...-DADADAOOMSDAY-...-Krieg-...-NFLBLR-...-NFLBLR2-...-Fosko-)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

"Speak softly and carry a diamond sword"-Me                                                                                                                                                                                            

Punching trees, falling off cliffs, punching grass... Now that i think of it, Minecraft sounds painful.                                                                                                 

The Word of the Week isIndefatigable!

Signature now with 89.6% more COLOR!                                                                                                              

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-DiamondDoctor

-For anyone interested, please, please, please check out my mod, AnyUtil, and post suggestions!

 

 




Reply to this topic



  



Also tagged with one or more of these keywords: infobox, template, lua, module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users