Skip to content

Commit 949e2a6

Browse files
authored
Merge pull request #1252 from jfbercher/toc2_basenumber
[toc2] basenumber
2 parents edd5701 + 90d7219 commit 949e2a6

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

src/jupyter_contrib_nbextensions/nbextensions/toc2/toc2.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
number_sections: true,
3838
sideBar: true,
3939
skip_h1_title: false,
40+
base_numbering: 1,
4041
title_cell: 'Table of Contents',
4142
title_sidebar: 'Contents',
4243
toc_cell: false,
@@ -564,7 +565,8 @@
564565
break;
565566
}
566567
}
567-
for (var i = min_lvl; i <= 6; i++) {
568+
lbl_ary[0] = cfg.base_numbering-1 // begin numbering at base_numbering
569+
for (var i = min_lvl+1; i <= 6; i++) {
568570
lbl_ary[i - min_lvl] = 0;
569571
}
570572

@@ -703,6 +705,7 @@
703705
'The settings won\'t persist in non-live notebooks though.'),
704706
build_setting_input('number_sections', 'Automatically number headings', 'checkbox'),
705707
build_setting_input('skip_h1_title', 'Leave h1 items out of ToC', 'checkbox'),
708+
build_setting_input('base_numbering', 'Begin numbering at'),
706709
build_setting_input('toc_cell', 'Add notebook ToC cell', 'checkbox'),
707710
build_setting_input('title_cell', 'ToC cell title'),
708711
build_setting_input('title_sidebar', 'Sidebar title'),

0 commit comments

Comments
 (0)