Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.8k
Move documentation panel rendering to renderer#9663
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch onbinder, follow this link: |
krassowski commentedJan 22, 2021
Two questions:
|
edzkite commentedJan 22, 2021
@krassowski Thanks for checking in. I don't believe this would impact us. |
joelostblom commentedFeb 3, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Would (or could) the rich rendering approacch here also be used for the contextual help and the shift + Tab popup to render the restructured text in the docstrings? If so, this PR (or a follow up) could also close#4403 |
krassowski commentedFeb 4, 2021
This PR does not enable rich rendering, it merely allows extensions to do so. I believe that the solution to the rst rendering issues is to convert those to markdown at backend (this is kernel forshitf +tab and LSP server such as pyls or jedi-language-server for the LSP extension docpanel). This can be enabled by pandoc. The rational is that rst is a very Python-centric format and Jupyter as a project aims to be inclusive of many more languages and markdown seems like a reasonable common ground for documentation. Also, the current JupyterLab renderers are well capable of rendering any markdown including latex equations. |
krassowski commentedFeb 13, 2021
Gently nudging here to get feedback on whether you would consider merging this into 3.1, or if it needs to go into 4.x, as I will adjust my next release of jupyterlab-lsp to either include a (sub-optimal) workaround or not. |
jasongrout 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.
Other than one item about backwards compatibility, this looks good. Thanks!
packages/completer/src/widget.ts Outdated
| if(!this._renderer.createDocumentationNode){ | ||
| return; | ||
| } | ||
| letnode=this._renderer.createDocumentationNode(activeItem); |
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.
Can we include the previouspre implementation as a default implementation in case the renderer does not have this method, instead of ignoring and returning? I think this would make things compatible until 4.0.
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.
Would the changed implementation work ok?
blink1073 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.
Looks good, thanks!
* Move documentation panel rendering to renderer* Add test for documentation after renderer substitution* Address compatibility comment
Uh oh!
There was an error while loading.Please reload this page.
References
#8930 exposed the
Completer.IRendererto the world so that extensions can now customize the completer rendering. TheIRendererhandles both the legacycreateItemNodeand the newcreateCompletionItemNode, however the new documentation panel node creation is currently hard-coded in theCompleterwidget_updateDocPanelpreventing customization; the default rendering is very limited (apreelement, no markdown support etc).Code changes
IRender.createDocumentationNode(item)methodUser-facing changes
JupyterLab-LSP users will see nicely rendered markdown documentation as in:
Backwards-incompatible changes
The extensions that implement custom
Completer.IRendererwill need to addcreateDocumentationNodeif they do not inherit from the defaultCompleter.Renderer. I am not aware of any extension doing so.@edzkite would this affect you?