ltabis / rhai-autodocs

Generate Markdown documentation from a `rhai::Engine` instance.
MIT License
3 stars 1 forks source link

Function order #2

Closed ltabis closed 1 year ago

ltabis commented 1 year ago

Some APIs need to have functions in a specific order. It would be great to be able to parameterize the crate to write function signatures in whatever order we want.

schungx commented 1 year ago

What about a sort-order field that holds a number?

That way, you can just use sort in JavaScript to sort the functions according to the order before display.

Or some form of meta-tag embedded into doc-comments?

ltabis commented 1 year ago

@schungx I've done it in #3, using pre-processing doc comments. I don't think this is the best solution to the problem, but it works fine and was simple to implement !

Closing this :)

schungx commented 1 year ago

Maybe I need to think of a standard MarkDown syntax for specifying custom attributes in comments?

ltabis commented 1 year ago

Maybe I need to think of a standard MarkDown syntax for specifying custom attributes in comments?

Yes maybe, I was simply thinking about adding an option to order functions by there order in the file to prevent adding something like that.