TurtleP / luaprettydoc

Lua Documentation Parser
MIT License
1 stars 0 forks source link

[Feature Request]: Multiple/alternate definitions #7

Open AshleyJamesy opened 2 years ago

AshleyJamesy commented 2 years ago

Enhancement Details

Multiple/alternate definitions for functions

Solution

Add multiple definitions to markdown

Additional Context

Example: This function does the same thing, but can be called in different ways

--[[
    @definition self:copy(other)
    @brief copies matrix4 values from another matrix4
    @param other:`math.matrix4` the matrix to copy from
    @return `math.matrix4` this matrix copied from `other`
]]
--[[
    @definition matrix4.copy(a, b)
    @brief copies matrix4 values from another matrix4
    @param a:`math.matrix4` the matrix to copy into
    @param b:`math.matrix4` the matrix to copy from
    @return `math.matrix4` matrix `a` copied from `b`
]]
function class.copy(a, b)
    --does something
end
TurtleP commented 2 years ago

I'm not sure that the python library I use can handle this kind of thing. I believe it'll think the first block is a global comment, not a function's. I also don't know if this is something people typically even do in Lua code when it comes to libraries, for example.

As far as I know, people usually keep it as colon or dot index calls and not mix them.

TurtleP commented 2 years ago

So, I had some discussion with other people. It's definitely something that would have an advantage over using luadocs. However, like I said, I don't think that it would handle it all in two split comment buffers like that. I'll give it some thought, though. Something like --- to know there's an alt definition.