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

Workaround for reST rendering #3391

Closed

Conversation

DimitriPapadopoulos
Copy link
Collaborator

GitHub does not render reST code::block:: properly, with most language specifiers. Remove language specifiers for now, until GitHub fix this issue.

Fixes #3390 (comment).

@DimitriPapadopoulos
Copy link
Collaborator Author

DimitriPapadopoulos commented Mar 26, 2024

@larsoner Could you please have a look at this PR:

  • works around broken reST rendering
  • fixes indentation problem in the documentation for inline ignores

@larsoner
Copy link
Member

works around broken reST rendering

Keep in mind we use it in our sdist / on PyPI via readme:

readme = { file = "README.rst", content-type = "text/x-rst" }

Renders into this page on release

https://pypi.org/project/codespell/

And it looks like pygments rendering is working okay on a per-language basis at least from spot checking a few of them e.g.:

image

One bugfix is that the pip lines should probably be console rather than sh I think?

In any case I think I'd prefer to keep the correct format specifiers and just wait for GH to fix their rendering at some point, and keep the nicer rendering on PyPI (and any editors that render .rst on the fly correctly, etc.).

@12rambau
Copy link
Contributor

Agreed with @larsoner I think it's a bug from Gh rendering

@DimitriPapadopoulos
Copy link
Collaborator Author

DimitriPapadopoulos commented Mar 26, 2024

Yes, that's a bug in GitHub rendering. As I wrote:

GitHub does not render reST code::block:: properly, with most language specifiers. Remove language specifiers for now, until GitHub fix this issue.

It occurs with all of sh, console, python, ini, yaml, but not console and toml.

I find decent rendering of the README in GitHub is more important than fancy syntax highlighting. Any way, you decide.

At least let's merge the second commit, which ensures better rendering through consistent indentation of reST code blocks.

@larsoner
Copy link
Member

Okay based on your edit how about a compromise where we change sh->console and keep toml?

@DimitriPapadopoulos
Copy link
Collaborator Author

DimitriPapadopoulos commented Mar 30, 2024

Let's keep it as is then. The real language type would be sh. I guess GitHub doesn't support console at all which is why it does not even try fancy rendering.

I have just kept the code-block:: indentation fix.

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

Successfully merging this pull request may close these issues.

3 participants