-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restored html_default_sidebars setting; added JS TOC to modules sidebar
Using JavaScript to generate a local table of contents for the modules is less than ideal but this isn't easily accomplished with autosummary (see 87c1000) and we badly need this.
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div id="module-funcs"></div> | ||
|
||
<script> | ||
jQuery.fn.local_toc = function(tgt_sel) { | ||
var tgt = jQuery(tgt_sel); | ||
|
||
tgt.append('<h4>Table of Contents</h4>'); | ||
|
||
jQuery('dt .headerlink').each(function(idx, elem) { | ||
|
||
var i = [ | ||
'<li><a href="', elem.href, '">', | ||
last(elem.href.split('.')), | ||
'</a></li>'] | ||
.join(''); | ||
|
||
tgt.append(i); | ||
}); | ||
|
||
function last(list) { | ||
return list[list.length - 1]; | ||
} | ||
}; | ||
</script> | ||
|
||
<script> | ||
;(function($) { | ||
$.fn.local_toc('#module-funcs'); | ||
})(jQuery); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters