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
{{ message }}
Repository navigation
Libdoc: Include automatic argument conversion info #4160
Currently Libdoc includes information about Enums and TypedDicts in its outputs (#3607, #3783). We are adding support for custom argument converters (#4088) and part of that is including information about these custom types in Libdoc outputs as well. It would be convenient if outputs would also contain information about types we automatically convert into. We could basically include same information that's in the User Guide. Information should be added only to types that are actually used by the library.
Spec files currently have data types listed so that enumerations, typed dicts and newly added custom converters all have their own listings. In JSON specs it looks like
This separation isn't too convenient in the common case where you want to operate with all types. For example, Libdoc's own HTML output needs to combine these lists together and sort them separately to get them into alphabetical order. Instead of adding new info about standard converters as another listing, a decision was made to store all type information as a single types list.
Each type in the types list will have a type attribute that can be used to separate e.g. enums from others if needed. All types will also have common attributes name, doc and usages (added as part of #4218), and they may also get information about accepted argument types. In addition to these common attributes, enums will have members and typed dicts will have items.
To avoid backwards incompatibility problems, the old dataTypes information will be preserved both in JSON and XML spec files. It will be considered deprecated and newly added information about custom converters will be removed.
With the latest changes this issue is about to get ready. Things that still need to be done:
Decide should we include information about what argument types converters accept. We have that info for standard converters and custom converters can limit values as well. I'll look at this next to see how much work it would be.
Mention this in Libdoc documentation in the User Guide, possibly also in the Creating libraries section.
Proofread the docs.
The last point is something where others could help. Unfortunately it doesn't seem to be possible to attach HTML files to these issues so I needed to find a place where to host an example file or provide instructions how to generate one with all possible type docs.
I consider this issue done but it is likely that HTML output will still be changed before RF 5.0 final. Comments regarding to this functionality in general are still appreciated either here or in the #devel channel on our Slack.
Activity
pekkaklarck commentedon Dec 3, 2021
Thinks to remember:
Refactor getting custom converter info to Libdoc (#4088).
pekkaklarck commentedon Feb 6, 2022
Spec files currently have data types listed so that enumerations, typed dicts and newly added custom converters all have their own listings. In JSON specs it looks like
This separation isn't too convenient in the common case where you want to operate with all types. For example, Libdoc's own HTML output needs to combine these lists together and sort them separately to get them into alphabetical order. Instead of adding new info about standard converters as another listing, a decision was made to store all type information as a single
typeslist.Each type in the
typeslist will have atypeattribute that can be used to separate e.g. enums from others if needed. All types will also have common attributesname,docandusages(added as part of #4218), and they may also get information about accepted argument types. In addition to these common attributes, enums will havemembersand typed dicts will haveitems.To avoid backwards incompatibility problems, the old
dataTypesinformation will be preserved both in JSON and XML spec files. It will be considered deprecated and newly added information about custom converters will be removed.Libdoc: Store datatypes in new `types` element in spec files.
Libdoc: Don't write custom types to legacy dataTypes in specs.
pekkaklarck commentedon Feb 9, 2022
Type documentation will be stored under
typedocs, nottypes, both in XML and JSON spec files.Libdoc: Include automatic argument conversion info (#4160)
Libdoc: Store type docs in specs under `typedocs`, not `types`.
Libdoc: Add actual docs for standard conversions (#4160)
pekkaklarck commentedon Feb 9, 2022
With the latest changes this issue is about to get ready. Things that still need to be done:
The last point is something where others could help. Unfortunately it doesn't seem to be possible to attach HTML files to these issues so I needed to find a place where to host an example file or provide instructions how to generate one with all possible type docs.
pekkaklarck commentedon Feb 9, 2022
An example file is now available at http://uttermost-fairies.surge.sh/out.html. As mentioned above, proofreading the docs would be highly appreciated and other comments are obviously valuable as well.
Libdoc: Store accepted types to type documentation. #4160
UG: Document that auto converted types are shown in Libdoc outputs.
Libdoc: More compact way to list type usages.
pekkaklarck commentedon Feb 10, 2022
Above changes added information about accepted types to outputs, added documentation to the User Guide, and also changed the usage listing of types to more compact variant. An example with all the latest changes is available at https://ruthless-scent.surge.sh/out.html. As a more realistic example, SeleniumLibrary documentation generated with the latest changes is at https://ruthless-scent.surge.sh/SeleniumLibrary.html.
I consider this issue done but it is likely that HTML output will still be changed before RF 5.0 final. Comments regarding to this functionality in general are still appreciated either here or in the #devel channel on our Slack.
Libdoc: Nice styles for usage info. See #4160.
pekkaklarck commentedon Feb 10, 2022
Little style tweaks to the Usages list still in the above commit. New examples available:
Libdoc: Show type info in modal dialog instead of listing them at the…
pekkaklarck commentedon Mar 23, 2022
Thanks @samipe for creating modal dialog where the type info is shown. Lot nicer than listing this info at the end of the documentation.