{"id":15008149,"url":"https://github.com/boolangery/py-lua-doc","last_synced_at":"2025-10-30T12:31:29.669Z","repository":{"id":55026011,"uuid":"139865622","full_name":"boolangery/py-lua-doc","owner":"boolangery","description":"A Lua documentation tool.","archived":false,"fork":false,"pushed_at":"2023-11-01T18:29:54.000Z","size":204,"stargazers_count":18,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T08:41:54.969Z","etag":null,"topics":["doc","generator","lua"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boolangery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-05T15:04:28.000Z","updated_at":"2024-01-30T10:07:57.000Z","dependencies_parsed_at":"2022-08-14T09:30:40.356Z","dependency_job_id":null,"html_url":"https://github.com/boolangery/py-lua-doc","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolangery%2Fpy-lua-doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boolangery","download_url":"https://codeload.github.com/boolangery/py-lua-doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968302,"owners_count":19560586,"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":["doc","generator","lua"],"created_at":"2024-09-24T19:15:22.574Z","updated_at":"2025-10-30T12:31:24.369Z","avatar_url":"https://github.com/boolangery.png","language":"Python","readme":"py-lua-doc\n----------\n[![travis](https://travis-ci.org/boolangery/py-lua-doc.svg?branch=master)](https://travis-ci.org/boolangery/py-lua-doc)\n[![Pypi](https://img.shields.io/pypi/v/luadoc.svg)](https://pypi.python.org/pypi/luadoc/)\n[![Versions](https://img.shields.io/pypi/pyversions/luadoc.svg)](https://pypi.python.org/pypi/luadoc/)\n    \n\nA Lua documentation extraction tool written in Python that support emmy-lua and \nldoc doc-comment.\n\nIt's both a development library and a command line tool.\n\nGiven a lua source file, it creates a documentation model.\n\nInstallation\n------------\n\nThe package can be installed through `pip`:\n\n```bash\n$ pip3 install luadoc\n```\n\nIt will install the shell command 'luadoc'.\n\nHow to generate documentation ?\n-------------------------------\n\nThis project is part of a [Sphinx](http://www.sphinx-doc.org/en/master/) documentation plugin: [sphinx-lua](https://github.com/boolangery/sphinx-lua)\n\n\n\n\nNode Structure\n--------------\n\nThe node structure is for now only described in `model.py`\n\n\nCommand Line\n------------\n\nThe command line tool just serialize the tree to Json.\n\nGiven:\n\n```lua\n--- @class foo.Base\nlocal Base = {}\n\n\n--- @class foo.List: foo.Base\nlocal List = {}\n\n--- Apply a function to all elements.\n--- Any extra arguments will be passed to the function.\n--- @param fun fun(a:any):any a function of at least one argument\n--- @vararg any @arbitrary extra arguments.\n--- @return foo.List a new list: {f(x) for x in self}\nfunction List:map(fun, ...) end\n\n--- Split a string using a delim.\n--- @param delim string the delim (default \" \")\n--- @overload fun()\nfunction List:split(delim) end\n\n\nreturn List\n```\n\n```bash\n$ luadoc source.lua\n```\n\nThe following output will be produced:\n\n```json\n{\n    \"filename\": \"test.lua\",\n    \"classes\": [\n        {\n            \"name\": \"foo.Base\",\n            \"name_in_source\": \"Base\",\n            \"methods\": [],\n            \"desc\": \"\",\n            \"usage\": \"\",\n            \"inherits_from\": [],\n            \"fields\": []\n        },\n        {\n            \"name\": \"foo.List\",\n            \"name_in_source\": \"List\",\n            \"methods\": [\n                {\n                    \"name\": \"map\",\n                    \"short_desc\": \"Apply a function to all elements.\",\n                    \"desc\": \"Any extra arguments will be passed to the function.\",\n                    \"params\": [\n                        {\n                            \"name\": \"fun\",\n                            \"desc\": \"a function of at least one argument\",\n                            \"type\": {\n                                \"id\": \"callable\",\n                                \"arg_types\": [\n                                    {\n                                        \"id\": \"any\"\n                                    }\n                                ],\n                                \"return_types\": [\n                                    {\n                                        \"id\": \"any\"\n                                    }\n                                ]\n                            },\n                            \"is_opt\": false,\n                            \"default_value\": \"\"\n                        },\n                        {\n                            \"name\": \"...\",\n                            \"desc\": \"arbitrary extra arguments.\",\n                            \"type\": {\n                                \"id\": \"any\"\n                            },\n                            \"is_opt\": false,\n                            \"default_value\": \"\"\n                        }\n                    ],\n                    \"returns\": [\n                        {\n                            \"desc\": \"a new list: {f(x) for x in self}\",\n                            \"type\": {\n                                \"id\": \"custom\",\n                                \"name\": \"foo.List\"\n                            }\n                        }\n                    ],\n                    \"usage\": \"\",\n                    \"is_virtual\": false,\n                    \"is_abstract\": false,\n                    \"is_deprecated\": false,\n                    \"is_static\": false,\n                    \"visibility\": \"public\"\n                },\n                {\n                    \"name\": \"split\",\n                    \"short_desc\": \"Split a string using a delim.\",\n                    \"desc\": \"\",\n                    \"params\": [\n                        {\n                            \"name\": \"delim\",\n                            \"desc\": \"the delim (default \\\" \\\")\",\n                            \"type\": {\n                                \"id\": \"string\"\n                            },\n                            \"is_opt\": false,\n                            \"default_value\": \"\"\n                        }\n                    ],\n                    \"returns\": [],\n                    \"usage\": \"\",\n                    \"is_virtual\": false,\n                    \"is_abstract\": false,\n                    \"is_deprecated\": false,\n                    \"is_static\": false,\n                    \"visibility\": \"public\"\n                },\n                {\n                    \"name\": \"split\",\n                    \"short_desc\": \"Split a string using a delim.\",\n                    \"desc\": \"\",\n                    \"params\": [],\n                    \"returns\": [],\n                    \"usage\": \"\",\n                    \"is_virtual\": false,\n                    \"is_abstract\": false,\n                    \"is_deprecated\": false,\n                    \"is_static\": false,\n                    \"visibility\": \"public\"\n                }\n            ],\n            \"desc\": \"\",\n            \"usage\": \"\",\n            \"inherits_from\": [\n                \"foo.Base\"\n            ],\n            \"fields\": []\n        }\n    ],\n    \"functions\": [],\n    \"data\": [],\n    \"name\": \"unknown\",\n    \"is_class_mod\": false,\n    \"short_desc\": \"\",\n    \"desc\": \"\",\n    \"usage\": \"\"\n}\n```\n\nMany other examples can be seen in `luadoc/tests/source`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolangery%2Fpy-lua-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboolangery%2Fpy-lua-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolangery%2Fpy-lua-doc/lists"}