Skip to content

Commit 763debf

Browse files
authored
Merge pull request #204 from gardenlinux/fix/add-virtualenv-info
Docs: Add virtualenv info to working locally guide
2 parents bb9e007 + 63a63a4 commit 763debf

2 files changed

Lines changed: 43 additions & 6 deletions

File tree

‎Makefile‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help run build preview publish transform aggregate aggregate-repo aggregate-update-repo aggregate-repo-single aggregate-update-repo-single test-aggregate-local clean clean-projects clean-aggregated-git test test-unit test-integration check spelling linkcheck woke glossary glossary-check format
1+
.PHONY: help run build preview publish transform aggregate aggregate-repo aggregate-update-repo aggregate-repo-single aggregate-update-repo-single test-aggregate-local clean clean-projects clean-aggregated-git test test-unit test-integration check spelling linkcheck woke glossary glossary-check format check-system-deps
22

33
help:
44
@echo "Garden Linux Documentation Hub - Available targets:"
@@ -36,7 +36,12 @@ help:
3636
@echo " clean - Clean aggregated docs and build artifacts"
3737
@echo ""
3838

39-
install:
39+
check-system-deps:
40+
@if ! command -v pnpm >/dev/null 2>&1; then @echo "pnpm not found! Please install using your package manager."; exit 1; fi
41+
@if ! command -v python3 --version >/dev/null 2>&1; then @echo "python3 not installed! Please install using your package manager."; exit 1; fi
42+
@if ! command -v git --version >/dev/null 2>&1; then @echo "git not installed! Please install using you package manager."; exit 1; fi
43+
44+
install: check-system-deps
4045
@echo "Installing dependencies..."
4146
pnpm install
4247
pip install -r requirements.txt
@@ -98,7 +103,7 @@ aggregate-update-repo-single:
98103
$(if $(REF),--override-ref $(REF)) \
99104
$(if $(COMMIT),--override-commit $(COMMIT))
100105

101-
run:
106+
run: check-system-deps
102107
pnpm run docs:dev
103108

104109
build: install clean aggregate

‎docs/contributing/documentation/working-locally.md‎

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ repositories into a unified documentation site.
2323

2424
## Working with the Documentation System Locally
2525

26-
For more substantial changes — like adding new pages, restructuring content, or
27-
working on the aggregation system itself — you'll want to set up the
26+
For more substantial changes, (adding new pages, restructuring content, or
27+
working on the aggregation system itself) you will want to set up the
2828
documentation system locally.
2929

3030
### Prerequisites
3131

3232
- Python 3.x
3333
- pnpm (for VitePress)
34+
- virtualenv (optional)
3435
- Git
3536

3637
### Step 1: Clone the Repository
@@ -49,6 +50,32 @@ pnpm install
4950
This installs VitePress and other Node.js dependencies needed to build the
5051
documentation site.
5152

53+
:::tip Problems with installing Python Dependencies?
54+
55+
Potentially, your Linux distribution or other operating system might forbid you from installing
56+
python dependencies system wide.
57+
58+
To go around this, it is wise practice to use a [virtual environment](https://www.w3schools.com/python/python_virtualenv.asp).
59+
60+
We use [`virtualenv`](https://virtualenv.pypa.io/en/latest/). Install virtualenv via your distributions package manager
61+
or a method appropriate for your operating system.
62+
63+
Then, create the virtual environment and activate it.
64+
65+
```bash
66+
virtualenv .venv && source .venv/bin/activate
67+
```
68+
69+
afterwards, continue working like normal.
70+
71+
In the end, you can deactivate the environment using
72+
73+
```bash
74+
deactivate
75+
```
76+
or closing the Terminal.
77+
:::
78+
5279
### Step 3: Aggregate Documentation
5380

5481
#### From Remote Repositories (Production)
@@ -62,7 +89,7 @@ make aggregate
6289
This fetches documentation from the configured repositories at their locked
6390
commit hashes.
6491

65-
#### GitHub API token
92+
:::info Add A GitHub API Token To Counter Rate Limiting
6693

6794
`make aggregate` also fetches every release from `gardenlinux/gardenlinux` via
6895
the GitHub Releases API to generate per-release note pages and to validate
@@ -74,6 +101,11 @@ export GITHUB_TOKEN=$(gh auth token)
74101
make aggregate
75102
```
76103

104+
:::tip
105+
You can add the `export` statement to you Shell's configuration file to avoid having to re-export it in different sessions.
106+
107+
:::
108+
77109
#### From Local Repositories (Development)
78110

79111
For local development, use `repos-config.local.json` with `file://` URLs:

0 commit comments

Comments
 (0)