A month or 2 ago I wrote a markdown file for my github page and it contained png files.
Today I was looking ad the markdown file on github and all images were removed. If I click on one I get the message: The image "link to image" cannot be displayed because it contains errors.
This is the link as the git hub page gives me
https://raw.githubusercontent.com/bask185/State-Machine-Scripts/master/images/handleWheel.png
And this is how I try to display the file in the markdown file.
exclamation mark [handleWheel ] (https://raw.githubusercontent.com/bask185/State-Machine-Scripts/master/images/handleWheel.png)
It worked once so I did something right once. Did github changed or did I do something wrong?
Can I salvage my images?
It looks like the images were linked to a relative path in your repository. You earlier had an images/ directory with the images that were shown in the markdown file, but this was removed in this commit.
If you browse the repository at the previous commit, you can see the images. The image corresponding to the link in your question, for example, is here.
This thread discusses various ways to add images to Markdown files in GitHub.
Related
I try to include a GIF for my README.md in Github, since Github allows to use and render GIFs in .md files.
As far as I am concerned I often cannot find any image or video files on Repositories of well maintained Github Repositories, but they still can use their own files in their READMEs.
A few examples:
https://raw.githubusercontent.com/junegunn/i/master/fzf.png
https://raw.githubusercontent.com/vim/vim/master/runtime/vimlogo.gif
How can I achieve similar links, without tracking and pushing e.g. GIFs in my Repo on Github?
I tried out the following:
I open an issue in my Repo, drag and drop my .gif file into it, copied the content into my README.md.
This turns out successfully, but i receive an not readable link:
https://user-images.githubusercontent.com/21893471/47281234-9f9b23ff-21ff-88ad-98f1-5555d1239ba807.gif
(dummy link)
I followed this description. It also works, but then an extra branch is created and thus the GIFs will be downloaded as well when someone clones the Repository.
TL;DR; You can't.
Those "readable" links are links directly into content stored in that repository. For example, that Vim image lives in this directory in the code: https://github.com/vim/vim/tree/master/runtime, and will be downloaded by anyone who clones the repository.
The published page only pulls up the ReadMe file. When I check the actions, the flow shows that it is picking up the HTML file, but it's not pulling it through to run it on the published page.
I made this question to let people know how I fixed this issue. I found a few other threads about a similar issue. Most peoples' resolved itself and would display the HTML file. I had tried multiple commits to push a redeploy, but this had no effect. I had to move the HTML file (I also went ahead and moved the CSS and Java file too) one folder layer out, which fixed the issue. So my HTML file was no longer nested in a folder within the overall folder. It's directly in the main file, displaying directly in the repo, and deploying correctly. Hope this helps somebody.
I want to move an image in my GitHub repository to a new folder. I know to move a text file you can click the edit icon in the top right but there is no edit icon for pictures. How can I move the picture on GitHub in the browser?
Update: The OP changed the title after my answer. The original question said GitHub Desktop not GitHub Browser - https://stackoverflow.com/posts/52977306/revisions
GitHub Desktop tracks all changes to all files as you edit them directly in the file system.
Just move the files directly using Windows Explorer and commit your changes to the repository using GitHub Desktop after moving the file.
Step-by-step instructions here:
Committing and reviewing changes to your project
You might also be interested in reading the other topics in the documentation, to get up to speed:
https://help.github.com/desktop/guides/contributing-to-projects/
Images are binary data. Adding, removing, and even updating those images can cause unnecessary usage of your repository's space. This is because images, videos, and other binary data are larger than the text files where our code is written. For personal projects, one could use this site (or another) to upload all of your images: https://imgbb.com/. Then URLs of each image will be provided for use anywhere in an app without the need to store those images in an actual repo.
On GitHub, is there a simple way to reference an issue (eg: #1234) from within a markdown file such that it is displayed as a hyperlink?
I don't want to write out the full form each time, as in:
[#1234](//github.com/user/project/issues/1234)
In commit messages, issue numbers are automatically hyperlinked. Can this happen in wiki documents too?
(This is not a duplicate of this question which is simply asking about markdown hyperlink syntax.)
It doesn't happen in wiki documents.
You can use a relative url but it isn't that much of a shortcut. It also depends on where you are in the project.
For example in the Readme.md in the master branch of the project:
[#1](../../issues/1)
On the github wikis:
[#1](../issues/1)
Anywhere:
[#1](/user/project/issues/1)
(h/t to VertigoRay for suggesting this)
Github parses and displays a readme.txt or readme.md file at the root of the repository.
I would like to create a similar readme file for a particular folder. Is there a way to accomplish this?
One ugly hack I thought of was to name the file _readmeme.md causing it to appear as the first file in the folder, and making it easy for users to find and click it. - it doesn't work, _README appears last and not first.
GitHub already has this feature. Just put your README file in a subdirectory, and it will be displayed just like one in the root directory.
For example, see README.md for this subdirectory:
http://github.com/larsbrinkhoff/lbForth/tree/master/targets
One thing I just tried that works is use the .md extension on the README file, so README.md and github is smart enough to display it using markdown (way better than plain text).