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

Fix #4137: doctest: doctest block is always highlighted as python con… #4143

Merged

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Oct 12, 2017

…sole (pycon)

Fix #4137

@tk0miya tk0miya added type:enhancement enhance or introduce a new feature extensions labels Oct 12, 2017
@tk0miya tk0miya added this to the 1.7 milestone Oct 12, 2017
@wojdyr
Copy link
Contributor

wojdyr commented Oct 12, 2017

Thanks for looking into it.

I think the condition will also catch testcode in addition to doctest, so perhaps the language would be better set to python than pycon? I don't know how exactly the pygments lexers work.

Another thing that comes to my mind is that perhaps in some cases one would prefer to use one of the other "python-related languages" supported by pygments:
http://pygments.org/docs/lexers/#lexers-for-python-and-related-languages

@peterjc
Copy link
Contributor

peterjc commented Oct 13, 2017

So would you put:

    if self.name in ('testoutput', 'testcode'):

Would it makes sense to use pycon by default only if the text contains any line starting >>> ?

@tk0miya tk0miya self-assigned this Jan 13, 2018
@tk0miya tk0miya force-pushed the 4137_doctest_force_highlight_pycon branch from 3dd58e6 to eebf9d0 Compare January 14, 2018 15:00
@tk0miya
Copy link
Member Author

tk0miya commented Jan 14, 2018

Now I arrange the conditions. And I will merge this after testing passed.
Please let me know if something wrong. I'll fix it again.
(Sorry for skipping reviewing. I'd like to merge this into 1.7b1 release)

@tk0miya tk0miya merged commit 2b9b6d6 into sphinx-doc:master Jan 14, 2018
@tk0miya tk0miya deleted the 4137_doctest_force_highlight_pycon branch January 14, 2018 15:12
@tk0miya
Copy link
Member Author

tk0miya commented Jan 14, 2018

Merged. Thank you for reviewing :-)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions type:enhancement enhance or introduce a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants