You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed on Slack, I think it would be good if there was a way to "embed" the docs for the type of certain arguments visually into the docs for that method. As an example:
typedefFooOptions= {
/** * something about boo **/varboo:String;
/** * something about bar **/varbar:Int;
};
classFoo {
/** * description of doStuff * @paramoptions **/publicstaticfunctiondoStuff(?options:FooOptions):Void;
}
Currently dox would generate a page for FooOptions and a page for Foo. To find out what the options for doStuff are, the user needs to click through FooOptions to see the description of individual options. This is reasonable for types in general, but specifically for options-like struct types like this, it is impractical – the struct type is only used for that method and nothing else.
There are multiple cases of this in the upcoming asys APIs (to avoid having a huge amount of optional arguments). A non-struct type in the current standard library is the FileSeek enum, only used in FileInput.seek.
I would suggest adding a doc "meta" like @embedParam rather than @param (or in addition to @param) that would cause dox to generate the method description as normal, but put the full type doc of the relevant type in place of the usual argument description. The result would be a single page on which the user sees the description of the method as well as its specific options or enums, without causing issues to IDE completion.
The text was updated successfully, but these errors were encountered:
I disagree with that. It may be a useful thing to remind yourself of what a particular type is at a glance. But it is not good enough to read the entire doc for the type. Consider the options type in this (old) asys function: Process.spawn.
As discussed on Slack, I think it would be good if there was a way to "embed" the docs for the type of certain arguments visually into the docs for that method. As an example:
Currently dox would generate a page for
FooOptions
and a page forFoo
. To find out what the options fordoStuff
are, the user needs to click throughFooOptions
to see the description of individual options. This is reasonable for types in general, but specifically for options-like struct types like this, it is impractical – the struct type is only used for that method and nothing else.There are multiple cases of this in the upcoming asys APIs (to avoid having a huge amount of optional arguments). A non-struct type in the current standard library is the
FileSeek
enum, only used inFileInput.seek
.I would suggest adding a doc "meta" like
@embedParam
rather than@param
(or in addition to@param
) that would cause dox to generate the method description as normal, but put the full type doc of the relevant type in place of the usual argument description. The result would be a single page on which the user sees the description of the method as well as its specific options or enums, without causing issues to IDE completion.The text was updated successfully, but these errors were encountered: