@@ -63,6 +63,11 @@ define([
63
63
}
64
64
}
65
65
66
+ function toggleToc ( ) {
67
+ toggle_toc ( cfg )
68
+ }
69
+
70
+
66
71
var toc_button = function ( cfg ) {
67
72
if ( ! IPython . toolbar ) {
68
73
events . on ( "app_initialized.NotebookApp" , function ( evt ) {
@@ -158,6 +163,8 @@ define([
158
163
var cfg = toc2 . read_config ( ) ;
159
164
// create highlights style section in document
160
165
create_additional_css ( cfg ) ;
166
+ // add toc toggle button (cfg loaded)
167
+ toc_button ( cfg ) ; //console.log("Adding toc_button")
161
168
// call main function with newly loaded config
162
169
table_of_contents ( cfg ) ;
163
170
// event: render toc for each markdown cell modification
@@ -175,7 +182,7 @@ define([
175
182
addSaveAsWithToc ( ) ;
176
183
} )
177
184
178
- // add a save as HTML with toc included
185
+ // add a save as HTML with toc included
179
186
addSaveAsWithToc ( ) ;
180
187
// Highlight cell on execution
181
188
patch_CodeCell_get_callbacks ( )
@@ -184,11 +191,11 @@ define([
184
191
185
192
var load_ipython_extension = function ( ) {
186
193
load_css ( ) ; //console.log("Loading css")
187
- toc_button ( ) ; //console.log("Adding toc_button")
194
+ // toc_button(); //console.log("Adding toc_button")
188
195
189
196
// Wait for the notebook to be fully loaded
190
197
if ( Jupyter . notebook !== undefined && Jupyter . notebook . _fully_loaded ) {
191
- // this tests if the notebook is fully loaded
198
+ // this tests if the notebook is fully loaded
192
199
console . log ( "[toc2] Notebook fully loaded -- toc2 initialized " )
193
200
toc_init ( ) ;
194
201
} else {
0 commit comments