Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
blink1073 merged 3 commits intojupyterlab:masterfromkrassowski:completer
Apr 28, 2021

Conversation

@krassowski
Copy link
Member

@krassowskikrassowski commentedJan 22, 2021
edited
Loading

References

#8930 exposed theCompleter.IRenderer to the world so that extensions can now customize the completer rendering. TheIRenderer handles both the legacycreateItemNode and the newcreateCompletionItemNode, however the new documentation panel node creation is currently hard-coded in theCompleter widget_updateDocPanel preventing customization; the default rendering is very limited (apre element, no markdown support etc).

Code changes

  • creates newIRender.createDocumentationNode(item) method
  • extracts the default implementation from the completer widget

User-facing changes

JupyterLab-LSP users will see nicely rendered markdown documentation as in:

R-docs-with-prefetch

Backwards-incompatible changes

The extensions that implement customCompleter.IRenderer will need to addcreateDocumentationNode if they do not inherit from the defaultCompleter.Renderer. I am not aware of any extension doing so.@edzkite would this affect you?

joelostblom reacted with thumbs up emojijoelostblom reacted with hooray emoji
@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch onbinder, follow this link:Binder

@krassowski
Copy link
MemberAuthor

Two questions:

  • should the oldcreateItemNode and friends be deprecated starting since 3.1?
  • shouldcreateDocumentationNode be optional, or required?

@edzkite
Copy link
Contributor

@krassowski Thanks for checking in. I don't believe this would impact us.

@joelostblom
Copy link
Contributor

joelostblom commentedFeb 3, 2021
edited
Loading

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
Copy link
MemberAuthor

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.

joelostblom reacted with thumbs up emoji

@krassowski
Copy link
MemberAuthor

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.

joelostblom reacted with thumbs up emoji

Copy link
Contributor

@jasongroutjasongrout left a 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!

if(!this._renderer.createDocumentationNode){
return;
}
letnode=this._renderer.createDocumentationNode(activeItem);
Copy link
Contributor

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.

Copy link
MemberAuthor

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?

Copy link
Contributor

@blink1073blink1073 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@blink1073blink1073 added this to the3.1 milestoneApr 28, 2021
@blink1073blink1073 merged commit24b505f intojupyterlab:masterApr 28, 2021
cameron-toy pushed a commit to cameron-toy/jupyterlab that referenced this pull requestMay 28, 2021
* Move documentation panel rendering to renderer* Add test for documentation after renderer substitution* Address compatibility comment
@github-actionsgithub-actionsbot added the status:resolved-lockedClosed issues are locked after 30 days inactivity. Please open a new issue for related discussion. labelOct 26, 2021
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsOct 26, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@jasongroutjasongroutjasongrout left review comments

+1 more reviewer

@blink1073blink1073blink1073 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

enhancementpkg:completerstatus:resolved-lockedClosed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Projects

None yet

Milestone

3.1

Development

Successfully merging this pull request may close these issues.

5 participants

@krassowski@edzkite@joelostblom@jasongrout@blink1073

[8]ページ先頭

©2009-2025 Movatter.jp