# Contributing to Walleye

Walleye is small on purpose. This page says how to use it, extend it, and
keep it that way.

## Conventions

- **One fact, one place.** [design.md](design.md) is the contract. If code and
  design disagree, change design.md first, then the code. Other documents
  point to it rather than copy it.
- **The scene format is versioned.** A scene has `"version": 1`. A change that
  breaks old scenes needs a new version and a note in
  [scene-format.md](scene-format.md).
- **No dependencies.** No libraries, no build step, no third-party hosts,
  no fonts or scripts loaded from elsewhere. Command-line tools use the
  Python 3 standard library only.
- **Accessibility checklist** for every page and example:
  - a skip link and a visible focus ring;
  - everything works from the keyboard;
  - alt text for every scene;
  - `prefers-reduced-motion` and `prefers-contrast` honoured;
  - text contrast at least 4.5:1, controls at least 3:1;
  - the page works at 360 px wide with no horizontal scroll;
  - anaglyph or wiggle is available alongside free-viewing.
- **Credits and licences.** Every image and every example names its maker,
  its source and its licence. No image is added without a clear licence.
- **Reconstructions are labelled.** A figure redrawn from a published source
  says so, and cites the source. A public-domain image gives its catalogue
  record.
- **Plain voice.** Pages are published under the owner's name. Short
  sentences, no marketing words.

## Proposing an example

1. Write the scene JSON (see [scene-format.md](scene-format.md)), or add a
   generator to `tools/make_examples.py`.
2. Add a manifest entry:
   `{id, title, category, scene, blurb, credit, tags, level, seed?}`.
   Categories: historical, educational, mathematics, science, new, seeds.
3. Give it alt text, a caption of one or two sentences, and a credit.
4. Open it in the viewer in all five modes. Check that it fuses in parallel
   and cross-eyed, and that the depth is mild.
5. Run the smoke tests (below).

For a placeholder for later work, set `seed: true`; the gallery shows it with
a seed badge.

## Smoke tests

The smoke tests are in `walleye/tests/`. Each is a plain Node script with no
test framework. From the site root, run one with:

```
node walleye/tests/<file>.js
```

A test prints what it checked and exits with a non-zero status on failure.
Run all of them before you send a change. Some tests may need a browser; the
file says so at the top.

## Running it locally

From the site root: `python3 -m http.server`, then open
`http://localhost:8000/walleye/`.
