Skip to content

Commit e627dfc

Browse files
committed
[toc2] add a tag #skip to skip headers from being inserted in toc, cf #1027
1 parent 9094b4f commit e627dfc

File tree

1 file changed

+4
-0
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/toc2

1 file changed

+4
-0
lines changed

src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ var table_of_contents = function (cfg,st) {
550550
if (h.id=="Table-of-Contents"){ return; }
551551
//If h had already a number, remove it
552552
$(h).find(".toc-item-num").remove();
553+
// skip header if tag #skip is present
554+
if (h.id.search('#skip') !== -1 ) {
555+
$(h).text($(h).text().replace("#skip", ""));
556+
return; }
553557
var num_str= incr_lbl(lbl_ary,level-1).join('.');// numbered heading labels
554558
var num_lbl= $("<span/>").addClass("toc-item-num")
555559
.text(num_str).append('&nbsp;').append('&nbsp;');

0 commit comments

Comments
 (0)