Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#320 Define types and interfaces in docs #347

Merged
merged 13 commits into from
Mar 1, 2024

Conversation

lukasmatta
Copy link
Collaborator

@lukasmatta lukasmatta commented Feb 29, 2024

Added support for Types and Interfaces. One can navigate to type/interface by clicking on it, it navigates to the proper page section and highlights the Type/Interface for a moment. Note that it works only for simple types, MyType or MyType[]. To support this, each page's route is now split into /example and /api.

To be able to retrieve the location of the Type/Interface in a constant time, I introduced types_map.json file that is generated together with other .json files. The file serves as a key-value mapping in which Type/Interface name is a key and its location is a value.

Future work (issues I'm aware of but might be a bit time-consuming to implement):

  • generate docs for classes (they are used as a type, e.g. CpsDialogConfig)
  • using custom Type in method params or method return types doesn’t work for some reason (might be a typedoc issue) as using Interface works
  • type typeof iconNames[number] is not handled properly
  • make links work not only for MyType or MyType[] but also for more complicated types, e.g. in type Record<string, MyType>, or in generic MyType<any>, we want to make MyType clickable if it is defined somewhere in the docs. Ideally, this should be parsed AOT to not affect runtime performance.

@lukasmatta lukasmatta added enhancement New feature or request composition labels Feb 29, 2024
@lukasmatta lukasmatta self-assigned this Feb 29, 2024
@lukasmatta lukasmatta linked an issue Feb 29, 2024 that may be closed by this pull request
Copy link
Collaborator

@fateeand fateeand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, can you please create a ticket for the second part (as subtask of #74)
Let's also include there the issue regarding removal of API for internal components and support of API generation for directives (table, tree table).

@lukasmatta lukasmatta merged commit a07066a into master Mar 1, 2024
1 check passed
@lukasmatta lukasmatta deleted the 320-define-types-and-configs-in-docs branch March 1, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composition enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define types and configs in docs
2 participants