10000 Highlighting console block with python3-only syntax raises warning · Issue #5770 · sphinx-doc/sphinx · GitHub
[go: up one dir, main page]

Skip to content

Highlighting console block with python3-only syntax raises warning #5770

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

Closed
ngoldbaum opened this issue Dec 14, 2018 · 3 comments
Closed

Highlighting console block with python3-only syntax raises warning #5770

ngoldbaum opened this issue Dec 14, 2018 · 3 comments

Comments

@ngoldbaum
Copy link
Contributor
ngoldbaum commented Dec 14, 2018

Problem

  • Highlighting a block like this will raise a warning:
.. doctest::

   >>> a @ b

As far as I can tell there's no way to pass the option that pygments wants to use the python3 lexer for parsing the python code. See e.g. http://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer

Procedure to reproduce the problem

Build this sphinx project: https://github.com/ngoldbaum/sphinx-bug-project

Error logs / results

Warning, treated as error:
/Users/goldbaum/Documents/sphinx-bug/source/index.rst:23:Could not lex literal_block as "pycon". Highlighting skipped.

Expected results

Somehow be able to tell pygments to use the python3 lexer. Or just always use it? It's 2018...

Reproducible project / your project

Environment info

  • OS: <Unix/Linux/Mac/Win/other with version> Mac
  • Python version: 3.7
  • Sphinx version: 1.7.6
  • pygments: 2.20
@ngoldbaum
Copy link
Contributor Author

The discussion in https://bitbucket.org/birkenfeld/pygments-main/issues/1194/support-python-35s-matrix-multiplication might obviate the need to think about this.

@tk0miya
Copy link
Member
tk0miya commented Dec 15, 2018

I just post #5775. I believe it will resolve your problem.
Thanks,

@tk0miya tk0miya added this to the 2.0.0 milestone Dec 15, 2018
tk0miya added a commit that referenced this issue Dec 15, 2018
…anguage

Fix #5770: doctest: Follow highlight_language on highlighting doctest block
@tk0miya
Copy link
Member
tk0miya commented Dec 15, 2018

Fixed by #5775 .
Thank you for reporting!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants
0