Is it possible to place a screenshot in README file in a GitHub repository? What's the syntax?
Github – How to add screenshot to READMEs in github repository
githubmarkdown
Related Topic
- Git – How to determine the URL that a local Git repository was originally cloned from
- Git push requires username and password
- Git – How to update or sync a forked repository on GitHub
- GitHub relative link in Markdown file
- Github – How to add images to README.md on GitHub
- Git – Create a tag in a GitHub repository
- GitHub satanically messing with Markdown – changes 666 to DCLXVI
Best Answer
If you use Markdown (README.md):
Provided that you have the image in your repo, you can use a relative URL:
If you need to embed an image that's hosted elsewhere, you can use a full URL
GitHub recommend that you use relative links with the
?raw=true
parameter to ensure forked repos point correctly.The
raw=true
parameter is there in order to ensure the image you link to, will be rendered as is. That means that only the image will be linked to, not the whole GitHub interface for that respective file. See this comment for more details.Check out an example: https://raw.github.com/altercation/solarized/master/README.md
If you use SVGs then you'll need to set the sanitize attribute to
true
as well:?raw=true&sanitize=true
. (Thanks @EliSherer)Also, the documentation on relative links in README files: https://help.github.com/articles/relative-links-in-readmes
And of course the markdown docs: http://daringfireball.net/projects/markdown/syntax
Additionally, if you create a new branch
screenshots
to store the images you can avoid them being in themaster
working treeYou can then embed them using: