Github:如何将要点嵌入到 README.md 中? [英] Github: How to embed a gist into README.md?

查看:27
本文介绍了Github:如何将要点嵌入到 README.md 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将 gist 嵌入到 GitHub 存储库中的 README.md 文件中?

类似于:

解决方案

更新:我的回答适用于通过 jekyll 构建的 github 页面.我在 markdown 中使用 script 标签,然后由 jekyll 处理.

由于 markdown 支持 html,所以可以简单地使用

..这就是你会得到的

Is it possible to embed gists into README.md file that resides in a GitHub repository?

Something like:

<code id="gist-3167145"></code>

解决方案

Update : My answer works with github pages, built via jekyll. I use the script tags in markdown which is then processed by jekyll.

Since markdown supports html, one can simply use the <script> tag to embed gist.

Simply copy the embed url of the gist provided by github

..and paste it in you markdown file.

Example : Copy the below and paste in your markdown file.

<script src="https://gist.github.com/nisrulz/11c0d63428b108f10c83.js"></script>

..and this is what you will get

这篇关于Github:如何将要点嵌入到 README.md 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