Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "robokit-site",
"runtimeExecutable": "make",
"runtimeArgs": ["serve"],
"port": 8734
"port": 8914
}
]
}
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
# committed corpus, so CI and a fresh clone both work with no sibling repos.
PROJECT ?=
SRC ?=
PORT ?= 8734
PORT ?= 8914

# What a browser is allowed to see. Everything else in the checkout -- the
# scripts, the Makefile, the README -- is how the site is made, not part of it.
PUBLIC = index.html CNAME .nojekyll assets graspkit retargetingkit robokit roboskills

.PHONY: serve import pages site benchmark-image check-docs check-site test clean
.PHONY: serve import site benchmark-image check-docs check-site test clean

# The pages use root-relative paths, so the site must be served from this
# built directory — opening HTML over file:// will not resolve /assets or /data.
serve: site
python3 scripts/serve.py $(PORT) _page
@printf '\nSite: http://localhost:$(PORT)/\nDocs: http://localhost:$(PORT)/docs/robokit/overview/\n\n'
python3 -u scripts/serve.py $(PORT) _page

# Convert one product repo's Markdown into its own file under data/docs/, then
# rebuild. Each kit owns one path, so two imports never touch the same file.
Expand All @@ -22,16 +23,9 @@ serve: site
#
# In CI this runs from the product repo, which then commits the result here.
import:
@test -n "$(PROJECT)" || { echo "PROJECT= is required"; exit 1; }
@test -n "$(SRC)" || { echo "SRC= is required"; exit 1; }
@test -f "scripts/import_$(PROJECT)_docs.py" -o -n "$(filter robokit graspkit,$(PROJECT))" \
|| { echo "no importer for $(PROJECT)"; exit 1; }
uv run scripts/$(if $(filter robokit graspkit,$(PROJECT)),import_docs.py --project $(PROJECT),import_$(PROJECT)_docs.py) $(SRC)
uv run scripts/import_docs.py $(PROJECT) $(SRC)
$(MAKE) site

# Rebuild from the committed corpus.
pages: site

# Assemble the complete site without writing generated files into source paths.
# Everything it needs is committed here, so this works on a bare clone.
site: clean
Expand Down
174 changes: 38 additions & 136 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,158 +1,60 @@
# OpenRoboKit website

A static site — no framework, and nothing rendered at request time. The hand-
written pages are markup only; the documentation is generated once, up front,
into one HTML file per page. All CSS and JS live under `assets/`.
The static site behind openrobokit.com. Each page is a small HTML stub that
`assets/js/` renders from the content in `data/`. The docs are built ahead of
time into one HTML page per document.

## Running it

```shell
./scripts/preview.sh # build, then preview http://localhost:8914/retargetingkit/
make serve # build, then serve http://localhost:8734 from _page/
make test # the converter and page-builder tests
make site # rebuild the complete site in ignored _page/
make check-site # build twice; check links, search, and reproducibility
make clean # remove _page/
make serve # build into _page/ and serve http://localhost:8914 (PORT=… to change)
make test # converter and page-builder tests, JS syntax checks
make check-site # links, search coverage, and reproducible output
```

The preview script works from any directory and accepts an optional port:
`./scripts/preview.sh 8915`. Keep its terminal open while browsing, or run it
in the background from the repository root:

```shell
mkdir -p output
nohup ./scripts/preview.sh 8914 > output/preview.log 2>&1 < /dev/null &
```

When the repository is on a remote machine, forward port 8914 in your editor
or SSH connection before opening the localhost URL on your computer.

All paths in the site are **root-relative** (`/assets/…`, `/data/…`), so the
site has to be served from `_page/`. Opening an `.html` file over
`file://` will not resolve anything.

Building requires `make`, `uv`, and Node.js. `uv` selects Python 3.12 for the
build and tests. Everything a build reads is committed here, so `make site`
works on a bare clone — no sibling checkouts. Only `make import` needs one, and
only for the project being imported.

`scripts/serve.py` serves the built tree with HTTP Range support so the video
scrubbers can seek locally.
You need `make`, `uv` and Node.js. Everything the build reads is committed
here. Paths are root-relative, so browse through the server rather than
`file://`. `scripts/serve.py` answers Range requests so videos can seek.

## Layout

```
index.html landing page
robokit/ ┐
retargetingkit/ ├ one stub each: title, favicon, RK_PROJECT, script tags
graspkit/ ┘

assets/css/site.css nav + mobile menu, shared by every page
assets/css/{home,project,docs}.css
assets/js/site.js nav render, menu toggle, hero-video fallback
assets/js/{home,project,docs}.js
docs.js is page behaviour only — no router
assets/{brand,images,videos}/

data/projects.js content + theme for the three project pages
data/docs/<kit>.js the documentation corpus, one file per kit;
build input, never served

scripts/ the Python importers and page builder
.github/workflows/ci.yml test, validate, and upload a downloadable site artifact

_page/ complete built site; ignored by Git
_page/docs/ generated pages and legacy URL redirects
_page/data/search.json full-text search index
index.html landing page
robokit/ retargetingkit/ one stub per project page; the directory name is the URL
graspkit/ roboskills/ (roboskills/showcase/ holds the run gallery)
assets/js/site.js nav, copy buttons, code highlighting; every page
assets/js/project.js renders a project page from data/projects.js
assets/js/*.js, assets/css/ each page's script and stylesheet
data/projects.js project page content and themes
data/showcase* RoboSkills showcase runs
data/docs/<kit>.js docs source, one file per kit; read by the build, never served
scripts/ docs importer and builder, site checks, benchmark tools
_page/ the built site (ignored)
```

