Giter Site home page Giter Site logo

py-lua-doc's People

Contributors

boolangery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py-lua-doc's Issues

Support function documentation on table assignment

It would be really nice to be able to write documentation for functions that are assigned to tables.

Class function example:

--- @function Car:get_speed
--- A function to measure the speed of the car
--- @return number Speed of the car in kph
Car.get_speed = utils.measure_speed

Workaround:

--- A function to measure the speed of the car
--- @return number Speed of the car in kph
function Car:get_speed() end
Car.get_speed = utils.measure_speed

Static function example:

--- @function Car.static_helper
--- A static helper function related to Car
Car.static_helper = utils.static_helper

Workaround:

--- A static helper function related to Car
function Car.static_helper() end
Car.static_helper = utils.static_helper

Add a license

It can be kinda tricky to use/fork this without a license attached. It'd be appreciated if you could add one so I know I'm in the clear if I tweak this to format docs a little differently. :)

`[public|protected|private]` not optional in `@field`

Reading https://emmylua.github.io/annotations/field.html, [public|protected|private] should be optional in ---@field [public|protected|private] field_name FIELD_TYPE[|OTHER_TYPE] [@comment] because it's enclosed in [].

However I'm getting the error invalid @field tag: @field body string The contents of the request for:

---@class Request
---@field body string The contents of the request

and the error goes away if I insert a public right after @field.

Support `short_desc` and `desc` on explicit @function tags

Explicit function tags currently parse without a short_desc or desc.

For example:

--- @module our_module
local e = {}

--- Report a script error
--- <more info>
--- @function report_error
local report_error = function (...)
end

e = {
  report_error = report_error,
}

return e

turns into:

[
    {
        // ...
        "functions": [
            {
                "name": "report_error",
                "short_desc": "",
                "desc": "",
                "params": [],
                "returns": [],
                "usage": "",
                "is_virtual": false,
                "is_abstract": false,
                "is_deprecated": false,
                "is_static": false,
                "visibility": "public"
            },
        ],
        // ...
    }
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.