Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Github buttons in Markdown (README.md)

I want to add buttons to my markdown that, when pressed, let the viewer fork, star or watch a github repository.

I already tried adding the html to my README.md, but it does not work.

Especially

<script async defer src="https://buttons.github.io/buttons.js></script>

does not seem to work (it just displays the link)

Is there a way to use Github Buttons (https://buttons.github.io) in a markdown (.md) file?

Or are there other ways to inplement this?

like image 223
finnmglas Avatar asked May 12 '20 15:05

finnmglas


1 Answers

If you created an image file with the button you could incorporate it directly in markdown.

For example:

[![](https://s18955.pcdn.co/wp-content/uploads/2018/02/github.png)](https://github.com/user/repository/subscription)

To control the size of the button you may need to incorporate html borrowing from this answer Changing image size in Markdown

[<img src="https://s18955.pcdn.co/wp-content/uploads/2018/02/github.png" width="25"/>](https://github.com/user/repository/subscription)
like image 57
Ari Anisfeld Avatar answered Nov 09 '22 12:11

Ari Anisfeld