forked from ankitects/anki-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoc.pre
More file actions
31 lines (29 loc) · 977 Bytes
/
Copy pathtoc.pre
File metadata and controls
31 lines (29 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<%block name="head">
<link type="text/css" rel="stylesheet" href="/css/jquery.tocify.css"/>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery-ui-1.10.2.custom.min.js"></script>
<script src="/js/jquery.tocify.min.js"></script>
<script>
function hashGen(str, elem) {
var val = str.replace(/[?!'"]/g, "-");
val = val.toLowerCase().replace(/\s/g, "-");
// fix double hyphens
while (val.indexOf("--") > -1) {
val = val.replace(/--/g, "-");
}
// fix colon-space instances
while (val.indexOf(":-") > -1) {
val = val.replace(/:-/g, "-");
}
// no trailing -
val = val.replace(/-$/, "");
return val;
}
$(function () {
$("#toc").tocify({hashGenerator: hashGen, theme: "none", selectors: "h2,h3"});
});
</script>
</%block>
<div class="row-fluid">
<div class="span4 hidden-phone" id="toc"></div>
<div class="span8 offset4">