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
[WIP] Switching syntax styles option #184
Conversation
@ccordoba12 @minrk I was doing this PR in order to find out if there was a way of changing the syntax_style without creating a new tab but that instead it got updated automatically in the same shell I've been working on. The initial intention was inspired by spyder's spyder-ide/spyder#3908. However I was unable to do so. Do any of you know if this is possible? Or do I have to restart it and initialize it with the new config (as in this PR)? |
jupyter_widget.syntax_style = new_style It might be that that doesn't work, though, if no-one's tested it before. |
@@ -730,6 +739,20 @@ def toggleFullScreen(self): | |||
def set_paging_active_frontend(self, paging): | |||
self.active_frontend._set_paging(paging) | |||
|
|||
def get_available_syntax_styles(self): |
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.
We can use a pygments function to find the available styles:
http://pygments.org/docs/styles/#getting-a-list-of-available-styles
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.
Oh this is way better! Thank you!
awesome! |
@takluyver I tried to do so before in another project (Spyder IDE) where I have the JupyterWidget instance: The interesting thing was that the style_sheet was updated automatically (without restarting it or making a new tab). But the syntax style did not, it only got updated after I restarted Spyder. This makes me think about your last line and that it maybe doesn't work. I tried to check both functions a bit but I couldn't figure out fast what could be wrong with the |
Since this creates a new kernel, shouldn't this option do in the "Kernel" menu? Is there no way to change the pygments coloring of the currently running kernel? That would be super. |
@wmvanvliet, we'll fix that because we need it for Spyder. |
Closing in favor of #217. |
Now there is an option to change to a different syntax style that opens a new tab in the console with the selected color scheme: