Mudlet / Mudlet

⚔️ A cross-platform, open source, and super fast MUD client with scripting in Lua
https://mudlet.org
GNU General Public License v2.0
736 stars 268 forks source link

Public functions missing documentation in wiki #1149

Open Kebap opened 7 years ago

Kebap commented 7 years ago

Looking at /src/mudlet-lua/lua/Other.lua there seems to be an optional parameter to permGroup() command which has not been included in manual, yet. Am I right? Should we update the manual? Are there other updates missing?

Manual: permGroup(name, itemtype) Source: permGroup(name, itemtype, parent)

vadi2 commented 7 years ago

It was a feature added recently in 3.1.0, I missed the manual in the documentation update. Mind fixing this?

Kebap commented 7 years ago

Done. This issue can be closed.

Kebap commented 7 years ago

Here are a few functions with missing manual entries I found while working on #1150

debugc closeUserWindow setMainWindowSize auditAreas getMudletLuaDefaultPaths sendATCP tempButtonToolbar permBeginOfLineStringTrigger removeSpecialExit

Need to include in wiki manual as well

vadi2 commented 7 years ago

Great find! Some of those are just internal to Mudlet, though I suppose it wouldn't hurt to document most of them.

closeUserWindow should stay undocumented, we've agreed that it doesn't really 'close' anyway, hideUserWindow is there to do the job. It's still left in because it was added eons ago and some scripts could have used it.

Kebap commented 7 years ago

Sorry, I think that's wrong. I had checked initLuaGlobals() and all of those above are mentioned there, so I assumed they were available for users. That is why including in the manual makes sense.

You still raise a good question. Where do we want to document internal functions? If they should not be announced to users, they can't go to the wiki, right? Or maybe just a different wiki page, named "not recommended usage for users"?

vadi2 commented 7 years ago

Thinking about the list again, it's just getMudletLuaDefaultPaths() that is really internal. I was thinking of auditAreas() as well previously but that would be useful for mappers to run.

Not sure creating a special page just to tell people "you can ignore these functions" is worthwhile - maybe just a paragraph with a list of them?

Kebap commented 7 years ago

No not for users especially, but for developers, because we want documentation in wiki not in source, right?

We could also say, internal functions are documented in source, only external are in wiki, but that might get blurry quickly

Kebap commented 7 years ago

Status update.

Added and ok:

Added, but needs more details:

Not sure if/where to add documentation:

Not sure what to add as documentation:

vadi2 commented 7 years ago

Thanks for the update!

getMudletLuaDefaultPaths() is the same thing, it got renamed.

debugc() is the function that is available - and that prints to the Debug window when you've got it open.

Kebap commented 7 years ago

Upcoming IRC changes (3.3) need to be checked in wiki manual, see #1087 for a complete list

Kebap commented 7 years ago

Added and ok:

Added, but needs an example:

Renamed and ok:

Kebap commented 7 years ago

@SlySven Could you provide a description for auditAreas() maybe?

Kebap commented 7 years ago

Here is another public function missing documentation:

Two internal functions missing documentation - where to put internal documentation?

Are the details of documentation in source still valid? Because source shows more information than wiki. I could just add that there, but not sure if outdated or no:

vadi2 commented 7 years ago

For calcFontWidth() and calcFontHeight(), right above the function definition. For playSoundFile() - I think that information is outdated in the .lua file, by a long shot.

Kebap commented 7 years ago

A few more public functions missing documentation:

To be added to wiki

vadi2 commented 7 years ago

Ah man, good find.

Kebap commented 7 years ago

Review TLuaInterpreter.cpp is almost done. Found some additional functions without documentation.

Total list (combined with open issues from above):

To be added to wiki

Question:

Questionable documentation, can be deleted in source? Or added to wiki, too?

SlySven commented 7 years ago

The ones I can offer input on:

The setDoor() command functions as documented in the source code (and is matched in functionality by the room exits dialog in the 2D mapper) but produces no visible effect on non XY-plane exits (or XY-plane ones with custom exit lines or that are stubs) in the 2D mapper currently i.e. doors on up, down, in, out and special exits do not currently show up although eventually I will get new code into the mapper to show them (around the same time as a wider range of room characters or "symbols" probably...) I guess😀

vadi2 commented 5 years ago

getAllAreaUserData is now documented thanks to Liam DeFey

Kebap commented 4 years ago

There are still a few left. For each of the following, we can either:

Do you see any other way to get them out of the published-but-undocumented-somehow limbo state?

(The following list contains edits to reflect the updates happening and discussion posted below here)

vadi2 commented 4 years ago

loadRawFile is OK to document. Not all functions are perfect, some have known issues - doesn't mean they shouldn't be documented. removeMapMenu, getMapMenus, cut, auditAreas good to document. insertHTML, pasteWindow - other functions already do their job, don't need to document. setDefaultAreaVisible - to be honest pretty exotic usecase, I would be surprised if anyone else actually uses this, and maybe surprised if the original requester ended up using it. Too late to be doing anything about it now, good to document.

Kebap commented 4 years ago

getMapMenus

  • Vadi said: good to document.

Actually found a bug here & reported it as issue #4138 Continue to publish documentation before fix arrives? 🤔

loadRawFile

  • SlySven said: looks as though it would initiate a replay from a lua script, but as the replay system is not multi-profile safe and we do not have a locking system in place for it to prevent more than one replay being loaded at a time at the moment I wouldn't want to draw undue attention to it right now...!
  • Vadi said: is OK to document. Not all functions are perfect, some have known issues - doesn't mean they shouldn't be documented.

Code said, this should rather be named loadReplay - so I agree and publish it as such. The original published API stays public for backward compatibility, but is not documented under that name.

vadi2 commented 4 years ago

Lets fix it first :)

Kebap commented 3 years ago

Also TLuaInterpreter::Wait() is published to Lua as wait() but in code is commented as internal function.

Should it be published at all? If so, do we add documentation? Otherwise need to change the comment.

vadi2 commented 3 years ago

Not safe and should not be used in general, but only in the context of coroutines like this where it's amazing: https://forums.mudlet.org/viewtopic.php?f=6&t=22875

It was left undocumented for this reason but then the coroutine usecase came up. We can:

vadi2 commented 2 years ago

@Kebap what's your take?

SlySven commented 2 years ago

IIRC The loadRawFile(...)/loadReplay(...) function is now multi-playing safe - it will reject any usage whilst a replay is in progress in any profile - as part of #1519 .

However I notice that in #4157 @smurfix crippled the original `loadRawFile(...) function so it is not actually functional - which technically broke the backward compatibility promise - though you, @vadi2, approved it.

vadi2 commented 2 years ago

Yes, because it did not actually break any scripts - and we haven't had any issues with that in the two years since. So that was a good change :+1:

ZookaOnGit commented 2 weeks ago

Can we get a relist of missing functions here please? I'll get the staff writers on it.