add TOC
[tools.git] / index.php
blob:a/index.php -> blob:b/index.php
--- a/index.php
+++ b/index.php
@@ -24,13 +24,13 @@
         <!-- Add your site or application content here -->
         <div id="toc"></div>
         <div id="wrapper">
-            <div id="items">
-            </div>
+        <section>
 <?php
 include_once "php-markdown/markdown.php";
-echo Markdown(file_get_contents("index.md"));
+echo str_replace("</div><div><h1>GovHack","<div><h1>GovHack",str_replace("<h1>","</div><div><h1>",Markdown(file_get_contents("index.md"))));
 ?>
 </div>
+        </section>
         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
         <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.0.min.js"><\/script>')</script>
         <script src="js/plugins.js"></script>
@@ -42,8 +42,10 @@
                 'selectors': 'h1'
             });
             $(function(){
-                $("#items").stoc({
-                    search: "#wrapper"
+
+                $('<div class="items"></div>').insertAfter('h1');
+                $(".items").each(function() {
+                    $(this).stoc();
                 });
             });
         </script>