如何在Markdown中引用IPython Notebook单元? [英] How to reference a IPython notebook cell in markdown?

查看:192
本文介绍了如何在Markdown中引用IPython Notebook单元?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在IPython笔记本Markdown中引用单元格?

How do I reference a cell in a IPython notebook markdown?

我知道如何引用外部链接.但是,有没有一种方法可以为单元格分配ID,然后在降价中引用该单元格呢?

I know how to make a reference to an external link. But is there a way to assign an ID to a cell and then refer to the cell in the markdown?

推荐答案

是的,在IPython中可以做到这一点.

Yes, there's way to do just that in IPython.

首先,在要链接的单元格中用html锚标记定义目标,并为其指定一个Id.例如:

First, define the destination in the cell you want to link with a html anchor tag and give it an Id. For example:

<a id='another_cell'></a>

注意-在markdown中运行上述单元格时,该单元格将变为不可见.您可以在锚点上方添加一些文本以标识该单元格.

Note - When you run the above cell in markdown, it will become invisible. You can add some text above the anchor to identify the cell.

第二,在另一个单元格中使用Markdown语法创建到上面创建的目标的内部超链接,然后运行它:

Second, create the internal hyperlink to the destination created above using Markdown syntax in another cell and run it:

[Another Cell](#another_cell)

现在,点击链接即可将您带到目的地.

Now, clicking on link should take you to the destination.

这篇关于如何在Markdown中引用IPython Notebook单元?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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