 
         # 2. generate navigation menu
         ( $menu = $ "#wrapper header nav > ul" ).empty()
-        for sChapterName in aChapters
-            iChapters++
+        for sChapterName in index.chapters
             ( $chapterNav = $ "<li><strong></strong><ul></ul></li>" )
                 .find( "strong" )
                     .text( sChapterName.toLowerCase() )
             $chapterTopicsNav = $chapterNav.find "ul"
-            for sTopicName, sContent of oDocChapters[ sChapterName ]
+            for sTopicName in index[ sChapterName ]
                 iTopics++
                 ( $topicNavLink = $ "<li><a></a></li>" )
                     .find( "a" )


        # 3. insert doc articles
        ( $docs = $ "#wrapper div.docs" ).empty()
        for sChapterName in aChapters
            ( $chapterTitle = $ "<h2></h2>" ).text sChapterName
            $docs.append $chapterTitle
            for sTopicName, sContent of oDocChapters[ sChapterName ]
                ( $topicArticle = $ "<article></article>" )
                    .attr( "id", sTopicName )
                    .html( sContent )
                $docs.append $topicArticle

        # 4. update version number

        classPrefix: ""

pkg = require "../../package.json"
index = require "../index.json"

oMarkdownCompilationOptions =
    gfm: yes
