{"action":"created","issue":{"url":"https://api.github.com/repos/rm-code/love-api/issues/2","labels_url":"https://api.github.com/repos/rm-code/love-api/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/rm-code/love-api/issues/2/comments","events_url":"https://api.github.com/repos/rm-code/love-api/issues/2/events","html_url":"https://github.com/rm-code/love-api/issues/2","id":65908966,"number":2,"title":"How to handle function variant descriptions","user":{"login":"rm-code","id":11627131,"avatar_url":"https://avatars.githubusercontent.com/u/11627131?v=3","gravatar_id":"","url":"https://api.github.com/users/rm-code","html_url":"https://github.com/rm-code","followers_url":"https://api.github.com/users/rm-code/followers","following_url":"https://api.github.com/users/rm-code/following{/other_user}","gists_url":"https://api.github.com/users/rm-code/gists{/gist_id}","starred_url":"https://api.github.com/users/rm-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rm-code/subscriptions","organizations_url":"https://api.github.com/users/rm-code/orgs","repos_url":"https://api.github.com/users/rm-code/repos","events_url":"https://api.github.com/users/rm-code/events{/privacy}","received_events_url":"https://api.github.com/users/rm-code/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rm-code/love-api/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/rm-code/love-api/labels/input%20wanted","name":"input wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-02T11:43:06Z","updated_at":"2015-04-04T16:37:15Z","closed_at":null,"body":"Some functions have multiple variants like [love.graphics.push](https://love2d.org/wiki/love.graphics.push). These variants _sometimes_ have their descriptions on the wiki. The question is how to handle these in the documentation.\r\n\r\nMy suggestion would be this:\r\n```lua\r\n{\r\n    name = 'push',\r\n    description = 'Copies and pushes the current coordinate transformation to the transformation stack.\\n\\nThis function is always used to prepare for a corresponding pop operation later. It stores the current coordinate transformation state into the transformation stack and keeps it active. Later changes to the transformation can be undone by using the pop operation, which returns the coordinate transform to the state it was in before calling push.',\r\n    functions = {\r\n        {\r\n            description = 'Pushes the current transformation to the transformation stack.',\r\n        },\r\n        { \r\n            description = 'Pushes a specific type of state to the stack.',\r\n            arguments = {\r\n                {\r\n                    type = 'StackType',\r\n                    name = 'stack',\r\n                    description = 'The type of stack to push (e.g. just transformation state, or all love.graphics state).'\r\n                },\r\n            }\r\n        }\r\n    }\r\n},\r\n```"},"comment":{"url":"https://api.github.com/repos/rm-code/love-api/issues/comments/89611606","html_url":"https://github.com/rm-code/love-api/issues/2#issuecomment-89611606","issue_url":"https://api.github.com/repos/rm-code/love-api/issues/2","id":89611606,"user":{"login":"leafi","id":2166555,"avatar_url":"https://avatars.githubusercontent.com/u/2166555?v=3","gravatar_id":"","url":"https://api.github.com/users/leafi","html_url":"https://github.com/leafi","followers_url":"https://api.github.com/users/leafi/followers","following_url":"https://api.github.com/users/leafi/following{/other_user}","gists_url":"https://api.github.com/users/leafi/gists{/gist_id}","starred_url":"https://api.github.com/users/leafi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafi/subscriptions","organizations_url":"https://api.github.com/users/leafi/orgs","repos_url":"https://api.github.com/users/leafi/repos","events_url":"https://api.github.com/users/leafi/events{/privacy}","received_events_url":"https://api.github.com/users/leafi/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T16:37:15Z","updated_at":"2015-04-04T16:37:15Z","body":"Yeah, having 'variants' instead would be nice. Rewriting all the files probably _would_ be best done with a script rather than by hand.\r\n\r\n...With some difficulty, I think I've managed to write that script.\r\nIt works based on assumptions about indentation before 'functions' lines, erroring out if the lines don't match our expectations, and at the very end also loading love_api as Lua and verifying the results are correct that way.\r\n\r\nIt runs in-place and overwrites existing Lua files. (So you can't run it twice. Fun!)\r\n\r\nhttps://gist.github.com/leafi/9cac45df526be3625e8a\r\n\r\nIt's a bit hairy, so it's fair enough if you don't want to use it...\r\n\r\n\r\n"}}