Skip to content
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

Add syntax highlighting to notebook cells for different languages. #4

Open
niconomaa opened this issue Apr 23, 2019 · 1 comment
Open
Labels

Comments

@niconomaa
Copy link
Contributor

Syntax highlighting is an important aspect of user experience. We want to introduce syntax highlighting in the notebook frontend for supported languages.

@jonashering
Copy link
Contributor

Syntax highlighting w/ the Jupyter project is handled on frontend side and uses the lexers provided w/ the pygment library (http://pygments.org/docs/lexers). Which lexer is used for syntax highlighting is set in the Jupyter Kernel configuration, and consequently must be set at installation time:

'language_info': {
  # Pygments lexer, for highlighting
  # Only needed if it differs from the 'name'
  'pygments_lexer': str,
  ...
}

(see https://jupyter-client.readthedocs.io/en/stable/messaging.html#msging-kernel-info)

Pygments provides a method called guess_lexer(code) which might be useful for our case. However, it might not be compatible with how the API works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants