mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
add anchor and link to heading cells
This commit is contained in:
parent
63bb914670
commit
ba4b1d6e1c
@ -516,7 +516,16 @@ var IPython = (function (IPython) {
|
||||
HeadingCell.prototype.set_rendered = function (text) {
|
||||
var r = this.element.find("div.text_cell_render");
|
||||
r.empty();
|
||||
r.append($('<h'+this.level+'/>').html(text));
|
||||
r.append(
|
||||
$('<a/>')
|
||||
.addClass('heading-link')
|
||||
.attr('href', '#' + text)
|
||||
.attr('name', text)
|
||||
.append(
|
||||
$('<h'+this.level+'/>')
|
||||
.html(text)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
@ -468,3 +468,8 @@ p {
|
||||
margin-bottom:0;
|
||||
|
||||
}
|
||||
|
||||
a.heading-link:link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user