diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 827c797..6d40c30 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -16,106 +16,8 @@ module.exports = { ga: "UA-100728112-1", themeConfig: { - nav: [ - { - text: "Try Online", - link: "/online", - }, - { - text: "Documentation", - items: [ - { - text: "Guides", - link: "/guides/getting-started", - }, - { - text: "Grammar", - link: "/grammar/", - }, - { - text: "API", - link: "/guides/javascript-api", - }, - { - text: "Compatibility", - link: "/guides/compatibility", - }, - ], - }, - { - text: "Development", - items: [ - { - text: "Contribute", - link: "/development", - }, - { - text: "Changelogs", - link: "/changelogs/", - }, - { - text: "Source code", - link: "https://github.com/pegjs/pegjs", - }, - { - text: "Issue tracker", - link: "https://github.com/pegjs/pegjs/issues", - }, - ], - }, - { - text: "Community", - items: [ - { - text: "Forums", - link: "https://gitq.com/pegjs/pegjs", - }, - { - text: "Wiki", - link: "https://github.com/pegjs/pegjs/wiki", - }, - { - text: "Stack Overflow", - link: "https://stackoverflow.com/questions/tagged/pegjs", - }, - { - text: "Twitter", - link: "https://twitter.com/pegjs", - }, - { - text: "Plugins", - link: "https://www.npmjs.com/search?q=pegjs%20plugin", - } - ], - }, - ], - sidebar: { - - "/grammar/": [ - "", - "parsing-expression-types", - "balanced-braces", - "action-execution-environment", - "backtracking", - "case-insensitivity", - "error-messages", - [ "tracer", "Tracer" ], - ], - - "/guides/": [ - "getting-started", - "installation", - "command-line", - "generating-a-parser", - "javascript-api", - "plugins", - "using-the-parser", - "compatibility", - ], - - "/": false, - - }, + nav: require( "./config/nav.js" ), + sidebar: require( "./config/sidebar.js" ), sidebarDepth: 0, displayAllHeaders: false, activeHeaderLinks: true, @@ -135,4 +37,9 @@ module.exports = { }, + extraWatchFiles: [ + require.resolve( "./config/nav.js" ), + require.resolve( "./config/sidebar.js" ), + ] + }; diff --git a/docs/.vuepress/config/nav.js b/docs/.vuepress/config/nav.js new file mode 100644 index 0000000..d466aec --- /dev/null +++ b/docs/.vuepress/config/nav.js @@ -0,0 +1,80 @@ +"use strict"; + +module.exports = [ + + { + text: "Try Online", + link: "/online", + }, + + { + text: "Documentation", + items: [ + { + text: "Guides", + link: "/guides/getting-started", + }, + { + text: "Grammar", + link: "/grammar/", + }, + { + text: "API", + link: "/guides/javascript-api", + }, + { + text: "Compatibility", + link: "/guides/compatibility", + }, + ], + }, + + { + text: "Development", + items: [ + { + text: "Contribute", + link: "/development", + }, + { + text: "Changelogs", + link: "/changelogs/", + }, + { + text: "Source code", + link: "https://github.com/pegjs/pegjs", + }, + { + text: "Issue tracker", + link: "https://github.com/pegjs/pegjs/issues", + }, + ], + }, + + { + text: "Community", + items: [ + { + text: "Forums", + link: "https://gitq.com/pegjs/pegjs", + }, + { + text: "Wiki", + link: "https://github.com/pegjs/pegjs/wiki", + }, + { + text: "Stack Overflow", + link: "https://stackoverflow.com/questions/tagged/pegjs", + }, + { + text: "Twitter", + link: "https://twitter.com/pegjs", + }, + { + text: "Plugins", + link: "https://www.npmjs.com/search?q=pegjs%20plugin", + } + ], + }, + +]; diff --git a/docs/.vuepress/config/sidebar.js b/docs/.vuepress/config/sidebar.js new file mode 100644 index 0000000..84edc1a --- /dev/null +++ b/docs/.vuepress/config/sidebar.js @@ -0,0 +1,29 @@ +"use strict"; + +module.exports = { + + "/grammar/": [ + "", + "parsing-expression-types", + "balanced-braces", + "action-execution-environment", + "backtracking", + "case-insensitivity", + "error-messages", + [ "tracer", "Tracer" ], + ], + + "/guides/": [ + "getting-started", + "installation", + "command-line", + "generating-a-parser", + "javascript-api", + "plugins", + "using-the-parser", + "compatibility", + ], + + "/": false, + +};