GitHub: using pictures in README.md - image

I'm just wondering how AdEven added pictures to the README.md hosted on GitHub without having the pictures in the repo (you can find their GitHub-project here: https://github.com/adeven/adjust_ios_sdk).
The images are hosted under https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/.png and I want to know how to upload the pictures exactly like AdEven.
Thanks and Regards,
Sascha

if you look at the raw version of the file (https://raw.github.com/adeven/adjust_ios_sdk/master/README.md)
You can see how they do it.
![][drag] where you want the picture
[drag]: https://raw.github.com/adeven/adjust_sdk/master/Resources/ios/drag2.png
To define the file location.
Just replace the name and the location with your own. The raw url is direct access into the repo, so GH doesn't apply any formatting.

I solved that problem by going to github, in to my repo then creating and issue. In the text box inser the picture you would like to have in your readme.md. When you insert it in the text box it will give you the URL to your image. Simply copy the image url that it provided and insert it to your readme!

Related

Images aren't rendering on Git hub pages

I've tried everything. Pushed all image files to Git hub repo. They're all lowercase .jpg and everything appears fine locally in the editor. Still not showing up on Git hub pages. Any ideas?
Put the image in same repository, for example .\doc\image.jpg
In *.md file (I assume you talking about readme.md or some other doc in md format) put link to the image like this:
![My Image](https://github.com/<github-user>/<repository>/blob/master/doc/image.jpg?raw=true)
The easy way to get the url - just navigate to uploaded image in web interface, right-click on the image and copy URL :-)

listing existing images in ckeditor

I have a strange issue with CKeditor.
If I upload the images through the inbuild uploader function, the thumbnails are created and everything is working as intended.
However, If i use an existing image directory, CKeditor is not loading those images.. or if I upload manually through FTP, the images are not showing in CKeditor.
Is there a way to fix this issue? I have tried to google various solutions but currently I am unsure what I should search for.
will remote image location solve the issue or should I do any other configurations
By using a remote file location, u can map the shared files with remote location and it will solve the issue

Jekyll how to display an image in a post

I am trying to follow the Jekyll docs and am stuck on how to display an image
---
layout: post
title: "My first post!"
date: 2016-10-20 16:17:57 +0200
categories: jekyll update
regenerate: true
---
This is in the `_posts` directory.
It can be edited then rebuild the site to see the changes.
You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.
![name of the image][{{site.url}}/assets/P6740674.JPG]
I feel very silly asking this question as it is so basic but I can not find any answers to my question
Is it possibly a configuration error on my own system. I am using apache2, ruby gems, etc
Thanks in advance
If you want to use site.url, you have to add a url variable to your _config.yml file. More info in the Jekyll documentation.
But you might not have to use site.url at all. Any urls that start with a / slash will be relative to the top level of your domain. So you could do this:
![image tooltip here](/assets/image.jpg)
I could see an images directory created under assets by default. I've placed an image as follows.
assets/images/myimage.jpg and add following line in the post.
![My image Name](/assets/images/myimage.jpg)
Run bundle exec jekyll serve and see if there is any error. If you have mentioned mismatching file location, you will see error here.
The problem here is annoying simple - you have the wrong format for your image link.
It should be ![name](link). You have ![name][link]. Note the difference in the brackets. Everything else is fine.
I know this is an old question but I spent some 15min on this (jekyll/github blog is my secondary blog). So adding a suggestion here.
Briefly, as Kevin suggested, add the image file to a path under the root and give path to that file. Make sure that the file/directory is being tracked; not .gitignored.
My assets directory is inside _site directory. But, when I added a new image under that path git status did not show it as newly added- .gitignore ignored the _site directory. So Kevin's suggestion did not work as is. But as per his suggestion, I reasoned that as docs is my site's root, if I add an images directory there and add the image under that then something like
![image description](/images/my_image.png)
should work. And it worked this way. Not sure if this is the best way. Sharing here in case you have similar config.
In my case, I forgot to push the image to remote and therefore the image didn't show. Just to keep this in mind as well.

How can I reference an image in GitLab markdown in the current directory with the path starting with ./ dot slash?

I have stored a Markdown file and an image file in a Git repo as follows:
readme.markdown
images/
image.png
I reference the image from readme.markdown like this:
![](./images/image.png)
This renders as expected in ReText, but does not render when I push the repo to GitLab.
How can I reference the image from the Markdown file so that it renders when viewed in GitLab?
![](images/image.png) without the ./ works for me: https://gitlab.com/cirosantilli/test/blob/bffbcc928282ede14dcb42768f10a7ef21a665f1/markdown.md#image
I have opened a request for this to be allowed at: http://feedback.gitlab.com/forums/176466-general/suggestions/6746307-support-markdown-image-path-in-current-directory-s , but it entered into Internet void when GitLab dumped UserVoice.
Similar problem with Gitlab & Images in readme.md
I had the same problem with my Logo inside of a readme.md in my Extension and with Gitlab (running on a Ubuntu-Server).
Ubuntu Version: 16.04.2 LTS
Gitlab Version: 10.3.4 56dc722
My Solution
You can also use a snippet for image-usage in your readme.md by simply following these steps:
In the Overview of Gitlab (Logged in)
Go to the project where your want to use that image
in the topnavigation on the right click the + button
UNDER YOUR PROJECT click new snippet in the dropdown
In the new snippet form
Type a title
On the bottom right corner of the RTE-Field click Attach a file
Select your file and press Open
Click the checkbox Public
name the snippet (under the Checkboxes) [the field beside the 1 not the "header"]
Click Create Snippet
Troubleshooting
If you get the following error you forgot point 5:
The form contains the following error:
Content can't be blank
Now we have a working Imagelink
Now, if you edit the snippet again, you can copy the Image-Code looks like this:
![Alt-Text](/uploads/472fc65e1a1bc11b355cc03d6c339fd5/logo_.svg)
to your readme.md file.
If you like to use a link also, it has to look like that:
[![Alt-Text](/uploads/4013547485b9e88e98f1af3870116a29/logo_mit_claim.svg)](https://your-destination.com)
Hope it helps other ppls
Go to your project
Select issues
Create new issue
In the new issue description, click on attach file
Browse to your file and attach
A link in the form ""
will be generated on the description pane.
Copy the link and paste it in your readme.md file
Do not submit the issue unless you had intended to.
My images where in the .bin/img/ folder.
I had to use below format to get an image:
![alt text](<./bin/img/some_image.png>)
Mind the <>

Image not showing up in README.md on GitHub

I am trying to add an image to the README.md in my repository using markdown below:
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
But the image is not showing when I visit my repository.
Instead the link to the image is showing up. Clicking the link will open the image in new window.
I have also tried using relative path:
![ScreenShot](screenshot.jpg)
But this is giving page not found error.
What is the correct markdown to display image in README.md
Both README.md and image file are in same path/directory.
What is the correct way to display an image in github README.md?
Complete content of README.md file is as below:
Voice-controlled-MP3-Player
===========================
A MP3 player which accept voice command like PLAY, PAUSE, FORWARD, etc. Using C# and Microsoft Speech API.
![ScreenShot](https://github.com/i-saumitra/Voice-controlled-MP3-Player/blob/master/screenshot.jpg)
Updated content
Since January, 30th 2013, GitHub now supports relative links in markup documents.
This means that your code ![ScreenShot](screenshot.jpg) would now work flawlessly.
As pointed by #Brad, this may also ease a scenario where the images are different in two branches, but bear the same. In that case, switching from one branch to another, would dynamically switch the image in the rendered view, thus without requiring any change to the Readme content.
Blog post announcement
Help article
Previous answer when GitHub wasn't supporting relative links
You have to use the raw url format. In your case that would be https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg
This means that the correct markdown would be the following
![ScreenShot](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
Using this in a .mdfile on github will display the following picture ;-)
Update following your comment
where is this officialy documented that we have to use raw...i couldn't find it anywhere
This URL format is an undocumented feature of the GitHub site. This means that it could change later. If that ever happens, in order to "rediscover" the new format, click the Raw button when displaying a image. This will "open" the image in your browser. Copy the URL and VoilĂ !
Note: Although the repository is no longer on hosted on GitHub, I've updated the urls to reflect the new GitHub policy regarding user content
You really should use relative urls. That way they'll work better for private repos as well.
![ScreenShot](/screenshots/latest.png)
supposing your repo has latest.png inside the screenshots folder.
~B
For relative URL's to work with images, wrap it inside the paragraph tag.
I was facing the problem, especially when working with the single image.
Example:
<p>
<img src="relativePath/file.png" width="220" height="240" />
</p>
An extension to previous answers...
The image would not show for me when the line:
![ScreenShot](/image.png)
Was directly below a <h2></h2> line and I needed to add an empty line between them.
Hopefully this saves someone some time!
Thought I would update this for 2019 as I had trouble figuring this out for myself. I uploaded my images to a repo on GitHub, and then used the raw url of the image to import it into my markdown file. To get the raw url, click on the specific image link in GitHub so you are on the page for that specific image. To the top right of the photo, there are two buttons, "Download" and "History". If you click "Download", it takes you to that raw url with the picture taking up the full screen. Copy that url, and then paste it like this in your markdown file:
![image description or alt text](https://raw.githubusercontent.com/i-saumitra/Voice-controlled-MP3-Player/master/screenshot.jpg)
The button used to say "Raw" not "Download" so I hope this helps people find it.
This may not be relevant to previous answers. I have the same question as the OP - I was directed here and it didnt help me. I hope I can help add light to this question however - as it covers the possibilities of why images does not render in README.md file.
The issue I encountered is that the file name README.md file is written as readME
Not only its missing .md its also written differently.
Apparently, we should not rename the README.md file. It has to be the original name of that file in order to render the images or gifs you want to upload on github README.md page. Hope this helps someone, in rare of occasions, just like I did.
Check the file extensions because .png is not the same as .PNG.
Also use / instead of \ while specifying the file path.
Side note, when using reStructuredText use:
.. image:: /screenshots/latest.png?raw=true
I've tested with "Copy path" and in some locations this was working and in others it didn't.
In the cases it didn't, I copied the permalink and used it instead.
It doesn;t work when there are any html tags just above the line where image is being imported. You can try removing the html code or add some blank lines for the image to show on Readme.
This is just to help someone who is still having issues with image rendering in README.md:
If your image is named Some Name.png and you are trying to attach it in the README.md like ![Some Name](relative/path//res/Some Name.png), it won't work. The image has to be saved without any spaces in the file name.
So Some_Name.png with ![Some Name](relative/path//res/Some_Name.png) will work.
Make sure you check the case of the file extension. They have to match (either capital or lowercase). If you have my_image.PNG in your root directory and you add ![screenshot](/my_image.png) to your README file, it will not work. For some reason, Windows likes to capitalize file extensions sometimes. Unfortunately, Git does not recognize extension case so if you try to fix it by just changing the file name, you won't be able to commit the changes to the repo since Git will think everything is up to date. So you either have to update README.md or do some workaround like moving the file out of the directory, making a commit, then editing the file name then moving it back and doing another commit.
I had to add a <br> to return a line in order for the image to show on mine. This discovery was inspired by the comment in this thread to leave a blank line after a tag.

Resources