Skip to content

Commit 6323129

Browse files
authored
Merge pull request #2183 from reebhub/RDoc-3580_readme
Update documentation project usage instructions
2 parents d42f637 + 3ee9013 commit 6323129

File tree

1 file changed

+55
-7
lines changed

1 file changed

+55
-7
lines changed

README.md

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ npm run start
3232
This command starts a local development server and opens up a browser window.
3333
Most changes are reflected live without having to restart the server (hot reload).
3434

35+
To run **only selected versions** (to shorten build time):
36+
* Install `cross-env` if not already installed:
37+
```bash
38+
npm install -g cross-env
39+
```
40+
* Run:
41+
```bash
42+
cross-env DOCUSAURUS_VERSIONS="7.0,7.1,current" npm run start
43+
```
44+
3545
## Build
3646

3747
```bash
@@ -46,6 +56,16 @@ Note it may be necessary to increase Node.js max memory usage, e.g. to 8 GB
4656
$env:NODE_OPTIONS="--max-old-space-size=8192"
4757
```
4858

59+
To build **only selected versions** (to shorten build time and save memory):
60+
* Install `cross-env` if not already installed:
61+
```bash
62+
npm install -g cross-env
63+
```
64+
* Run:
65+
```bash
66+
cross-env DOCUSAURUS_VERSIONS="7.0,7.1,current" npm run build
67+
```
68+
4969
## Serving static content
5070

5171
Static content can be served using a static file server, such as [serve](https://www.npmjs.com/package/serve):
@@ -60,13 +80,41 @@ The documentation is organized into two main directories
6080
- `docs`: Contains the documentation files for latest RavenDB version.
6181
- `versioned_docs`: Contains the documentation files for all other RavenDB versions.
6282

63-
## Adding new version
64-
65-
```bash
66-
npm run docusaurus docs:version version_label
67-
```
68-
69-
This command creates a new version of the documentation by adding `version-version_label` subdirectory to `versioned_docs` directory, which contains a snapshot of `docs` directory.
83+
## Adding a new version
84+
85+
To add a new documentation version:
86+
87+
1. Create a snapshot of the current version in the `versioned_docs` directory.
88+
Use:
89+
```bash
90+
npm run docusaurus docs:version version_label
91+
```
92+
2. To make the new version selectable in the sidebar, update the current version number in the `docs` property of the `docusaurus.config.js` file.
93+
94+
E.g., to add version `7.2`:
95+
* Create a version for `7.1`
96+
```bash
97+
npm run docusaurus docs:version 7.1
98+
```
99+
* Set `7.2` as the current docs version.
100+
`docusaurus.config.js` file:
101+
```json
102+
docs: {
103+
sidebarPath: "sidebars.ts",
104+
routeBasePath: "/",
105+
includeCurrentVersion: true,
106+
lastVersion: 'current',
107+
versions: {
108+
current: {
109+
label: "7.2",
110+
path: "7.2"
111+
}
112+
},
113+
onlyIncludeVersions: getOnlyIncludeVersions(),
114+
//editUrl:
115+
// 'https://github.com/ravendb/docs/tree/main/'
116+
},
117+
```
70118

71119
## Modifying latest version
72120

0 commit comments

Comments
 (0)