Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix syntax highlighting in README #12

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
nicoddemus wants to merge 1 commit into python-trio:master from nicoddemus:patch-2

Conversation

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Feb 3, 2018

For some reason GH does not recognize .. code-block: python3, but .. code-block: python works even for Python 3 syntax.

For some reason GH does not recognize `.. code-block: python3`, but `.. code-block: python` works even for Python 3 syntax.
Copy link

codecov bot commented Feb 3, 2018
edited
Loading

Codecov Report

Merging #12 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@
## master #12 +/- ##
=====================================
 Coverage 100% 100% 
=====================================
 Files 7 7 
 Lines 776 776 
 Branches 59 59 
=====================================
 Hits 776 776

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd2868a...bb7929f. Read the comment docs.

Copy link
Member

njsmith commented Feb 3, 2018
edited
Loading

Ugh. You're not wrong, but I bet this will break syntax highlighting on pypi, because pygments definitely treats python and python3 differently. Probably we should at least file bugs on GitHub and pygments asking them to fix their things.

Copy link
Member

njsmith commented Feb 6, 2018

I emailed support@github.com, and filed https://bitbucket.org/birkenfeld/pygments-main/issues/1415

I guess I'll give it a few days to see if either of them seems to be moving :-)

Copy link
Member Author

Thanks, sorry I forgot to get back at this myself. 👍

njsmith added a commit to njsmith/linguist that referenced this pull request Feb 8, 2018
Pygments has separate highlighters for "python" (meaning python 2) and "python3" (meaning python 3). As a result, there are lots of files out there (especially ReSTructured text) that contain code blocks whose language is explicitly given as "python3" or "py3". Currently these are unrecognized by linguist. Instead, we should use our python highlighter for them (which works for both python 2 and python 3).
References:
 http://pygments.org/docs/lexers/#pygments.lexers.python.Python3Lexer
 github/markup#1019
 python-trio/async_generator#12 
lildude pushed a commit to github-linguist/linguist that referenced this pull request Feb 8, 2018
Pygments has separate highlighters for "python" (meaning python 2) and "python3" (meaning python 3). As a result, there are lots of files out there (especially ReSTructured text) that contain code blocks whose language is explicitly given as "python3" or "py3". Currently these are unrecognized by linguist. Instead, we should use our python highlighter for them (which works for both python 2 and python 3).
References:
 http://pygments.org/docs/lexers/#pygments.lexers.python.Python3Lexer
 github/markup#1019
 python-trio/async_generator#12 
Copy link
Member

njsmith commented Feb 8, 2018

Github just added python3 as an alias for python in the library they use for syntax highlighting: github-linguist/linguist#4026

I'm not sure how long this will take to flow from "committed to the open source library" to "deployed on the production site" – possibly a few weeks.

Copy link
Member

njsmith commented Feb 8, 2018

But in any case I guess I'll close this, since the current solution works with pypi/sphinx and the github rendering will fix itself eventually, and in the mean time it's not too terrible. Thanks for bringing this up though :-)

Copy link
Member Author

Sure thing, thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /