Skip to content

docs: add a feature carousel to the landing page#157

Open
vito wants to merge 1 commit into
mainfrom
docs-feature-carousel
Open

docs: add a feature carousel to the landing page#157
vito wants to merge 1 commit into
mainfrom
docs-feature-carousel

Conversation

@vito

@vito vito commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Adds a feature carousel to the docs landing page — a quick reel cycling through Dang's distinctive features, inspired by the one on rhombus-lang.org.

What's in it

Seven slides, each a short example shown with its real, build-time-evaluated output:

  • Prototype objectstype declares a type and its constructor
  • Multi-field selection.{{ … }} (against a schema, one query with fields resolved in parallel)
  • Copy-on-write — methods fork the receiver; values never mutate
  • Null trackingString vs String! with flow narrowing
  • Optional parens — fields and zero-arg methods read identically
  • Everything is an expressioncase yields a value
  • Testing built inassert with no framework

Reuse over reinvention

Each slide renders as a regular \dang-literate block, so it reuses the existing snippet template, styling, baked output, and client-side editor — the slides are editable and runnable, and a broken example fails the docs build like any other literate block.

The only evaluation-side change is independence: slides each redeclare their own types, so they can't share the page's literate session. A slide evaluates in its own fresh session and carries data-dang-literate-chain, and playground.js now scopes a literate chain to its nearest such ancestor, defaulting to the whole page (existing pages are unaffected).

carousel.js is pure progressive enhancement — a tab strip of feature names, prev/next controls, and arrow keys — over slides that otherwise stack and read fine without JavaScript.

Notes for review

  • The slide titles are placeholder labels; the real explanations live in code comments, so rename them however reads best.
  • The standalone "edit me" playground still sits right below the carousel — drop it or keep it as the sandbox, your call.

Preview with cd docs && ./build.sh -s 3001.

Add a carousel to the docs landing page that cycles through short,
distinctive-feature examples — prototype objects, multi-field selection,
copy-on-write, null tracking, optional parens, expression-oriented case,
and built-in assert — inspired by the feature reel on rhombus-lang.org.

Each slide renders as a regular \dang-literate block, so it reuses the
existing snippet template, styling, baked build-time output, and
client-side editor rather than introducing a parallel mechanism. Slides
must stay independent — each redeclares its own types — so a slide
evaluates in its own fresh session and carries data-dang-literate-chain;
playground.js now scopes a literate chain to its nearest such ancestor,
defaulting to the whole page as before.

carousel.js is progressive enhancement only: a tab strip, prev/next
controls, and arrow keys over the slides, which otherwise stack and read
fine without JavaScript.

Signed-off-by: Alex Suraci <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying dang with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6f2cc2a
Status: ✅  Deploy successful!
Preview URL: https://e67a201d.dang-3kk.pages.dev
Branch Preview URL: https://docs-feature-carousel.dang-3kk.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant