Skip to main content
Version: ELN v4.x

Maintaining

info

This page is for maintainers of this Docusaurus instance (chemotion_saurus) -- setting up a local environment, understanding the repo's structure, cutting a new docs version, and deploying. For day-to-day content editing, see This Documentation.

Local setup​

Requires Node.js 24 (see engines in package.json). Clone the repository, then:

npm install
npm start

This serves the site at http://localhost:3000 with hot reload. Useful variants:

npm start -- --port 3001 # a different port
npm run build # production build; also catches broken links (onBrokenLinks: "throw")
npm run serve # serve the last `npm run build` output, to check the production build locally
npm run clear # clear the Docusaurus cache, if a build behaves unexpectedly

Environment variables (e.g. for the analytics scripts in docusaurus.config.js) are loaded via dotenv from a local .env file, which is gitignored -- ask another maintainer for the values, or run without it for local development.

Repository structure​

This site actually serves three independent documentation sets, each its own @docusaurus/plugin-content-docs instance (configured in docusaurus.config.js), sharing one navbar and one visually continuous sidebar:

InstanceContent folderURL prefixVersioned?
default (Chemotion ELN + Services + Development + this section)docs//docs/Yes -- v2 / current (3.x)
repo (Chemotion Repository)repo-docs//docs/repoNo -- Repository ships independently and doesn't need it
labimotion (Chemotion LabIMotion)labimotion-docs//docs/labimotionYes -- 2.1 / current (2.2)

Because each instance owns its own sidebar, sidebarItemsGenerator.js, sidebarItemsGeneratorRepo.js, and sidebarItemsGeneratorLabimotion.js post-process the autogenerated output of each so the three still read as one continuous sidebar: the default instance's generator splices in links to the other two (at the position they'd occupy if they were still real folders under docs/), and each of the other two instances' generators wrap their own content into a single top-level category, then mirror every other section as plain links via sidebars-repo.js / sidebars-labimotion.js. The shared list of top-level sections (labels + hrefs) that all of this reads from lives in mainSiteSections.js -- update it there first if a top-level section is renamed, reordered, or removed.

Adding a new page under an existing folder needs no sidebar edit -- every instance's sidebar is { type: "autogenerated", dirName: "." }, so a new file is picked up automatically, ordered by its sidebar_position frontmatter (see This Documentation). You only touch a sidebars*.js file when adding a new top-level section, or a new versioned/split-out instance.

Versioning​

Two of the three instances are versioned; each behaves slightly differently, so check which one you're touching.

Chemotion ELN (default instance). docs/ (the "current" tree) is the latest release, actively developed in place. Cutting a new version means freezing what's there right before moving to the next one:

npm run docusaurus -- docs:version <version-that-is-ending, e.g. v3>

This snapshots docs/ into versioned_docs/version-<id>/ and adds <id> to versions.json. Afterwards, update the versions map in docusaurus.config.js (and the matching navbar docsVersionDropdown item) to add the new frozen version's label and relabel current for the version now being developed.

Chemotion LabIMotion. Uses a major.minor scheme, and unlike the ELN, current (the labimotion-docs/ source tree) is always the in-progress next minor, not the latest release -- lastVersion points at the actual latest release instead. Shipping a new minor means snapshotting it under its own name, not under current:

npm run docusaurus -- docs:version:labimotion <version, e.g. 2.2>

This snapshots labimotion-docs/ into labimotion_versioned_docs/version-<id>/ and adds <id> to labimotion_versions.json, leaving labimotion-docs/ itself as the new in-progress version. Afterwards, update lastVersion and the versions map for the labimotion plugin instance in docusaurus.config.js (and the matching navbar dropdown) to point at the new release and relabel current for the next one.

Chemotion Repository. Deliberately unversioned -- it ships on its own release cycle, and there was never any real content divergence to justify tracking old snapshots (confirmed when it was split out of the default instance).

Renaming or moving a page​

Update redirects.json with a { "from": "<old-path>", "to": "<new-path>" } entry -- it's consumed by the @docusaurus/plugin-client-redirects plugin to 301-redirect the old URL, so existing bookmarks and external links don't break.

Deployment​

npm run build produces the build/ directory (and additionally prunes unreferenced images via scripts/prune-build-img.js, since static/img accumulates over time). Continuous deployment runs via GitHub Actions on push -- see the workflow file and the CI chapter for how it's wired up.