Skip to content

Document all fields in docgen #20262

Open
@beef331

Description

@beef331

Summary

Presently docgen does not document inherited fields or show fields of a ref or ptr object.

This means dom.Document looks like:

image

Which is very unhelpful if you're looking at what it exposes.

Description

The docgen should emit all the fields of any ref, ptr or object of as such the above should look like:

type Document = ref DocumentObj
    activeElement*: Element
    documentElement*: Element
    alinkColor*: cstring
    bgColor*: cstring
    body*: Element
    charset*: cstring
    cookie*: cstring
    defaultCharset*: cstring
    fgColor*: cstring
    head*: Element
    lastModified*: cstring
    linkColor*: cstring
    referrer*: cstring
    title*: cstring
    URL*: cstring
    vlinkColor*: cstring
    anchors*: seq[AnchorElement]
    forms*: seq[FormElement]
    images*: seq[ImageElement]
    applets*: seq[Element]
    embeds*: seq[EmbedElement]
    links*: seq[LinkElement]
    fonts*: FontFaceSet

In the case of an inheritance tree like the following:

type
  A* = object of RootObj
    someField: int
    someOtherField: string
  B* = object of A
    myField: int
  C* = object of B
    myOtherField: string 

The docgen should generate something a long the lines of the following. Yes this will make the docs longer but will provide more documentation and make life easier for people reading docs.

type
  A* = object of RootObj
    someField: int
    someOtherField: string
  B* = object of A
    myField: int
    # Inherited from `A`:(This should be a clickable link if possible)
    someField: int
    someOtherField: string
  C* = object of B
    myOtherField: string
    # Inherited from `B`:(Same)
    myField: int
    someField: int
    someOtherField: string

Alternatives

No response

Standard Output Examples

No response

Backwards Compatibility

No response

Links

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to documentation content (not generation).Documentation GenerationRelated to documentation generation (but not content).Easy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions