love2d-community / love-api

The whole LÖVE wiki in a Lua table.
http://love2d-community.github.io/love-api/
299 stars 47 forks source link

Wiki scraping #84

Open hahawoo opened 4 years ago

hahawoo commented 4 years ago

I've finally made a wiki scraper, which means (ideally) we don't have to manually edit the table anymore.

It's not perfect, for example it doesn't scrape modules for their names and descriptions.

rm-code commented 4 years ago

@hahawoo I just tried updating love-atom and ran into an issue because there is a variant missing for:

https://github.com/love2d-community/love-api/blob/5a09fcc26e90d366643cd5bcc53a5942617d70b9/modules/audio/Audio.lua#L12

hahawoo commented 4 years ago

I found 4 functions with no variants using this code:

api = require('love-api.extra')(require('love-api.love_api'))

for i, v in ipairs(api.allfunctions) do
    if #v.variants == 0 then
        print(v.fullname)
    end
end

which found:

love.audio.getActiveEffects
ChainShape:getPoints
PrismaticJoint:setLimitsEnabled
PrismaticJoint:setMotorEnabled

love.audio.getActiveEffects and ChainShape:getPoints were missing the "arguments" section on their wiki pages, so I've fixed the wiki pages.

PrismaticJoint:setLimitsEnabled and PrismaticJoint:setMotorEnabled were an issue with the scraper which I've also now fixed (these functions were both removed/renamed and re-added).

I've updated the table. Hopefully it will work now! :)

hahawoo commented 4 years ago

KeyConstant isn't currently scraped correctly.

hahawoo commented 4 years ago