has some extra CSS that floats it above the
// heading and makes it easier to see when linked
$(heading).before(anchorFor(headingId))
// add a permalink to all but the first heading
if (i > 0) {
$(heading).append(permalinkTo(headingId));
}
});
// Table of Contents
$('#page-toc').toc({
'selectors': 'h1,h2', // elements to use as headings
'container': '#page-toc-source', // element to find all selectors in
'prefix': '', // prefix for anchor tags and class names
'onHighlight': function(el) {}, // called when a new section is highlighted
'highlightOnScroll': true, // add class to heading that is currently in focus
'highlightOffset': 100, // offset to trigger the next headline
'anchorName': function(i, heading, prefix) { // custom function for anchor name
return getIdForHeading(heading);
},
'headerText': function(i, heading, $heading) { // custom function building the header-item text
return $heading.text();
},
'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
// don't assign any special classes to the toc entry itself
return '';
}
});
$('mark').each(function(index, element) {
var platform = element.innerText.toLowerCase();
platform = platform.replace(/ /g, '');
if (platforms[platform]) {
$(element).addClass('logo');
$(element).addClass(platform);
$(element).attr('title', platforms[platform]);
element.innerText = '';
}
});
$('#page-toc-source').each(function(index, element) {
// Process section-xxx (eg. section-note or section-config) in order
// to apply right style (see webdocs-agl/site/static/styles/scss/_sections.scss )
['section-note', 'section-config', 'section-warning', 'section-todo'].forEach(function (sec) {
try {
res = element.innerHTML.replace(new RegExp('', 'g'), '');
element.innerHTML = res.replace(new RegExp('', 'g'), '');
} catch(err) { }
});
});
});