Skip to content

Commit

Permalink
Move toc.js script into a file
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 25, 2014
1 parent e95b5aa commit 94c4660
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md

html_docdeps = html/dochead.html \
html/docfoot.html \
html/docfoot-script.html \
scripts/doc-build.sh \
package.json

Expand Down
1 change: 1 addition & 0 deletions html/dochead.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<title>@NAME@</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<script async=true src="../../static/toc.js"></script>

<body>
<div id="wrapper">
4 changes: 1 addition & 3 deletions html/docfoot-script.html → html/static/toc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
Expand Down Expand Up @@ -27,5 +26,4 @@
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>
})();
3 changes: 1 addition & 2 deletions scripts/doc-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ case $dest in
else
cat
fi) \
> $dest \
&& cat html/docfoot-script.html >> $dest
> $dest
exit $?
;;
*)
Expand Down

0 comments on commit 94c4660

Please sign in to comment.