Skip to content

Libdoc: Include automatic argument conversion info #4160

Closed

Description

@pekkaklarck

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.

Activity

  1. added this to the v5.0 milestone on Dec 3, 2021
  2. pekkaklarck commented on Dec 3, 2021

    @pekkaklarck
    MemberAuthor

    Thinks to remember:

    • If a type has built-in and custom converter, only show the latter info.
    • Support also extended types, ABCs and type aliases.
    • Include information about accepted argument types. This info should be added also to other data types.
    • Formatting of the documentation should take Library's documentation formatting into account.
    • Keep backwards compatibility with old versions so that we can still process old spec files.
    • Update XML and JSON schemas.
    • Show data types below keywords in the left column in HTML.
  3. pekkaklarck commented on Feb 6, 2022

    @pekkaklarck
    MemberAuthor

    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

    "dataTypes" : {
        "customs": [...],
        "enums": [...],
        "typedDicts": [...]
    }
    

    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.

  4. pekkaklarck commented on Feb 9, 2022

    @pekkaklarck
    MemberAuthor

    Type documentation will be stored under typedocs, not types, both in XML and JSON spec files.

  5. pekkaklarck commented on Feb 9, 2022

    @pekkaklarck
    MemberAuthor

    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.

  6. pekkaklarck commented on Feb 9, 2022

    @pekkaklarck
    MemberAuthor

    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.

  7. pekkaklarck commented on Feb 10, 2022

    @pekkaklarck
    MemberAuthor

    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.

  8. pekkaklarck commented on Mar 23, 2022

    @pekkaklarck
    MemberAuthor

    Thanks @samipe for creating modal dialog where the type info is shown. Lot nicer than listing this info at the end of the documentation.

  9. added
    acknowledge
    on Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgebeta 1deprecationpriority: high

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions