We use Docusaurus 2 for our website.
If you want to run it locally, you can follow the instructions below, otherwise you should be able to edit most pages directly with a Markdown editor. Opening a pull request for your changes will generate a preview that you can browse to check the rendering.
Assuming you have Node.js (LTS recommended) installed (which includes npm), you can install Docusaurus with:
You will need to install Yarn before you can build the site.
npm install -g yarn
Once you have installed yarn, navigate to docs directory & set-up the dependencies.
cd docs
yarn
yarn start
This command starts a local development server and opens up a browser window. Usually at the URL http://localhost:3000 Most changes are reflected live without having to restart the server.
If you get an error starting yarn mentioning update.latest
such as
>yarn start
if (notifier.update && semver.gt(this.update.latest, this.update.current)) {
TypeError: Cannot read property 'latest' of undefined
at Object.<anonymous> (E:\GitHubRepos\OpenRefine\docs\node_modules\@docusaurus\core\bin\docusaurus.js:49:46)
error Command failed with exit code 1.
then it is likely that you will need to first run
yarn upgrade
which will update all dependencies and store them in the yarn.lock
file to also be committed.
If you wish to work on the next version of docs for OpenRefine (master
branch) then you will need to:
- Git checkout our
master
branch - Edit files under
docs/docs/
- Preview changes with the URL kept pointing to http://localhost:3000/next which will automatically show changes live with yarn after you save a file.
yarn build
This command generates static content into the build
directory and can be served using any static contents hosting service.
You can locally test (with parameters) the static content in the build
directory (in case you don't have access to a hosting service) by using:
yarn serve
or to build and then serve locally with one command:
yarn serve --build
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
If you are using GitHub pages for hosting, this command is a convenient way to build the website
and push to the gh-pages
branch.
This website is published under the Creative Commons Attribution 4.0 International License.