Skip to content

Commit 4e6ec7e

Browse files
Add sticky OS tabs across docs and courses (#14)
Standardize all OS-specific tab groups to use consistent "macOS", "Linux", "Windows" labels so content.tabs.link syncs selections across the site and persists via localStorage. Closes #13
1 parent 164aa78 commit 4e6ec7e

9 files changed

Lines changed: 353 additions & 68 deletions

File tree

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,5 @@ node_modules/
3434
# Wrangler
3535
.wrangler/
3636

37-
# Claude Code
38-
CLAUDE.md
39-
40-
# Planning files
41-
plan.md
42-
ideas.md
37+
# Planning files (scratch only)
4338
scratch_notes.md
44-
research.md
45-
.context/

CLAUDE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# OSC Documentation
2+
3+
Documentation site for the Open Science Collective (OSC), built with MkDocs Material.
4+
5+
## Two Documentation Sources
6+
7+
This repo serves two independent MkDocs sites from two config files, each deploying to its own subdomain:
8+
9+
| Config | docs_dir | Subdomain | Content |
10+
|--------|----------|-----------|---------|
11+
| `mkdocs.yml` | `docs/` | docs.osc.earth | OSC and OSA documentation |
12+
| `mkdocs-courses.yml` | `courses/` | courses.osc.earth | Course materials |
13+
14+
Both share the `overrides/` directory for theme customizations.
15+
16+
## Build and Serve
17+
18+
```bash
19+
# Main docs
20+
uv run mkdocs serve # dev server (docs.osc.earth)
21+
uv run mkdocs build # build to site/
22+
23+
# Courses
24+
uv run mkdocs serve -f mkdocs-courses.yml # dev server (courses.osc.earth)
25+
uv run mkdocs build -f mkdocs-courses.yml # build to site-courses/
26+
```
27+
28+
## OS-Specific Tabs
29+
30+
Both sites use `content.tabs.link` (Material for MkDocs), which syncs tab selections across the page and persists the choice in localStorage. For this to work, all OS tab groups must use exactly these labels:
31+
32+
- `=== "macOS"`
33+
- `=== "Linux"`
34+
- `=== "Windows"`
35+
36+
Never use combined labels like "macOS / Linux" or qualified labels like "macOS: Homebrew"; they break cross-group syncing.
37+
38+
## Submodules
39+
40+
- `osa/` -- the [OSA application repo](https://github.com/OpenScience-Collective/osa) (git submodule). Not part of the docs build; used for API reference generation when enabled.

courses/agentic-research/week-01.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ ls -la # List with details
7777

7878
Package managers let you install software from the command line. Think of them as an app store for developer tools.
7979

80-
=== "macOS: Homebrew"
80+
=== "macOS"
81+
82+
Install [Homebrew](https://brew.sh), the standard macOS package manager:
8183

8284
```bash
8385
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@@ -89,14 +91,22 @@ Package managers let you install software from the command line. Think of them a
8991
brew --version
9092
```
9193

92-
=== "Linux (Debian/Ubuntu) or WSL"
94+
=== "Linux"
9395

9496
You already have `apt`. Update it:
9597

9698
```bash
9799
sudo apt update
98100
```
99101

102+
=== "Windows"
103+
104+
Your WSL Ubuntu terminal already has `apt` (see Step 1). Update it:
105+
106+
```bash
107+
sudo apt update
108+
```
109+
100110
### 3. Install Git and the GitHub CLI
101111

102112
You need two command-line tools: `git` for version control and `gh` (the GitHub CLI) for interacting with GitHub.
@@ -107,7 +117,15 @@ You need two command-line tools: `git` for version control and `gh` (the GitHub
107117
brew install git gh
108118
```
109119

110-
=== "Linux or WSL"
120+
=== "Linux"
121+
122+
```bash
123+
sudo apt install git gh
124+
```
125+
126+
=== "Windows"
127+
128+
In your WSL Ubuntu terminal:
111129

112130
```bash
113131
sudo apt install git gh
@@ -241,6 +259,21 @@ ssh-add ~/.ssh/id_ed25519
241259
# Select and copy the output manually
242260
```
243261

262+
=== "Windows"
263+
264+
In your WSL Ubuntu terminal:
265+
266+
```bash
267+
cat ~/.ssh/id_ed25519.pub
268+
# Select and copy the output manually
269+
```
270+
271+
Or in PowerShell:
272+
273+
```powershell
274+
Get-Content ~\.ssh\id_ed25519.pub | Set-Clipboard
275+
```
276+
244277
Then add it to GitHub:
245278

246279
1. Go to [github.com/settings/keys](https://github.com/settings/keys)
@@ -371,13 +404,21 @@ If all of these work, you are ready for Week 2.
371404
!!! note "Install Claude Code"
372405
Before Week 2, install [Claude Code](https://claude.ai/claude-code):
373406

374-
=== "macOS / Linux"
407+
=== "macOS"
375408

376409
```bash
377410
brew install claude-code
378411
```
379412

380-
=== "Official installer"
413+
=== "Linux"
414+
415+
```bash
416+
curl -fsSL https://claude.ai/install-cli | sh
417+
```
418+
419+
=== "Windows"
420+
421+
In your WSL Ubuntu terminal:
381422

382423
```bash
383424
curl -fsSL https://claude.ai/install-cli | sh

docs/osa/cli-reference.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,26 @@ osa ask -a hed "What is HED?" -o json | jq '.answer'
365365

366366
### Using with Environment Variable
367367

368-
```bash
369-
export OPENROUTER_API_KEY=sk-or-v1-your-key
370-
osa ask -a hed "What is HED?"
371-
osa chat -a bids
372-
```
368+
=== "macOS"
369+
370+
```bash
371+
export OPENROUTER_API_KEY=sk-or-v1-your-key
372+
osa ask -a hed "What is HED?"
373+
osa chat -a bids
374+
```
375+
376+
=== "Linux"
377+
378+
```bash
379+
export OPENROUTER_API_KEY=sk-or-v1-your-key
380+
osa ask -a hed "What is HED?"
381+
osa chat -a bids
382+
```
383+
384+
=== "Windows"
385+
386+
```powershell
387+
$env:OPENROUTER_API_KEY = "sk-or-v1-your-key"
388+
osa ask -a hed "What is HED?"
389+
osa chat -a bids
390+
```

docs/osa/development.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,29 @@ uv sync
3838
# Install pre-commit hooks
3939
uv run pre-commit install
4040

41-
# Copy environment file
42-
cp .env.example .env
41+
# Copy environment file (see OS-specific command below)
4342
# Edit .env with your API keys
4443
```
4544

45+
=== "macOS"
46+
47+
```bash
48+
cp .env.example .env
49+
```
50+
51+
=== "Linux"
52+
53+
```bash
54+
cp .env.example .env
55+
```
56+
57+
=== "Windows"
58+
59+
```powershell
60+
Copy-Item .env.example .env
61+
```
62+
```
63+
4664
## Testing
4765
4866
### Guidelines

docs/osa/getting-started.md

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@ osa init
3030
You'll need an [OpenRouter API key](https://openrouter.ai/keys). The setup will:
3131

3232
1. Prompt for your API key
33-
2. Save it securely to `~/.config/osa/credentials.yaml` (permissions 600)
33+
2. Save it securely to your config directory (see paths below)
3434
3. Test the connection to the API
3535

36+
Config directory by platform:
37+
38+
| Platform | Path |
39+
|----------|------|
40+
| macOS | `~/Library/Application Support/osa/` |
41+
| Linux | `~/.config/osa/` |
42+
| Windows | `%APPDATA%\osa\` |
43+
3644
Alternatively, pass the key directly:
3745

3846
```bash
@@ -63,10 +71,26 @@ osa ask -a hed "What is HED?" --api-key sk-or-v1-your-key
6371

6472
Or set it via environment variable:
6573

66-
```bash
67-
export OPENROUTER_API_KEY=sk-or-v1-your-key
68-
osa ask -a hed "What is HED?"
69-
```
74+
=== "macOS"
75+
76+
```bash
77+
export OPENROUTER_API_KEY=sk-or-v1-your-key
78+
osa ask -a hed "What is HED?"
79+
```
80+
81+
=== "Linux"
82+
83+
```bash
84+
export OPENROUTER_API_KEY=sk-or-v1-your-key
85+
osa ask -a hed "What is HED?"
86+
```
87+
88+
=== "Windows"
89+
90+
```powershell
91+
$env:OPENROUTER_API_KEY = "sk-or-v1-your-key"
92+
osa ask -a hed "What is HED?"
93+
```
7094

7195
## For Developers (Server)
7296

@@ -93,9 +117,23 @@ uv run pre-commit install
93117

94118
Copy the example environment file:
95119

96-
```bash
97-
cp .env.example .env
98-
```
120+
=== "macOS"
121+
122+
```bash
123+
cp .env.example .env
124+
```
125+
126+
=== "Linux"
127+
128+
```bash
129+
cp .env.example .env
130+
```
131+
132+
=== "Windows"
133+
134+
```powershell
135+
Copy-Item .env.example .env
136+
```
99137

100138
Edit `.env` with your settings:
101139

0 commit comments

Comments
 (0)