Recently I joined GitHub. I hosted some projects there.
I need to include some images in my README File. I don't know how to do that.
I searched about this, but all I got was some links which tell me to "host images on web and specify the image path in README.md file".
Is there any way to do this without hosting the images on any third-party web hosting services?
In my case i use imgur and use the direct link this way.
LATEST
Now you can use:
-OR-
Follow these steps:
On GitHub, navigate to the main page of the repository.
Under your repository name, click Wiki.
Using the wiki sidebar, navigate to the page you want to change, and then click Edit.
On the wiki toolbar, click Image.
Refer Docs.
Then copy image source
Now add
![alt tag](http://url/to/img.png)
to your README.md fileDone!
Alternatively you can use some image hosting site like
imgur
and get it's url and add it in your README.md file or you can use some static file hosting too.Sample issue
I have solved this problem. You only need to refer to someone else's readme file.
At first,you should upload an image file to github code library ! Then direct reference to the address of the image file .
Just add an
<img>
tag to your README.md with relative src to your repository. If you're not using relative src, make sure the server supports CORS.It works because GitHub support inline-html
Observe here
In my case I wanted to show a print screen on
Github
but also onNPM
. Even though using the relative path was working withinGithub
, it wasn't working outside of it. Basically, even if I pushed my project toNPM
as well (which simply uses the samereadme.md
, the image was never showing.I tried a few ways, at the end this is what worked for me:
![Preview](https://raw.githubusercontent.com/username/project/master/image-path/image.png)
I now see my image correctly on
NPM
or anywhere else that I could publish my package.