How to

#github #github #Markdown #Markdown #YouTube #YouTube #Documentación #Documentation #Tutorial #Tutorial

How to Embed YouTube Video in GitHub Readme Markdown

Embedding a YouTube video in a GitHub README can enhance your documentation by providing visual explanations and tutorials. However, GitHub’s Markdown does not support direct embedding of YouTube videos. Instead, you can use a workaround by linking to the video or using an image link. Here’s how you can do it.

Step-by-Step Guide

The simplest method is to add a clickable link to your YouTube video. Here’s the syntax:

[![Watch the video](https://img.youtube.com/vi/Gs-5PHfKonE/0.jpg)](https://www.youtube.com/watch?v=Gs-5PHfKonE)

In this example:

2. Use HTML for More Control

If you prefer more control over the size and appearance of the embedded content, you can use raw HTML within your Markdown file. Here’s an example:

<a href="https://www.youtube.com/watch?v=Gs-5PHfKonE" target="_blank">
  <img src="https://img.youtube.com/vi/Gs-5PHfKonE/0.jpg" alt="Watch the video" style="width:100%; max-width:600px;">
</a>

This HTML code:

Benefits of Embedding YouTube Videos

Conclusion

While GitHub Markdown does not support direct embedding of YouTube videos, you can still effectively incorporate videos using links and clickable thumbnails. This approach enhances your documentation by providing a more interactive and engaging user experience.


Now you can add your YouTube videos to your GitHub README files and make your documentation more dynamic and informative. Happy coding!