diff options
author | Andrew Manning <andrew@reticu.li> | 2016-11-27 21:25:38 -0700 |
---|---|---|
committer | Andrew Manning <andrew@reticu.li> | 2016-11-27 21:25:38 -0700 |
commit | 5bcb373c00a500cd8120df41bc0788172fe7e347 (patch) | |
tree | 4cd46a52279696ad83b3d4a0b1fe88e93ee3a556 /doc/toc.html | |
parent | 678239424a8c62fdd6cabc47d12ae0ea1fac9d6a (diff) | |
download | volse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.tar.gz volse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.tar.bz2 volse-hubzilla-5bcb373c00a500cd8120df41bc0788172fe7e347.zip |
Use the jquery.toc.js library to auto-generate a table of contents for the loaded page under the side nav menu
Diffstat (limited to 'doc/toc.html')
-rw-r--r-- | doc/toc.html | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/doc/toc.html b/doc/toc.html index 67e5a0a0a..da67ff88b 100644 --- a/doc/toc.html +++ b/doc/toc.html @@ -93,29 +93,38 @@ </div> </div> +<div id="page-toc-container" style="margin-top:1.0em;"> + <h3>Contents</h3> +</div> + <script> -// $(document).ready(function() { - // Determine the content section from the URL and expand the appropriate menu section - var url = document.createElement('a'); - url.href = window.location; - switch (url.pathname.split('/')[2]) { - case 'tutorials': - $('#tutorials').addClass('in'); - break; - case 'about': - $('#about').addClass('in'); - break; - case 'admin': - $('#administrators').addClass('in'); - break; - case 'member': - $('#members').addClass('in'); - break; - case 'developer': - $('#developers').addClass('in'); - break; - default: - break; - } -// } + + // Determine the content section from the URL and expand the appropriate menu section + var url = document.createElement('a'); + url.href = window.location; + switch (url.pathname.split('/')[2]) { + case 'tutorials': + $('#tutorials').addClass('in'); + break; + case 'about': + $('#about').addClass('in'); + break; + case 'admin': + $('#administrators').addClass('in'); + break; + case 'member': + $('#members').addClass('in'); + break; + case 'developer': + $('#developers').addClass('in'); + break; + default: + break; + } + $(document).ready(function () { + var tocUl = $('#page-toc-container').append('<ul>').find('ul'); + tocUl.removeClass(); + tocUl.toc({content: "#doco-content", headings: "h1,h2,h3,h4"}); + }); + </script>
\ No newline at end of file |