且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Markdown中引用IPython Notebook单元?

更新时间:2023-09-29 23:15:52

是的,在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.