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

Top level section header ignored in text/reST package description, not in text/markdown #260

Open
di opened this issue Sep 21, 2022 · 1 comment

Comments

@di
Copy link
Member

di commented Sep 21, 2022

When using text/reST for the package description in the METADATA package dist-info file, the top level section header is omitted in the rendered page, however it is included when the description is in text/markdown format.

This can be easily verified running python -m readme_renderer README.rst vs python -m readme_renderer README.rst.

Is this intentional? Looking at the docutils configuration used in readme_renderer it looks so. However, why are markdown and reST threated differently?

Originally posted by @dnicolodi in pypi/warehouse#12204 (comment)

@miketheman
Copy link
Member

The basic answer is that the RST behavior is intentional, and the markdown behavior needs some work to make it on par with the RST behavior.

This was previously discussed in #149 (comment) and confirmed for the reasons discussed there.

The question remains on whether we should change the Markdown behavior to the same, by removing the first H1, or if we should leave the original content unchanged, and look to remove the behavior from RST.

On one hand, the convention of naming the first line of a README.* after the project is widely adopted, but it's not universal, and not required by any means.

On the other hand, removing the top title does help reduce the overall clutter seen in the UI - as previously discussed in pypi/warehouse#3451 (still undecided/resolved)

To modify the markdown render behavior to match RST, we would have to do something like:

  • update https://github.com/theacodes/cmarkgfm to have an option to strip out the first header found
  • strip out the header before we pass it to markdown.render()
  • something else I haven't thought of yet

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

2 participants