lenscas / tealr

A wrapper around mlua to generate documentation, definition files and other helpers
69 stars 9 forks source link

keep track of instances that have to become global #49

Closed lenscas closed 2 years ago

makspll commented 2 years ago

I've been looking through other games' lua documentation, I think factorio has a great and simple one that's similar to tealr's:

https://lua-api.factorio.com/latest/defines.html#defines.command.compound.

What I think would help placing globals in the documentation are categories in the scrollbar, like here: image

I believe defines are just lua globals in factorio's case.

What I also like about their docs, is that the navbar is very succinct, it lets you easilly scroll through the fuck-tone of types they have.

So here are my suggestions:

  1. Reduce clutter in navbar by not showing methods under types, or making them collapsible. Removing some of the icons
  2. Add categories to the navbar
  3. Put globals in their own category

Now the way I am exposing global "modules" right now is using userdata modules, so for example Vec2, will have a Vec2Globals userdata which is exposed as say the global variable Vec2,

Ideally there should be a way to have the Vec2Globals module not be shown in the navbar at all, but only under the global entry for Vec2

lenscas commented 2 years ago

My plan will be to first get globals to work with the documentation in the first place and then in a separate PR improve how the documentation looks