-
Notifications
You must be signed in to change notification settings - Fork 861
feat(docusaurus-theme): redirect to GH using types definition #8543
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
feat(docusaurus-theme): redirect to GH using types definition #8543
Conversation
3ea00c7 to
32177e2
Compare
266c1dc to
f2c043a
Compare
|
@acstll you will notice that sometimes there's other JSDoc annotations that do not work ( Sometimes there are also Let me know what you think! Looking forward to your review 🙏🏻 If we could move bigger updates to separate tasks that'd be cool as well, so that I am able to wrap this up before EAH. |
2e6ebb7 to
255a107
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this thoroughly and it's a really nice improvement, LGTM 🟢
Some notes:
- I think it's OK to replace
@seewith plainSeewhen it's preceding a{@link …}(JSDoc docs give that impression) - as discussed offline, external links and other link-like items like
@see aria-labelledbycan be handled later on, and this PR can focus on internal{@link (\w+)}which works pretty good imho - probably most external links and similar come from extending types not-in-our-codebase (also discussed offline)
only for reference, these are examples of external and link-like items:
ref in https://eui.elastic.co/pr_8543/docs/components/display/badge/#EuiBadgeGroup
@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}
aria-label in many places
@see aria-labelledby.
language in https://eui.elastic.co/pr_8543/docs/components/display/code/#EuiCode
@see https://prismjs.com/#supported-languages for options
packages/docusaurus-theme/src/components/prop_table/prop_table.tsx
Outdated
Show resolved
Hide resolved
packages/eui/src/components/search_bar/filters/field_value_selection_filter.tsx
Outdated
Show resolved
Hide resolved
9561655 to
10535fb
Compare
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
acstll
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[bonus comment] while running the typedoc command, we get 415 warnings… I'm wondering how many of those are things that would be beneficial to address, and how many false positives or things we can safely ignore (speaking of which, I'm not familiar with typedoc) — do you think this is something we could address in this PR? later on?
|
@acstll thanks for reminding me about warnings. I think it's safe to proceed with what we already have but could be beneficial to look through the list. The majority of them are about not exporting an interface or unexpected JSDoc annotations. Potentially something that might not end up in the JSON output and not be linked in the description to GitHub BUT would have to be checked one by one. We can totally do that work on another ticket while already incorporating a lot of value to the docs site with this PR 😄 what do you think? Side note, these warnings can be silenced. |
I agree! 👍 |
Summary
On this PR, I:
typedoc@latestto use in the documentation (eui-docgen(react-docgen-typescript) doesn't provide data for types, interfaces, hooks; partially solves https://github.com/elastic/eui-private/issues/237),packages/eui,packages/docusaurus-theme/src/components/prop_table/prop_table.tsx#L119-L148and substitute with a Markdown link ([]()syntax) where the url redirects to the type definition in GitHub gotten from thetypedoc-generated JSON file.Screen.Recording.2025-04-03.at.16.37.26.mov
Closes #8464
QA
Either:
or
Pages
Display
Editors & Syntax
Forms
Layout
Navigation
Tabular content
Templates
Utilities