Confusion : MT Wiki says different things on Item Meta

Post Reply
User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Confusion : MT Wiki says different things on Item Meta

by LMD » Post

Here, it says :
get_metadata() returns a MetaDataRef
https://dev.minetest.net/ItemStack

And here it says :
Node meta data can be gotten via minetest.get_meta(pos), and item stack meta data from stack:get_meta().
https://dev.minetest.net/MetaDataRef

Whats the correct one now ? Why are the differing ?
My stuff: Projects - Mods - Website

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by Krock » Post

Thumb rule: Whatever lua_api.txt states is right.
Both wikis tend to be outdated and are not maintained too well. So I highly recommend to read the direct API reference from the repository to ensure the information is correct.
EDIT: Corrected the ItemStack wiki page
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by LMD » Post

Yeah, found that out too, but through trial and error :)
My stuff: Projects - Mods - Website

u34

Re: Confusion : MT Wiki says different things on Item Meta

by u34 » Post

Krock wrote:Thumb rule: Whatever lua_api.txt states is right.
Both wikis tend to be outdated and are not maintained too well. So I highly recommend to read the direct API reference from the repository to ensure the information is correct.
EDIT: Corrected the ItemStack wiki page
+1

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: Confusion : MT Wiki says different things on Item Meta

by Pyrollo » Post

What to do if you find something outdated/weird in the wiki ?

Have a look at the lua_api.txt file and spend some minutes updating the wiki accordingly.

Everyone will be grateful for that.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by Wuzzy » Post

The Developer Wiki should have never duplicated content from lua_api.txt in the first place, it's redundant, thus doomed to be inconsistent in future and creates a lot of pointless confusion.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by LMD » Post

Sorry, but I have to disagree. Unlike lua_api.txt, the Wiki is well structured, and thus helps me to find methods with less effort. IMO, the other way round : no lua_api.txt but Wiki is better.
My stuff: Projects - Mods - Website

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by Wuzzy » Post

You are completely missing my point.
Eye candy does not matter when the content is wrong.
You are only talking about visuals, I am talking about content.
Duplicating content from lua_api.txt manually is very bad practice.

lua_api.txt is written in Markdown syntax, so can be parsed and pretty-printed automatically by scripts, see rubenwardy's example. Maybe a pretty-printed version of lua_api.txt should be included in the repo as well. Theoretically, it could even be parsed to generate wiki pages, although that doesn't really make sense to me. Plain old HTML would make more sense.

I agree that making the docs readable is important, but the approach of the Developer Wiki is completely wrong. Improvements to the docs should, first and foremost, be done in lua_api.txt directly, because this is the ONLY canonical API reference, everything else is just folklore.

The wiki docs are NOT automatically generated from lua_api.txt, everything is hand-copied, which is a huge problem. This is the exact reason why much of the wiki is completely wrong, when it comes to Lua API reference. The Developer Wiki is also not a versioned documentation, which is also very bad.
Thus, I cannot recommend to use the Developer Wiki as a reference.

So, I'm all for pretty-printing the documentation, but it should be done automatically, not manually.

User avatar
v-rob
Developer
Posts: 970
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Confusion : MT Wiki says different things on Item Meta

by v-rob » Post

I use the wiki only for clarification. I find what I want in lua_api.txt, and then see if I can find more info on the wiki. It would be nicer if the wiki had all correct information, though.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Confusion : MT Wiki says different things on Item Meta

by paramat » Post

The documentation in the repo, like lua_api.txt, is the official documentation, the wiki is not official documentation and the core devs don't have time to keep it up to date.

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by TumeniNodes » Post

paramat wrote:The documentation in the repo, like lua_api.txt, is the official documentation, the wiki is not official documentation and the core devs don't have time to keep it up to date.
Seems sensible, that one could simply copy the official documentations from the repo, to the wiki or, use a link to direct too it.
This may already be in place (the link), but I am unsure, as I do not use the dev wiki

But that is something which should be done by someone who (a). has the time, and (b). is able to do so correctly.
A Wonderful World

Astrobe
Member
Posts: 570
Joined: Sun Apr 01, 2018 10:46

Re: Confusion : MT Wiki says different things on Item Meta

by Astrobe » Post

Wuzzy wrote:You are completely missing my point.
Eye candy does not matter when the content is wrong.
You are only talking about visuals, I am talking about content.
It's more about convenience than visuals. Like being able to click on "itemstack" to get to the definition of the class, instead of doing a file search.
lua_api.txt is written in Markdown syntax, so can be parsed and pretty-printed automatically by scripts, see rubenwardy's example. Maybe a pretty-printed version of lua_api.txt should be included in the repo as well. Theoretically, it could even be parsed to generate wiki pages, although that doesn't really make sense to me. Plain old HTML would make more sense.
Yet, when someone sees the documentation is lacking on some point, you have him or her to make a pull request. If you compare side by side Github and a Wiki, that's three steps versus two from scratch (github: register account, clone the repo, make pull request; wiki: register account, edit the freaking page). And here, I overlook the tiny little detail that the poor soul may have to learn git in the process (some won't, some will but also will forget what they were doing and some will ascend to the astral plane and just to throw that freaking amulet at your face).

Have someone here heard of the concept of "path of least resistance"?
Maybe a pretty-printed version of lua_api.txt should be included in the repo as well.
So what is recommend there is either:
- have people use an extra tool to get a decent-looking documentation, which sucks
- or include an auto-generated file in a git repo, which is bad practice (granted, it won't set the repo on fire, but still)

I'll leave here for reference the "developer Wiki" of another FOSS game, Oolite:

http://wiki.alioth.net/index.php/Oolite ... ject_model

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by LMD » Post

I feel this post should now be more called like : What about Minetest Wiki ?
My stuff: Projects - Mods - Website

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Confusion : MT Wiki says different things on Item Meta

by Wuzzy » Post

All of this doesn't change the fact the Developer Wiki is not official and just plain wrong in many places. It's useless to try to convince me, as it won't change the current situation.
You should talk to the core devs who actually make the decisions WRT documentation.

Post Reply

Who is online

Users browsing this forum: milkshake and 4 guests