From 0ac03014676a55ce4fdc58979620389e33a3b154 Mon Sep 17 00:00:00 2001 From: Zach Date: Fri, 21 Sep 2018 20:37:42 -0400 Subject: [PATCH] Merge PR #2371: how to build docs locally --- docs/{ => .vuepress}/config.js | 0 docs/.vuepress/enhanceApp.js | 3 +++ docs/.vuepress/override.styl | 4 ++++ docs/DOCS_README.md | 33 +++++++++++++++++++++++++++++---- 4 files changed, 36 insertions(+), 4 deletions(-) rename docs/{ => .vuepress}/config.js (100%) create mode 100644 docs/.vuepress/enhanceApp.js create mode 100644 docs/.vuepress/override.styl diff --git a/docs/config.js b/docs/.vuepress/config.js similarity index 100% rename from docs/config.js rename to docs/.vuepress/config.js diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000000..f24006cbaa --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,3 @@ +export default ({ router }) => { + router.addRoutes([{ path: "/testnet/", redirect: "/" }]) +} diff --git a/docs/.vuepress/override.styl b/docs/.vuepress/override.styl new file mode 100644 index 0000000000..39bdc860df --- /dev/null +++ b/docs/.vuepress/override.styl @@ -0,0 +1,4 @@ +$accentColor = #304DE9 +$textColor = #15192C +$borderColor = #eaecef +$codeBgColor = #282c34 diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index 78451c0ef2..30cb5d9bcb 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -24,7 +24,7 @@ on the website. ## Config.js -The [config.js](./config.js) generates the sidebar and Table of Contents +The [config.js](./.vuepress/config.js) generates the sidebar and Table of Contents on the website docs. Note the use of relative links and the omission of file extensions. Additional features are available to improve the look of the sidebar. @@ -59,9 +59,34 @@ to send users to the GitHub. ## Building Locally -Not currently possible but coming soon! Doing so requires -assets held in the (private) website repo, installing -[VuePress](https://vuepress.vuejs.org/), and modifying the `config.js`. +To build and serve the documentation locally, run: + +``` +npm install -g vuepress +``` + +then change the following line in the `config.js`: + +``` +base: "/docs/", +``` + +to: + +``` +base: "/", +``` + +Finally, go up one directory to the root of the repo and run: + +``` +# from root of repo +vuepress build docs +cd dist/docs +python -m SimpleHTTPServer 8080 +``` + +then navigate to localhost:8080 in your browser. ## Consistency