Added basic scrollspy

This commit is contained in:
Tom Christie
2014-01-14 20:06:46 +00:00
parent c8740dacfb
commit e5b9911417
4 changed files with 19 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ pages:
- ['topics/django-extra-views-compatibility.md', 'Topics / Django Extra Views Compatilibity']
- ['topics/release-notes.md', 'Topics / Release Notes']
theme_dir: 'united'
theme_dir: 'theme'
source_dir: 'docs'
output_dir: 'build'

View File

@@ -91,6 +91,10 @@ def build_html(config):
content = md.convert(source_content)
meta = md.Meta
# Allow 'template:' override in md source files.
if 'template' in meta:
template = env.get_template(meta['template'][0])
# Strip out the generated table of contents
(content, toc) = content.split('<!-- STARTTOC -->', 1)

View File

@@ -22,7 +22,7 @@
<![endif]-->
</head>
<body onload="prettyPrint()">
<body>
{% include "nav.html" %}
<div class="container">

View File

@@ -1,3 +1,16 @@
/* Prettyify */
$( document ).ready(function() {
prettyPrint();
});
/* Scrollspy */
var navHeight = $('.navbar').outerHeight(true) + 10
$('body').scrollspy({
target: '.bs-sidebar',
offset: navHeight
})
/* We need to adjust the scroll height of anchor links to adjust for the
fixed height navbar */
window.disableShift = false;