Permalink
Browse files

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...
1 parent 81fd7b2 commit f300e75afec70e91500f2c1493b37e169a46c896 @whiteinge whiteinge committed Feb 28, 2013
Showing with 38 additions and 1 deletion.
  1. +30 −0 doc/_templates/modules-sidebar.html
  2. +8 −1 doc/conf.py
@@ -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>
View
@@ -143,8 +143,15 @@ def __getattr__(self, name):
'404': '404.html',
}
+html_default_sidebars = [
+ 'localtoc.html',
+ 'relations.html',
+ 'sourcelink.html',
+ 'searchbox.html',
+]
html_sidebars = {
- '**': [
+ 'ref/**/all/salt.*': [
+ 'modules-sidebar.html',
'localtoc.html',
'relations.html',
'sourcelink.html',

0 comments on commit f300e75

Please sign in to comment.