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

Ignore warnings when rendering rst #102

Open
ishirav opened this issue May 16, 2018 · 3 comments
Open

Ignore warnings when rendering rst #102

ishirav opened this issue May 16, 2018 · 3 comments

Comments

@ishirav
Copy link

ishirav commented May 16, 2018

What's the problem this feature will solve?
It is very easy to come across packages in Warehouse which have rst descriptions that are wrongfully rendered as plain text. I believe the reason for this is the strictness of the readme_renderer - any warnings emitted by the rst renderer cause failure.

Describe the solution you'd like
My very simple suggestion is to change the halt_level in rst.py from 2 to 3. This would result in ignoring warnings, and halting only when encountering more severe errors.

After trying this change on a few random examples of READMEs that currently don't get rendered, I'm convinced that this change does not cause any problems, and that it's perfectly safe to ignore warnings. The resulting HTML is way better, nicer and more readable than just displaying the README as plain-text.

The only possible downside is that some actual plain-text READMEs might get rendered as if they were rst. I don't think that would be a serious problem - rendering text to rst might add some formatting or change line wrapping, but probably won't mangle the text beyond recognition or make information disappear.

Note that when running python setup.py check -r -s to check a package, it would be beneficial to still show any warnings and not ignore them.

Additional context
Some random examples of packages with rst descriptions that are rendered as plain text (they are very easy to come across):

@theacodes
Copy link
Member

I am generally in favor of this, but definitely need @di to agree to it as well.

@dstufft
Copy link
Member

dstufft commented May 16, 2018

FWIW the reason it's strict now is just because that's been the behavior forever, so when I extracted this from PyPI, I just kept the same settings. That's not to say that it can't change of course! Just that basically the rationale is probably lost to the sands of time at this point, and I think it's perfectly fine to change it.

@di
Copy link
Sponsor Member

di commented May 16, 2018

The one thing I'm concerned with here is what this will look like for projects that have intentionally plaintext descriptions (but are from a time before Description-Content-Type).

Thus, this may depend on something like the suggestion at pypi/warehouse#4002.

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

No branches or pull requests

4 participants