Each project page is a directory so its URL is just its name —
`openrobokit.com/robokit` — which is what paper and preprint links need.
The local server resolves `/robokit` to `robokit/index.html`.

### Shared chrome

`assets/css/site.css` owns the nav's structure; every colour in it comes from a
custom property the page sets (`--nav-bg`, `--nav-ink`, `--nav-muted`,
`--nav-hover-bg`, `--nav-dot`, `--brand-shadow`, `--menu-bg`, `--menu-line`).
Re-tint the nav by setting those, not by writing new `nav …` rules.

The burger and mobile overlay are always in the DOM but hidden; a page opts in
by unhiding `nav .right button.burger` in its own media query. The landing page
deliberately does not, and so has no mobile menu.
To add a project, copy a stub such as `graspkit/index.html`, change its
`<title>` and `window.RK_PROJECT`, then add the kit to `RK_PROJECTS`,
`RK_THEMES` and `RK_VIDEOS` in `data/projects.js`, to `RK_NAMES` in
`assets/js/site.js`, to the chapters in `assets/js/project-nav.js`, and to
`PUBLIC` in the `Makefile`.

### Adding a project
## Docs

1. Copy an existing stub, e.g. `graspkit/index.html`, changing the `<title>` and
`window.RK_PROJECT`.
2. Add the matching entry to `RK_PROJECTS`, `RK_THEMES` and `RK_VIDEOS` in
`data/projects.js`. A project that rotates multiple hero clips can also add
an `RK_HERO_REELS` entry.
3. Add it to `NAV` in `assets/js/site.js`.

## CI

On pushes to `main`, pull requests, and manual runs, CI runs the tests and
`make check-site`, then uploads `_page/` as a `site` artifact. Only the public
`openrobokit/website` repo publishes that artifact to GitHub Pages, from `main`.

`make check-site` checks local HTML links and assets, documentation anchors,
and search-index coverage. It builds twice and compares every output file,
then verifies that source files have not changed. CI also requires a clean
Git checkout. The workflow still needs RoboKit's asset input provisioned.

Only handwritten pages, assets, scripts, and the documentation corpus are
tracked. Generated HTML, redirects, and the search index live in `_page/`.
The build excludes the corpus, scripts, README, and Makefile from that tree.

## Documentation

Every document is a static page at `/docs/<kit>/<id>/`, built from the
committed corpus. Each kit owns one file, so two projects importing at once
never touch the same path:
Docs are written in each kit's repository (`docs/*.md`, with the sidebar in
`docs/nav.yml`) and imported here:

```shell
make site # build from the corpus
make import PROJECT=robokit SRC=../robokit # re-convert one project
make check-docs PROJECT=robokit SRC=../robokit # fails if it would change
make import PROJECT=robokit SRC=../robokit # or retargetingkit, graspkit
make check-docs PROJECT=robokit SRC=../robokit # fails if an import would change anything
```

`data/docs/<kit>.js` stays the corpus: `scripts/import_docs.py` splices the generated
groups into it, and `scripts/build_docs.py` turns the whole thing into
`_page/docs/<kit>/<id>/index.html` plus `_page/data/search.json`. Importing is
an explicit source update; ordinary builds never rewrite `data/docs/`.

RoboKit's README and overview images have one source: RoboKit's `docs/assets/`.
The importer rewrites image URLs without copying files into this repository.
`make site` bundles the banner, framework, teaser, and six `built-in-tasks/` images
into `_page/assets/docs/robokit/assets/`;
these are generated output and are never committed. Gallery previews, task videos,
and images used only by the website remain under `assets/`.
An import replaces only that kit's generated block in `data/docs/<kit>.js`
and, where a kit has them, its API examples in `data/projects.js`.
`make site` turns the docs source into `_page/docs/<kit>/<id>/` and
`_page/data/search.json`. Edit docs in the kit's repository, not here.

The browser gets no router and no corpus. `assets/js/docs.js` handles only what
needs a live page — syntax highlighting, copy buttons, the scroll-spy rail, the
sidebar folds — and fetches the search index the first time somebody types.

A page selects reference blocks the way mkdocstrings does — a line of
`::: robokit.opt.GDOptimizer` in the Markdown, next to the prose. What gets
published, and in what order, is decided there rather than in a config file
here.

`scripts/md2doc.py` turns such a line into a `<div data-api="...">`
placeholder; `scripts/apimodel.py` reads the name out of the source with
griffe, and `scripts/apihtml.py` fills the placeholder in with the signature
card, parameters and members.

RetargetingKit works the same way: its pages, sidebar order (`docs/nav.yml`),
API reference pages, and device screenshots live in the RetargetingKit repo.
Rebuild them against that checkout:

```shell
make import PROJECT=retargetingkit SRC=../retargetingkit
```
## Publishing

The importer copies the original device screenshots into
`assets/docs/retargetingkit/` and frames the PICO and Vision Pro panels without
changing their pixels. Edit the Markdown in RetargetingKit, never
here. Only `data/docs/retargetingkit.js` is replaced, then the static site is
rebuilt in `_page/`.
CI (`.github/workflows/deploy.yml`) runs the tests and `make check-site` on
every push and pull request. Only the public `openrobokit/website` repository
deploys `main` to GitHub Pages.
Loading
Loading