add anchor and link to heading cells

This commit is contained in:
MinRK 2013-03-23 12:29:51 -07:00
parent 63bb914670
commit ba4b1d6e1c
2 changed files with 15 additions and 1 deletions

View File

@ -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)
)
);
};

View File

@ -468,3 +468,8 @@ p {
margin-bottom:0;
}
a.heading-link:link {
text-decoration: none;
color: inherit;
}