Embed Google drawing in a Github wiki - github

Is there a way to embed a public Google drawing in a GitHub wiki. I would prefer not save embed a png file but instead have a link to a living dokument.

I published the Google drawing: File -> Publish to Web -> Link ... and then used the link as the image url, ie:
![resources](https://docs.google.com/drawings/d/1zJ4.../pub?w=691&h=431)
...and it seems to work ok. Changes to the drawing are updated in the Github wiki page when the page is refreshed.

Replace edit at the end of the drawing URL with export/png and use it as the path to your image.
For example, if the drawing URL is https://docs.google.com/a/google.com/drawings/d/12345/edit, use this HTML image syntax:
<img src="https://docs.google.com/drawings/d/12345/export/png"
alt="image alt text"/>
You can do the same thing in Markdown:
![drawing](https://docs.google.com/drawings/d/12345/export/png)
source

GitHub wiki works on markdown format. It doesn't support embedding of google drawings.
The best way to embed the drawing is inserting a png image with markdown and pointing it to a link.
[![Image-alt](image-url)](drawing-url)

Related

Embed a gif in VSTS Wiki

I know we are currently still in preview for VSTS wiki but I am just wondering if embedding/uploading a gif is supported. I'm looking to give our docs a little bit of extra documentation beyond just the standard image and definition.
Yes, gif is supported for VSTS Wiki page.
If the gif file located locally, you just need to drag the .gif file in editor window. And the format will convert similar as below:
![giphy.gif](.attachments/giphy-84d10aa7-b43b-4f1c-b0c0-dd38db35fb4f.gif)
If the gif files located in network, you can use the formate:
![Text](URL for the gif)
More details, you can refer the markdown syntax for images.

Unable to embed a gif on imgur to a README.md on github

I want to show a large gif on README.md. Firstly, I uploaded it to imgur. And then, I added the url to README.md # <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">. But it cannot be loaded, it was compiled to:
<a href="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" target="_blank">
<img alt="YAP" src="https://camo.githubusercontent.com/b4f1167e599ce7936bb83aad5d007ca8f04345ac/687474703a2f2f692e696d6775722e636f6d2f644e5973776d492e676966" data-canonical-src="http://i.imgur.com/dNYswmI.gif" style="max-width:100%;"></a>
This is my README.
###Description
A open source player.
###Screenshot
# <img alt="YAP" src="http://i.imgur.com/dNYswmI.gif">
The gif you shared is 19MB in size.
GitHub routes all content through https://camo.githubusercontent.com/ even for external source now. Sharing a file that is bigger than the size limit (10MB) will get you a "Content length exceeded" error.
I tried sharing it on Google Drive, Dropbox, Droplr, my own server all ran into this issue unless the file size is below 5MB. It also doesn't matter if your syntax is in html or markdown.
<img src="https://static01.bbi.io/2Wt9Tk.gif"/>
!(image)[https://static01.bbi.io/2Wt9Tk.gif]
Your solution is to resize your gif. You can do it with service like this one: https://ezgif.com/resize .
GitHub does support Imgur embeds. Make sure to provide the image extension, which isn't on Imgurs default share hyperlink.
BAD
![Imgur Image](http://i.imgur.com/zTONrOD)
GOOD
![Imgur Image](http://i.imgur.com/zTONrOD.jpg)
Imgur also provides this preformatted link under the MarkDown links menu, see image below.
See also an example readme.md with Imgur image.
the way it worked for me was with the tag like #williamli said
<img src="https://static01.bbi.io/2Wt9Tk.gif"/>
You can still have a gif in readme.md that's above 10MB if you include the gif itself in your repository.
This is because images from the repository itself are not routed through
https://camo.githubusercontent.com/.
You could upload the gif to a misc folder and embed it like so:
<img src='./misc/your_file.gif'>
I believe the only way to link images from imgur would be something like this:
![An open source player](http://i.imgur.com/dNYswmI.gif)
However (in my experience) GitHub does not support imgur, I do not know if there are any other supported image share service.
If you can't find a supported service just do something like this as a last resort to just leave a link to the image:
###Description
A open source player.
### Screenshot
#[Screenshot](http://i.imgur.com/dNYswmI.gif)
I've run into this issue as well. Github will not allow you to upload anything over 10Mb. However, they offer an optional large file storage service specifically for audio/video/etc. This is what you want:
lfs-github

Can I use markdown to link to images on github pages?

I managed github to run my index.md through Jeckyl and display it under github.io by following https://help.github.com/articles/creating-project-pages-manually/. However, my images links of this form:
![Sicherung vorbereiten](img/export.png?raw=true)
don't show as they did in README.md
Can I use images together with github.io when run from markdown files?
Add a / in front of your img folder, like this:
![Sicherung vorbereiten](/img/export.png)
I just tried it on a test github pages page and it worked for me.
Source: official Jekyll documentation example: https://jekyllrb.com/docs/posts/#including-images-and-resources.
Including images and resources
At some point, you’ll want to include images, downloads, or other digital assets along with your text content. One common solution is to create a folder in the root of the project directory called something like assets, into which any images, files or other resources are placed. Then, from within any post, they can be linked to using the site’s root as the path for the asset to include. The best way to do this depends on the way your site’s (sub)domain and path are configured, but here are some simple examples in Markdown:
Including an image asset in a post:
... which is shown in the screenshot below:
![My helpful screenshot](/assets/screenshot.jpg)
Linking to a PDF for readers to download:
... you can [get the PDF](/assets/mydoc.pdf) directly.
Related
For additional image manipulation instructions, such as align left, align center, align right, image resizing, text wrapping, etc., see my other answer here: GitHub README.md center image
if you are accessing the picture by using the Github link, don't forget to add ?raw=true at the end of URL.
e.g. https://github.com/repo_name/img/picture_name.png?raw=true
Otherwise, the picture won't show on your webpage.

How to insert a picture in my git page?

I have just built a git user page and I want to add a picture in my article. Then I use
![repo name](https://github.com/zhangyangyu/zhangyangyu.github.io/raw/master/images/how-to-build-a-user-page-on-github/p1.png)
I find this on the Web and if I put the path in browser I can see my picture. But in my article, it just appear as the text. Why? If it helps the content of my config file is:
markdown: rdiscount
pygments: true
You are using Textile for your files, but Markdown syntax for the images.
To fix, use Markdown files, for example
2013-04-12-how-to-build-a-user-page-on-github.md
ref

How to add screenshot to READMEs in github repository?

Is it possible to place a screenshot in README file in a GitHub repository? What's the syntax?
If you use Markdown (README.md):
Provided that you have the image in your repo, you can use a relative URL:
![Alt text](/relative/path/to/img.jpg?raw=true "Optional Title")
If you need to embed an image that's hosted elsewhere, you can use a full URL
![Alt text](http://full/path/to/img.jpg "Optional title")
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 the master working tree
You can then embed them using:
![Alt text](/../<branch name>/path/to/image.png?raw=true "Optional Title")
Even though there is already an accepted answer I would like to add another way to upload images to readme on GitHub.
You need to create issue in your repo
Drag and drop in the comment area your image
After link for the image is generated insert it to your readme
More details you can find here
I found that the path to the image in my repo did not suffice, I had to link to the image on the raw.github.com subdomain.
URL format https://raw.github.com/{USERNAME}/{REPOSITORY}/{BRANCH}/{PATH}
Markdown example ![Settings Window](https://raw.github.com/ryanmaxwell/iArrived/master/Screenshots/Settings.png)
JUNE 3, 2020 : WORKING ANSWER-
Upload your image to postimage.org
Copy Github-Markdown-Url after uploading Image
Insert in your ReadMe
One line below should be what you looking for
if your file is in repository
![ScreenShot](https://raw.github.com/{username}/{repository}/{branch}/{path})
if your file is in other external url
![ScreenShot](https://{url})
The markdown syntax for displaying images is indeed:
![image](https://{url})
BUT: How to provide the url ?
You probably do not want to clutter your repo with screenshots, they have nothing to do with code
you might not want either to deal with the hassle of making your image available on the web... (upload it to a server... ).
So... you can use this awesome trick to make github host your image file. TDLR:
create an issue on the issue list of your repo
drag and drop your screenshot on this issue
copy the markdown code that github has just created for you to display your image
paste it on your readme (or wherever you want)
http://solutionoptimist.com/2013/12/28/awesome-github-tricks/
Much simpler than adding URL
Just upload an image to the same repository,
like:
![Screenshot](screenshot.png)
add this to README
<div align="center">
<img src="/screenshots/screen1.jpg" width="400px"</img>
</div>
From March 2021, this is now supported:
Attaching files to markdown files
You can now attach files, including images, to markdown files while you're editing them in the web.
This works just like file attachments in issues and pull requests and supports the same file types.
Just drag and drag, click and select, or paste.
Note: If you add an image to a markdown file, anyone can view the anonymized image URL without authentication, even if the markdown file is in a private repository.
To keep images private, serve them from a private network or server that requires authentication.
For more information on anonymized URLs see "About anonymized image URLs".
Markdown: ![Screenshot](http://url/to/img.png)
Create an issue regarding adding images
Add the image by drag and drop or by file chooser
Then copy image source
Now add ![Screenshot](http://url/to/img.png) to your README.md file
Done!
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
Method 1->Markdown way
![Alt Text](https://raw.github.com/{USERNAME}/{REPOSITORY}/{BRANCH}/{PATH})
Method 2->HTML way
<img src="https://link(format same as above)" width="100" height="100"/>
or
<img src="https://link" style=" width:100px ; height:100px " />
Note-> If you don't want to style your image i.e resize remove the style part
For me, the relative path worked out very well.
How I did this:
In my current md file where I wanted to use a picture from another directory, I used a relative path like this - consider following points.
md file loc: base dir -> _post -> current_file.md
& picture file loc which I wanted to use: base dir -> _asset -> picture_to_use.jpeg
What the statement I used was on current_file.md file:
![your-pic-caption-name](../_asset/picture_to_use.jpeg)
Note - before this, I was using direct _asset but Ideally, it so starts from ../_asset/and-so-no
reference - https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-readmes
Add ![ScreenShot](screenshot.png) in the readme markdown as mentioned by many above. Replace screenshot.png with the name of the image you uploaded in your repository.
But here is a newbie tip when you upload the image (as I made this mistake myself):
ensure that your image name does not contain spaces. My original image was saved as "Screenshot day month year id.png". If you don't change the name to something like contentofimage.png, it won't appear as an image in your readme file.
I googled a few similar questions and did not see any answers with my problem and its quite simple/easy solution.
Google Cloud Storage - a slightly different approach to images in READMEs
Here goes: like the OP, I wanted an image in my Github README, and, knowing the Markdown syntax for doing so, typed it in:
![My Image](https://storage.cloud.google.com/${MY_BUCKET}/${MY_IMAGE}
You need to complete the actual substitutions above (e.g. MY_IMAGE=image.jpg) for this to work.
But, wait...failure--there's no actual rendered photo! And the link is exactly as given by Google Storage!
Github camo - Anonymous Images
Github hosts your images anonymously, yay! However, this presents an issue for Google storage assets. You need to get the generated url from your Google Cloud Console.
I'm sure there's a smoother way, however, simply visit your given URL endpoint and copy the long URL. Details:
Instructions
Visit your storage console: https://console.cloud.google.com/storage/browser/${MY_BUCKET}?project=${MY_PROJECT}
Click on the image you'd like to display in Github (this brings up the "Object Details" page)
Copy pasta that URL (the one starting with https not gs) into a new browser tab/window
Copy pasta the new generated URL -- it should be longer -- from your new browser tab/window into your Github README file
Hopefully this helps speed up and clarify this issue for anyone else.
Please fallow this four step,
this worked for me
1-Create a new issue on GitHub.
2-Drag-and-drop an image onto the comment field or upload a photo.
3-Wait for the upload process to finish.
4-Copy the URL and use it in your Markdown files on GitHub (use that generated URL in your repository's readme).
First, create a directory(folder) in the root of your local repo that will contain the screenshots you want added. Let’s call the name of this directory screenshots. Place the images (JPEG, PNG, GIF,` etc) you want to add into this directory.
Android Studio Workspace Screenshot
Secondly, you need to add a link to each image into your README. So, if I have images named 1_ArtistsActivity.png and 2_AlbumsActivity.png in my screenshots directory, I will add their links like so:
<img src="screenshots/1_ArtistsActivity.png" height="400" alt="Screenshot"/> <img src=“screenshots/2_AlbumsActivity.png" height="400" alt="Screenshot"/>
If you want each screenshot on a separate line, write their links on separate lines. However, it’s better if you write all the links in one line, separated by space only. It might actually not look too good but by doing so GitHub automatically arranges them for you.
Finally, commit your changes and push it!
To me the best way is -
Create an new issue with that repository on github and then upload the file in gif format.To convert video files into gif format you can use this website http://www.online-convert.com/
Submit the newly created issue.
Copy the address of the uploaded file
Finally in your README file put ![demo](COPIED ADDRESS)
Hope this will help .
Add image in repository from upload file option then in README file
![Alt text]("enter image url of repositoryhere")
Create a New issue by clicking on the green button in the upper right corner. Take a screenshot of whatever you need and paste it into the issue message (CMD+V on Mac or CTR+V on Windows).
My image had space in the name, e.g. Pasted image 20221006123035.png, and that was causing a problem from me, and I lost some time fixing it. If someone has the same issue, then here are the steps
I uploaded the image via upload option
Then clicked on the image in the file browsing UI of the website.
The image is opened in the browser. From the browser's URL I copied the url of the image. You can copy the whole path, or relative to your .md file
Now insert that link to the .md file like ![overview](Pasted%20image%2020221006123035.png)
With the images located in /screen-shots directory. The outer <div> allows the images to be positioned. Padding is achieved using <img width="desired-padding" height="0">.
<div align="center">
<img width="45%" src="screen-shots/about.PNG" alt="About screen" title="About screen"</img>
<img height="0" width="8px">
<img width="45%" src="screen-shots/list.PNG" alt="List screen" title="List screen"></img>
</div>