Style elements in stylesheet do not get applied
See original GitHub issueI am trying to apply a custom style to Jupyter QtConsole, and am finding that I can influence the style using one of Pygments’ builtin styles(jupyter qtconsole --style=native
), and I can influence the Qt and prompts (.in-prompt, etc.) using a stylesheet, but I cannot influence the syntax style using a stylesheet. In particular, I have a file I obtained by doing pygmentize -S native -f html > native.css
, but then when I try jupyter qtconsole --stylesheet=native.css
, nothing happens to the style. It also appears to not work when specified in c.JupyterQtConsoleApp.stylesheet
in the config file (the Qt parts change, but the style parts don’t). When I put it into c.JupyterWidget.style_sheet
in the config, it actually makes qtconsole crash. I can’t tell from the documentation why this doesn’t work … the config notes near the latter seem to indicate that all should be just fine.
I am trying to use some custom styles I like, and I must do it by config or by command line - I have no control over the installation so I cannot put a new style into Pygments’ folder in site-packages.
The systems I actually work on are all offline, but it also appears not to work in the developer version I’m testing with from the most recent code, it says 4.5.0.dev0. Python 3.7.3, pyqt 5.9.2.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (3 by maintainers)
@dalthviz My use case is specifically to set syntax style from
RichJupyterWidget
in another application.The above works in so far as I register a pygments plugin in advance. It does not work if i try to set a pygments
Style
class forjupyter_widget.syntax_style
since it only accepts strings as seen here: https://github.com/jupyter/qtconsole/blob/b2fa483b06972403de81550b04318f5554a066ba/qtconsole/jupyter_widget.py#L90-L95There is no way to set it from
RichJupyterWidget
. That would be a nice feature and I assume it would also solve the issue @Jeitan is facing.@dalthviz Thanks for the explanation! I perused the PRs you mentioned, and now I can kind of see how things ended up. If I have some free time at some point I might try to see if I can get some sort of local style input working … maybe by looking at what Spyder does.