# add-documentation

Generate a Docusaurus documentation site for an experience.

## Usage

```bash
npx nx g @unisphere/nx:add-documentation
```

The experience name is auto-resolved from `.unisphere` config.

## Flags

| Flag | Type | Default | Description |
|------|------|---------|-------------|
| `--name` | string | auto from `.unisphere` | Override the experience name |
| `--is-experience-level` | boolean | `false` | Skip sub-name prompt (top-level experience docs) |
| `--sub-name` | string | prompted | Sub-name for the documentation site |

## Examples

**Sub-level docs (default)** — prompts for sub-name:

```bash
npx nx g @unisphere/nx:add-documentation
# Experience name auto-resolved from .unisphere
# Prompts: "What is the documentation sub-name?"
# e.g. sub-name "models" → folder: unisphere/documentation/{experience}-models
```

**Sub-level docs with flags (no prompts):**

```bash
npx nx g @unisphere/nx:add-documentation --sub-name=models
```

**Experience-level docs (no sub-name):**

```bash
npx nx g @unisphere/nx:add-documentation --is-experience-level
# → folder: unisphere/documentation/{experience}
```

**Override experience name:**

```bash
npx nx g @unisphere/nx:add-documentation --name=cs --sub-name=models
# → folder: unisphere/documentation/cs-models
```

## Output

- `unisphere/documentation/{name}/` — Full Docusaurus site
- `.unisphere` — Updated with documentation entry
- `.nxignore` — Updated to exclude documentation node_modules

## After generation

```bash
cd unisphere/documentation/{name}
npm install
npx unisphere documentation serve {name}
```
