(function($) { $(document).ready(function() { /** ----------------------------------------------- * TABLE OF CONTENTS * * Transform a #table-of-contents div to a nested list */ if($("#table-of-contents").length > 0) { var toc = '
'; $('#table-of-contents').prepend(toc); } }); })(jQuery);