From cb5b96214891dcff0890f07d01fe6b7d1627e8cb Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Wed, 27 Sep 2023 14:07:17 +0200 Subject: [PATCH] Add NPM script 'dev-docs' and document its usage --- docs/.gitignore | 3 +++ docs/CONTRIBUTING.md | 10 +++++----- package.json | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index 45c150536..3aaf5dd22 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,3 +1,6 @@ _site .sass-cache .jekyll-metadata + +# for the `npm run dev-docs` hack that creates a hard linked tree of release-source +releases/dev diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 0792c03a8..383db3d90 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -27,15 +27,15 @@ gem install bundler # install all dependencies bundle install --path vendor/bundle -# build the site -bundle exec jekyll serve +# build, serve and live-reload the site +npm run dev-docs ``` After that you can access the site at http://localhost:4000/ -Unfortunately, you will not see the full `release-source` without a little -fiddling, as the site is excluded from Jekyll. So just supply a little symbolic -link like this from the `./docs` dir: `mkdir releases && ln -s $PWD/release-source releases/latest` +Unfortunately, you will not see the full `release-source`, as the site is excluded from +Jekyll, but we made a little hack to expose the currently worked-on version. +You can check out the currently worked on release docs under [`/releases/dev/release`](http://localhost:4000/releases/dev/release). ## Linting of Markdown diff --git a/package.json b/package.json index 0e5b366a9..c1426707d 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "test": "npm run test-node && npm run test-headless && npm run test-webworker", "check-dependencies": "dependency-check package.json --no-dev --ignore-module esm", "build": "node ./build.cjs", + "dev-docs": "cd docs; cp -rl release-source releases/dev; npm run serve-docs", "build-docs": "cd docs; bundle exec jekyll build", "serve-docs": "cd docs; bundle exec jekyll serve --incremental --verbose --livereload", "lint": "eslint --max-warnings 99 '**/*.{js,cjs,mjs}'",