-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
More LabIcon docs #8246
More LabIcon docs #8246
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
Thanks!
At the moment there seems to be two options:
|
Oh. I guess I wrote https://jupyterlab.readthedocs.io/en/stable/developer/extension_points.html#icons at some point and forgot about it |
In b921254 I came up with a way to share the same Problem is, now the API docs are a bit broken: the markdown link to Gotta think of something else |
f55777c
to
06694ea
Compare
Alright, I think that's a wrap for this PR. Here's the user facing changes (all to docs):
In terms of non-visible changes, I didn't want to have to keep manually syncing up two nearly identical LabIcon sections in the dev and API docs, so I came up with various ways to generate both from a single source. This turned out to be fairly tricky (one is markdown, the other is rst, they both needed different document titles, etc). I don't think I've yet found the perfect way of doing this, but what I currently have is good enough for this PR. Briefly, there's now a |
One possibly much simpler alternative would be to link to the API docs from the dev docs, or vice versa. I'll look into this and other possibilities while I work on making the API docs nicer overall over at #8239 |
7c8aa55
to
0dce89c
Compare
svgstr: fooSvgstr | ||
}); | ||
|
||
Sync icon color to JupyterLab theme |
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 am not too keen about having duplicate text in three places checked into VCS, because it seems likely we might update it in one place and forget the other two. Any ideas on how to make this have a single source of truth?
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.
Any ideas on how to make this have a single source of truth?
Nope, but I'll take suggestions :)
More seriously, I do have some notions about how to improve the docs:init
build here, but they're all waaay out of scope for what's supposed to be a PR updating the LabIcon docs. I am actively working on improving the API docs, and may be able to fold this issue into that work as well.
For now, we treat the sources in ui-components/docs
as the source of truth. Running jlpm docs:init
(while in ui-components
) will automatically propagate any changes to the README and the dev docs. If anyone does end up commiting changes directly to the wrong copy, I'll deal with manually resolving the conflicts
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've now added a warning comment to the top of the autogenerated files:
<!--
THIS FILE IS AUTOGENERATED, DO NOT EDIT
Instead, make changes to docs sources in `packages/ui-components/docs`,
then run "jlpm docs:init" to refresh the built docs
-->
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.
Running jlpm docs:init (while in ui-components) will automatically propagate any changes to the README and the dev docs. If anyone does end up commiting changes directly to the wrong copy, I'll deal with manually resolving the conflicts
For the README maybe we could just link to that file instead of copying? And maybe for the docs we could have it do that live generation when generating the docs instead of storing it in VCS?
What do you think?
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.
basically, I don't want to roll something project wide and complicated that I'm just going to remove in a future PR. Keeping the docs checked in in 3 places is dumb, but it's also simple and renders reliably
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.
Thank you so much max! This will be really helpful, both for maintaining the icon features and for people who want to use icons or add new ones.
Just had a few comments.
Co-Authored-By: Saul Shanabrook <s.shanabrook@gmail.com>
I want the improved LabIcon docs to be available to people ASAP, so I'm going to pull this in now and save the improvements to how those docs are built for a later PR |
@meeseeksdev please backport to 2.1.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
References
This PR adds a background section, and some sections on creating custom LabIcon to the LabIcon docs in the @jupyterlab/ui-components README.
Since these are narrative docs, and since the jlab API docs are somewhat invisible, these LabIcon docs should probably also go somewhere in the main jlab docs. Where should I put them?
Code changes
NA
User-facing changes
NA
Backwards-incompatible changes
NA