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

Emojis and images issues #41

Open
dmotte opened this issue Apr 18, 2021 · 5 comments
Open

Emojis and images issues #41

dmotte opened this issue Apr 18, 2021 · 5 comments

Comments

@dmotte
Copy link

dmotte commented Apr 18, 2021

Hi! First of all, thanks for creating this extremely useful action.

I use it in many of my projects. Just want to make two suggestions:

  • emojis are not rendered on Docker Hub. It would be nice to replace all emojis like :whale: with the equivalent UTF-8 🐳 before deploying the markdown file
  • images with relative paths are not displayed correctly on Docker Hub. It would be nice to prepend https://raw.githubusercontent.com/<user_name>/<repo_name>/<branch_name>/ to all relative images paths before deploying the markdown file

See my desktainer repo and the related Docker Hub page for an example of what i mean.

I know that these problems are not this action's fault but Docker Hub's, so feel free to close this issue if you don't wanna do these.

@peter-evans
Copy link
Owner

Hi @dmotte

Glad you have found the action useful. 👍

Thank you for the suggestions. I can see how these features would be convenient, but I wonder if it could get a bit messy and difficult to handle all the possible cases where there are markdown differences. My initial thought was that this kind of feature could be a separate action step in the workflow to do this conversion. I don't think I will try and implement anything at the moment, but I'll leave this issue open to gather input from other users that might have similar issues.

In the meantime, here are some suggestions for you:

  • Create a README-DOCKERHUB.md that is formatted using markdown that can be rendered by Docker Hub.
  • Change your existing README.md to fit the Docker Hub format. e.g. Use UTF-8 emojis instead of colon-separated.
  • Add a workflow step to do the conversion before calling this action. (If you get this working please share the step)

@mrtwnklr
Copy link
Contributor

mrtwnklr commented Feb 24, 2023

Hi @peter-evans

thank you for this action!

I worked on a simple solution for three use cases (markdown anchors in README.md, relative urls to image resources, relative urls to other file resources). Are there more you have in mind?

I'm wondering if you would accept a pull request that implements the following logic in Type Script?

mrtwnklr/apprise-it-for-me@c5e4b5c

@peter-evans
Copy link
Owner

I'm wondering if you would accept a pull request that implements the following logic in Type Script?

At a glance it looks good! Please do make a pull request for this logic. My only concern is whether we can make sure it doesn't clobber links that are actually fine. As long the regex is scoped tightly enough to target "broken" links then it looks good.

@mrtwnklr
Copy link
Contributor

mrtwnklr commented Feb 26, 2023

The patterns ignore all links that seems to have a trailing protocol. It should be robust.

(Edit: with one exception: local markdown anchors)

I'll take the time next week and provide a first draft for testing.

@peter-evans
Copy link
Owner

Thank you @mrtwnklr for working on this feature to convert relative URLs. It should complete the second point raised in this issue.

For the first point about emojis like :whale: not being rendered. I'll see if there is a good npm library to do a lookup based on the name, and check how feasible it would be to search and replace.

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

No branches or pull requests

3 participants