LÖVE-API Documentation (as a lua table)

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

I started a new public branch for the 0.10.0 update - contributions are welcome!
https://github.com/rm-code/love-api/tre ... 0.0-update

https://github.com/rm-code/love-api/issues/8
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

Small heads-up about a change in structure: I decided to move all enums and types to separate files (makes it a bit easier for me to keep the whole thing up to date). You should still be able to use the API as before though.

The structure looks like this now:

Code: Select all

love_api.lua
> modules
    > audio
        audio.lua
        > enums
             DistanceModel.lua
             ...
        > types
             Source.lua
    > event
    > filesystem
    ...
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by s-ol »

May I suggest that instead of structuring things like

Code: Select all

modules.keyboard.Keyboard
modules.keyboard.enums.KeyConstant
you put the main files as init.lua?

Code: Select all

modules.keyboard (modules/keyboard/init.lua)    requires
modules.keyboard.enums (modules/keyboard/enums/init.lua)   returns
modules.keyboard.enums.KeyConstant
or something like that. At least I find it weird that modules.keyboard.Keyboard exists.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

S0lll0s wrote:At least I find it weird that modules.keyboard.Keyboard exists.
True, but it's just a simple way of structuring the whole thing. Personally I don't really mind since the require statements are just needed inside of the doc itself.

Hmm ... Unless you want to require them on their own for some reason?

Anyway I'd be open for a pull request :)
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by s-ol »

rmcode wrote:
S0lll0s wrote:At least I find it weird that modules.keyboard.Keyboard exists.
True, but it's just a simple way of structuring the whole thing. Personally I don't really mind since the require statements are just needed inside of the doc itself.

Hmm ... Unless you want to require them on their own for some reason?

Anyway I'd be open for a pull request :)
I'll put something together tomorrow if I remember to...

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: LÖVE-API Documentation (as a lua table)

Post by Santos »

Thanks to rmcode and contributors I've been able to update my one-page reference to 0.10.0. Edit: New location: http://love2d-community.github.io/love-api/
Last edited by Santos on Fri Feb 19, 2016 2:47 am, edited 1 time in total.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

Santos wrote:Thanks to rmcode and contributors I've been able to update my one-page reference to 0.10.0: http://loveref.github.io/
Very nice :)

I finally added travis-ci integration to check the integrity of the api-table (missing brackets, old require statements, etc.). I use busted for testing.

Currently the test is really simple:

Code: Select all

describe( 'LÖVE-API Integrity test', function()
    it( 'makes sure the api table is valid', function()
        local api = require( 'love_api' )
        assert( api )
    end)
end)
But it could be extended to make sure the tables are filled correctly (e.g. arguments are kept in a sub-table and so on).
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

The api has been transferred to the LÖVE organisation on github.
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: LÖVE-API Documentation (as a lua table)

Post by pgimeno »

Nice! Updating the list of libraries to reflect that would be a good idea.
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: LÖVE-API Documentation (as a lua table)

Post by rmcode »

Done.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests