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

Error: Unknown interpreted text role "kbd". #148

Closed
ghost opened this issue Jan 27, 2019 · 4 comments
Closed

Error: Unknown interpreted text role "kbd". #148

ghost opened this issue Jan 27, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 27, 2019

Describe the bug

:kbd: in rst file is not recognized by pypi

Expected behavior

:kbd: in rst file should be recognized by pypi
To Reproduce

  • Set long_description in setup.py to a reStructuredText document containing :kbd:`Hello World`
  • python setup.py sdist
  • twine check dist/*

Additional context
":kbd:" in rst files is supported by Gitlab, Github, readthedocs, etc. However I've noticed that restview does not support it.

@di di transferred this issue from pypi/warehouse Jan 28, 2019
@McSinyx
Copy link

McSinyx commented Sep 5, 2020

I stumbled upon this when flit refuses to build when README.rst uses the kbd role. I took a deeper look and it seems that the proposal for this over docutils (which readme_renderer uses to render, ehm, READMEs) has yet to be accepted.

I suppose we can either use Sphinx as the reST backend for readme_renderer or to document about the lack of support the kbd role on PyPI. Personally I'm fine without these solutions though.

@miketheman
Copy link
Member

Looks like docutils added kbd in 0.17 https://docutils.sourceforge.io/HISTORY.html#release-0-17-2021-04-03

The support appears to be part of the HTML5 writer, so it’s worth testing the behavior today or whether this relies on updating our writer to use html5 as well. #249

@miketheman
Copy link
Member

Looks like I was incorrect in my assertion about html5 - it's already supported today, with a little extra effort.

The current readme_renderer will support the kbd role if you declare a custom role in your rst, per the current docutils behavior.
Example:

My Package
==========

.. role:: kbd

Type :kbd:`Ctrl+C` to quit

will output this HTML:

<p>Type <span class="kbd">Ctrl+C</span> to quit.</p>

And the current Warehouse CSS should pick that up and render as code.

TL,DR: It looks like all you'd have to do is add .. role:: kbd in your RST for this to work.

@miketheman
Copy link
Member

Closing, as there's no action for us to take here right now.

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

3 participants