Skip to content

Markdown Images are not rendered in pypi #5246

Closed

Description

@kirankotari

Describe the bug
Images are not rendered in pypi from README.md file
Package link: https://pypi.org/project/shconfparser

Image Size:
sh_cdp_neighbour.png - 184 KB
sh_run.png - 855 KB

Expected behavior
Images need to be rendered, as shown in the following link
Github link: https://github.com/kirankotari/shconfparser

To Reproduce
Image from a link:
![show run to tree structure](https://github.com/kirankotari/shconfparser/blob/master/asserts/img/sh_run.png)

Testing using image from package path:
![show run to tree structure](/asserts/img/sh_run.png)

My Platform
Checked in Chrome 71 and IE 11

Additional context
The warehouse image link says Not Found

Activity

  1. ewdurbin commented on Jan 3, 2019

    @ewdurbin
    Member

    The issue appears to be that the URLs used for the links target a GitHub page, not an image directly.

    I loaded the README.md into Macdown on my computer locally and can reproduce.

    screen shot 2019-01-03 at 8 24 13 am

    If you navigate to https://github.com/kirankotari/shconfparser/blob/master/asserts/img/sh_run.png in a browser you'll see that a UI appears, not the image itself.

    GitHub seems to be handling this seamlessly.

    You could use the raw URL instead as a workaround, https://github.com/kirankotari/shconfparser/raw/master/asserts/img/sh_run.png

    PyPI does not support rendering from the package path itself, as it is not an image host.

    I'm not sure if there is a reasonable approach to automatically handling either case.

  2. kirankotari commented on Jan 4, 2019

    @kirankotari
    Author

    Thanks @ewdurbin

  3. Borda commented on Dec 7, 2020

    @Borda

    Hello, we have some problem with rendering GitHub status badges - https://pypi.org/project/pytorch-lightning/1.0.8/
    so we tried to download all badges locally and add then to the package distribution on the fly (when the package is created) but this approach does not work as readme cannot take local images from the package - https://stackoverflow.com/a/46875147/4521646
    so is there a way or suggestion on how to upload the images/badges to a public domain and later refer in the readme? Moreover, are these referred imaged downloaded by PyPI or what happens if the image changes over time or it is removed?

  4. di commented on Dec 7, 2020

    @di
    Member

    Hi @Borda - many users upload images to GitHub or another image hosting service (like imgur) or host the images on their own domain. PyPI will link directly to the image, so if the hosted image is changed or removed, it will change on PyPI as well.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions