mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
one of these days, i'm going to have to actually write something. this is not that day.
This commit is contained in:
@@ -15,7 +15,7 @@ $(document).ready(function() {
|
||||
}
|
||||
*/
|
||||
|
||||
$("#toc").html('<a href="javascript:showTOC()">table of contents</a>');
|
||||
hideTOC();
|
||||
|
||||
// "hide", "open in new window", and (optionally) "download" widgets on code & screen blocks
|
||||
$("pre > code").each(function(i) {
|
||||
@@ -83,6 +83,10 @@ function plainTextOnClick(id) {
|
||||
win.document.close();
|
||||
}
|
||||
|
||||
function hideTOC() {
|
||||
$("#toc").html('<span>‣</span> <a href="javascript:showTOC()">show table of contents</a>');
|
||||
}
|
||||
|
||||
function showTOC() {
|
||||
var toc = '';
|
||||
var old_level = 1;
|
||||
@@ -100,5 +104,5 @@ function showTOC() {
|
||||
toc += '</ol>';
|
||||
level -= 1;
|
||||
}
|
||||
$("#toc").html(toc);
|
||||
$("#toc").html('<span>▾</span> <a href="javascript:hideTOC()">hide table of contents</a>' + toc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user