{"id":13524552,"url":"https://github.com/love2d-community/love-api","last_synced_at":"2025-05-16T01:07:17.675Z","repository":{"id":29256219,"uuid":"32788810","full_name":"love2d-community/love-api","owner":"love2d-community","description":"The whole LÖVE wiki in a Lua table.","archived":false,"fork":false,"pushed_at":"2025-04-13T17:12:36.000Z","size":7159,"stargazers_count":325,"open_issues_count":12,"forks_count":52,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-11T10:52:42.822Z","etag":null,"topics":["love2d","lua"],"latest_commit_sha":null,"homepage":"http://love2d-community.github.io/love-api/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/love2d-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-24T09:27:28.000Z","updated_at":"2025-05-11T07:27:28.000Z","dependencies_parsed_at":"2023-02-15T06:45:36.834Z","dependency_job_id":"f10bf698-3d40-43d0-b22a-83019ff3eb81","html_url":"https://github.com/love2d-community/love-api","commit_stats":{"total_commits":809,"total_committers":35,"mean_commits":"23.114285714285714","dds":0.2818294190358467,"last_synced_commit":"4244742f91172dda6dfc287a8564346c8d3cdb7f"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/love2d-community%2Flove-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/love2d-community%2Flove-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/love2d-community%2Flove-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/love2d-community%2Flove-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/love2d-community","download_url":"https://codeload.github.com/love2d-community/love-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["love2d","lua"],"created_at":"2024-08-01T06:01:11.157Z","updated_at":"2025-05-16T01:07:12.665Z","avatar_url":"https://github.com/love2d-community.png","language":"Lua","funding_links":[],"categories":["Development"],"sub_categories":[],"readme":"# LÖVE-API\n\n[![Deploy](https://github.com/love2d-community/love-api/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/love2d-community/love-api/actions/workflows/gh-pages.yml)\n[![pages-build-deployment](https://github.com/love2d-community/love-api/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/love2d-community/love-api/actions/workflows/pages/pages-build-deployment)\n[![LÖVE](https://img.shields.io/badge/L%C3%96VE-11.5-EA316E.svg)](http://love2d.org/)\n\nThe complete API documentation of [LÖVE](https://love2d.org/) contained in a Lua table.\n\nThe API information is updated manually based on the [LÖVE Wiki](https://love2d.org/wiki). Therefore there is no guarantee that everything is correct and up to date. If you find any errors, outdated information or missing content, please file a [bug report](https://github.com/rm-code/love-api/issues) or create a [pull request](https://github.com/rm-code/love-api/pulls).\n\nContributions are more than welcome!\n\n## Versions\n\n- The master branch contains the most recent documentation, is constantly updated and follows the [official wiki](https://love2d.org/wiki)\n- You can find the documentation for older versions by checking the [releases](https://github.com/rm-code/love-api/releases)\n\n## Projects using the LÖVE-API\n\n- [ZeroBrane Studio](http://studio.zerobrane.com/) - A lightweight Lua IDE\n- [LÖVE Atom](https://atom.io/packages/love-atom) - Snippets and autocompletion for [Atom](https://atom.io/)\n- [LÖVE Hints](https://gitlab.com/sdonalcreative/brackets-love-hints/) - Snippets, code hints and autocompletion for [Brackets](http://brackets.io/)\n- [LÖVE-IDEA](https://github.com/rm-code/love-IDEA-plugin) - Snippets and code completion for [IntelliJ IDEA](https://www.jetbrains.com/idea/)\n- [Vim LOVE Docs](https://github.com/davisdude/vim-love-docs) - Syntax highlighting for [Vim](http://www.vim.org)\n- [LÖVE API for Notepad++](https://github.com/dail8859/love-api-npp) - Code completion and documentation for [Notepad++](https://notepad-plus-plus.org/)\n- [love-eclipse-ldt](https://github.com/leafi/love-eclipse-ldt) - Code completion and documentation for [Lua Development Tools](https://eclipse.org/ldt/)\n- [love-ide](https://github.com/rameshvarun/love-ide) - Code completion and other tools for [Atom](https://atom.io/)\n- [Emmy-love-api](https://github.com/EmmyLua/Emmy-love-api) - A script to generate LÖVE API autocomplete files for EmmyLua\n- [love2d-tl](https://github.com/MikuAuahDark/love2d-tl) - Type definitions for [Teal](https://github.com/teal-language/tl)\n- [Quick Reference](http://love2d-community.github.io/love-api/) - Online quick reference of the LÖVE API\n- [Lua language server](https://github.com/LuaLS/lua-language-server) - Provides various language features for Lua to make development easier and faster.\n\n## Table structure\n\n```lua\nreturn {\n    version = '11.5',\n    functions = { -- Functions not in modules, currently only love.getVersion\n        -- See function structure below\n    },\n    modules = {\n        {\n            name = 'modulename',\n            description = 'Description.',\n            types = {\n                -- See type structure below\n            },\n            functions = {\n                -- See function structure below\n            },\n            enums = {\n                {\n                    name = 'EnumName',\n                    description = 'Description.',\n                    constants = {\n                        {\n                            name = 'constantname',\n                            description = 'Description.'\n                        }\n                    }\n                }\n            }\n        }\n    },\n    types = { -- Currently only supertypes\n        -- See type structure below\n    },\n    callbacks = {\n        -- See function structure below\n    }\n}\n```\n\n```lua\ntypes = {\n    {\n        name = 'TypeName',\n        description = 'Description.',\n        constructors = { -- Optional\n            'newTypeName'\n        },\n        functions = { -- Optional\n            -- See function structure below\n        },\n        supertypes = { -- Optional\n            'Supertype'\n        }\n    }\n}\n```\n\n```lua\nfunctions = { -- callbacks = {\n    {\n        name = 'functionName',\n        description = 'Description.',\n        variants = {\n            {\n                returns = { -- Optional\n                    {\n                        type = 'type',\n                        name = 'name',\n                        description = 'Description.',\n                        table = { -- If type is table\n                            {\n                                type = 'string',\n                                name = 'name',\n                                description = 'Description.'\n                            }\n                        }\n                    }\n                },\n                arguments = { -- Optional\n                    {\n                        type = 'type',\n                        name = 'name',\n                        default = 'default argument', -- Optional\n                        description = 'Description.',\n                        table = { -- If type is table\n                            {\n                                type = 'string',\n                                name = 'name',\n                                default = 'nil', -- Optional\n                                description = 'Description.'\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\n## Extra\n\nFor ease of use, `extra.lua` adds some extra tables.\n\nIt is required like this:\n\n```lua\napi = require('love-api.extra')(require('love-api.love_api'))\n```\n\nIt makes the following changes:\n\n* The objects/functions/callbacks in the \"love module\" are now in a module like the other modules, named \"love\".\n* Table fields which were optional before now contain empty tables (these fields: functions, types, enums, returns, arguments, constructors, supertypes)\n* Types now have a table of **subtypes**.\n* **what** field is a string saying what the table is, e.g.  'function', 'method', 'argument' etc.\n* **id** field is a unique string for each table with a **what** field.\n* There are now fields pointing to where a table comes from, e.g. an argument table has the fields **module**, **function_** and **variant**.\n* Modules and functions have the fields **fullname** (e.g. 'love.graphics.newImage') and **prefix** (e.g. 'love.graphics.')\n* Functions have an optional field **constructs**, which points to the type it constructs, and **getter** and **setter** which is the corresponding getter/setter to the state the function sets/gets.\n* **api.everything** contains every table with a **what** field.\n* There are fields with subsets of **api.everything**, e.g. **api.allfunctions** (containing functions, methods and callbacks), **api.enums**, etc.\n* **api.byfullname** which is indexed by fullname, and **api.byid** which is indexed by ID. For example `api.byfullname['love.graphics.draw']`\n\n### Example: function synopsis list\n\n```lua\napi = require('extra')(require('love-api.love_api'))\n\ntable.sort(api.variants, function(a, b) return a.function_.fullname \u003c b.function_.fullname end)\n\nlocal s = ''\n\nfor _, variant in ipairs(api.variants) do\n    local function list(t)\n        local s = ''\n\n        for i, a in ipairs(t) do\n            s = s..a.name\n\n            if a.default then\n                s = s..' ['..a.default..']'\n            end\n\n            if i ~= #t then\n                s = s..', '\n            end\n        end\n\n        return s\n    end\n\n    if #variant.returns \u003e 0 then\n        s = s..list(variant.returns)..' = '\n    end\n\n    s = s..variant.function_.fullname..'('\n\n    if #variant.arguments \u003e 0 then\n        s = s..list(variant.arguments)\n    end\n\n    s = s..')\\n'\nend\n\nprint(s)\n```\n\n## Extra table structure\n\n```lua\nreturn {\n    version = '11.5',\n    modules = {\n        {\n            name = 'modulename',\n            fullname = 'love.modulename', -- or 'love'\n            prefix = 'love.' -- or '' for 'love'\n\n            description = 'Description.',\n            minidescription = 'Description.',\n\n            types = {},\n            functions = {},\n            enums = {},\n\n            what = 'module',\n            id = 'love_modulename',\n        }\n    },\n\n    byfullname = {}, -- Indexed by 'fullname' key\n    byid = {}, -- Indexed by 'id' key\n\n    everything = {}, -- Every table with a 'what' key\n\n    allfullnames = {}, -- modules, functions, methods, callbacks, types, enums\n    allfunctions = {}, -- functions, methods, callbacks\n    noncallbackfunctions = {}, -- functions, methods\n\n    functions = {},\n    methods = {},\n    callbacks = {},\n    variants = {},\n    arguments = {},\n    returns = {},\n    tables = {},\n    types = {},\n    enums = {},\n    constants = {},\n}\n\nenums = {\n    {\n        name = 'EnumName',\n        fullname = name,\n        description = 'Description.',\n        minidescription = 'Description.',\n\n        constants = {\n            {\n                name = 'constantname',\n                description = 'Description.',\n                minidescription = 'Description.',\n\n                what = 'constant'\n                id = 'EnumName1',\n                module = moduleTable,\n                enum = enumTable,\n            }\n        }\n\n        what = 'enum',\n        id = 'EnumName',\n        module = moduleTable,\n    }\n}\n\ntypes = {\n    {\n        name = 'TypeName',\n        fullname = name,\n        description = 'Description.',\n        minidescription = 'Description.',\n\n        functions = {},\n\n        parenttype = 'Parenttype' -- Optional\n        supertypes = {\n            SupertypeTable,\n        },\n        subtypes = {\n            SubtypeTable,\n        }\n        constructors = {\n            newTypeNameTable,\n        },\n\n        what = 'type',\n        id = 'TypeName',\n        module = moduleTable,\n    }\n}\n\nfunctions = {\n    {\n        name = 'functionName',\n        fullname = 'love.module.functionName',\n        prefix = 'love.module.',\n        description = 'Description.',\n        minidescription = 'Description.',\n\n        setter = setterTable, -- Optional\n        getter = getterTable, -- Optional\n        constructs = typeTable, -- Optional\n\n        variants = {\n            {\n                description = 'Description.', -- Optional\n\n                returns = {},\n                arguments = {},\n\n                what = 'variant',\n                id = 'love_module_functionName_rb_ast',\n                module = moduleTable,\n                function_ = functionTable,\n                type_ = typeTable,\n            }\n        }\n\n        what = 'function', -- or 'method' or 'callback'\n        id = 'love_module_functionName',\n        module = moduleTable,\n        type_ = typeTable,\n    }\n}\n\nreturns = { -- or arguments\n    {\n        type = 'type',\n        name = 'name',\n        default = 'default argument', -- If argument and not return\n        description = 'Description.',\n\n        table = { -- If type is 'table'\n            {\n                type = 'string',\n                name = 'name',\n                default = 'default argument', -- If argument and not return\n                description = 'Description.',\n\n                what = 'table',\n                id = 'love_module_functionName_rb_ast_a2_t1',\n                module = moduleTable,\n                type_ = typeTable,\n                function_ = functionTable,\n                variant = variantTable,\n                value = returnTable, -- or argumentTable\n            },\n        }\n\n        what = 'return', -- or 'argument'\n        id = 'love_module_functionName_rb_ast_r1',\n        module = moduleTable,\n        type_ = typeTable,\n        function_ = functionTable,\n        variant = variantTable,\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flove2d-community%2Flove-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flove2d-community%2Flove-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flove2d-community%2Flove-api/lists"}