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

Add support for the math directive #115

Closed
siebenkopf opened this issue Aug 1, 2018 · 8 comments · Fixed by #246
Closed

Add support for the math directive #115

siebenkopf opened this issue Aug 1, 2018 · 8 comments · Fixed by #246
Labels

Comments

@siebenkopf
Copy link

I am not sure if this is the right place to ask, but I haven't seen any valuable information that would solve my problem anywhere.

I have an issue with uploading a package on PyPI. Specifically, the .rst description of my project https://pypi.org/project/challenge.uccs/ does not render on the PyPI front page.

According to their recommendation: https://packaging.python.org/guides/making-a-pypi-friendly-readme/ I installed readme_renderer version 21.0 via pip. When I run the renderer on my local copy of the project, I get the message:

$ python setup.py check -r -s
running check
The project's long description is valid RST.

So, there is no error message here, I don't see any error message when uploading to PyPI.

Since all the required information should be online (just download the package that I pointed to), maybe you can help me in assessing why the PyPI page does not render.

Thanks for your help in advance.
Manuel

@di
Copy link
Member

di commented Aug 1, 2018

This is a bit mysterious to me, I agree that the description seems like valid rST.

On first glance this looks like pypi/warehouse#2718, but issuing a purge for the page does not result in a rendered description.

@theacodes Any ideas why this particular description might be failing?

@di di added the bug label Aug 1, 2018
@theacodes
Copy link
Member

I'm thinking the math directive might a culprit. I'm taking a look now.

@theacodes
Copy link
Member

Yep. It's the math directive. A warning is emitted, but I'm not sure why that's not getting to python setup.py check.

@theacodes
Copy link
Member

Okay, mystery solved. This package contains a docutils.conf file that has the following:

[html4css1 writer]
math-output: mathjax
             https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js

which squelches the error the Warehouse sees when trying to render this file:

line : Warning: No MathJax URL specified, using local fallback (see config.html)

So we either need to (1) support math or (2) ignore local docutils.conf.

@dstufft
Copy link
Member

dstufft commented Aug 1, 2018 via email

@siebenkopf
Copy link
Author

Actually, I have added the docutils.conf in order to suppress the warning (I don't remember where I read that I should do this). However, the docutils.conf is also part of the python package uploaded to PyPI (it is mentioned in the MANIFEST.in).

Apparently, PyPI does not use this file when rendering the documentation. I am not sure, though, how I would fix the mathjax issue otherwise. Do you have any idea?

@jonas-eschle
Copy link

Are there any updates on this issue? We also seem to have hit it. :math: directive in README.rst let's the rendering fail (as it seems) and gives the same warning as above.

@di di changed the title bin/python setup.py check -r -s passes on RST, but page does not render on PyPI Add support for the math directive Jun 6, 2019
@ankostis
Copy link

Why not file an issue at warehouse so as to comply with the setting in the docutils.conf file, if it is present at the root of some package?

ankostis added a commit to pygraphkit/graphtik that referenced this issue Mar 29, 2020
due to pypa/readme_renderer#115

fix(TC): replace check with code from twine check tool.
miketheman added a commit to miketheman/readme_renderer that referenced this issue Jul 10, 2022
The first step to allowing math directives to be rendered on PyPI is
to enable the directive's warning to pass.

`docutils` tells us to pass a path to the `math_output` setting.
Since we `clean` the output, we can pass anything we want, as control
of the CSS will be handed on PyPI.

Refs: https://docutils.sourceforge.io/docs/user/config.html#math-output

This does **not** solve for Markdown math.

Resolves pypa#115
Resolves pypa#172

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@di di closed this as completed in #246 Jul 19, 2022
di pushed a commit that referenced this issue Jul 19, 2022
The first step to allowing math directives to be rendered on PyPI is
to enable the directive's warning to pass.

`docutils` tells us to pass a path to the `math_output` setting.
Since we `clean` the output, we can pass anything we want, as control
of the CSS will be handed on PyPI.

Refs: https://docutils.sourceforge.io/docs/user/config.html#math-output

This does **not** solve for Markdown math.

Resolves #115
Resolves #172

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants