Skip to content

docs: restructure the guide into six parts - #112

Merged
vito merged 10 commits into
mainfrom
docs-content-restructure
Jun 11, 2026
Merged

vito merged 10 commits into
mainfrom
docs-content-restructure

Conversation

@vito

@vito vito commented Jun 11, 2026 •

Copy link
Copy Markdown
Owner

Restructures the docs from 26 flat top-level chapters into Getting started + 5 parts / 23 chapters, per the discussion about the landing page betraying the "small, easy-to-learn language" pitch. Since we're in early draft phase, URLs were freely broken in favor of the best end-state names. Rebased on main (theme-rotation work).

Structure

  1. Getting started — top-level front door (install · hello world · first GraphQL call · Dagger module)
  2. The language — Design philosophy · Syntax and literals · Operators · Fields and functions · Blocks · Control flow · Errors
  3. Types — Types and nullability · Objects · Mutation and copy-on-write · Interfaces and unions · Enums and scalars
  4. GraphQL — GraphQL interop · GitHub playground · Modules and imports · Directives
  5. Data — Collections · Strings · JSON and YAML
  6. Reference — Standard library · Grammar notes · CLI

Each part is a stub page with a framing intro and its own contents block; the lit/ tree mirrors the parts. The part slugs took #types and #graphql, so those chapters were renamed to #nullability and #interop (all refs updated). The GitHub playground lives under the GraphQL part, retitled "GitHub playground". The former "Language overview" chapter dissolved into The language part: a single "Design philosophy" chapter (principles → "Deliberately missing" → "The philosophy, applied", carrying the distinctives) leads the part, and the "how a program is shaped" bullets folded into Syntax's file-layout section, which they near-duplicated.

Mergers (the artificial seams)

  • Literals → Syntax and literals — backtick template behavior was documented twice; the three string flavors now sit side by side.
  • Flow-typing → Types and nullability — narrowing is the second half of the nullability story; the #flow-typing anchor is preserved as a section.
  • Fields + Functions → Fields and functions — a zero-arity function is a field; #fields/#functions anchors preserved as sections; docstrings and forward references stated once.

Mutation, Blocks, and Errors deliberately stay as their own pages — each is one mental-model lesson with a linkable URL.

Duplication ownership fixes

  • Inline fragments: GraphQL interop owns the full treatment (unique details from Interfaces and unions moved there); Interfaces and unions keeps a one-example pointer.
  • break/continue: Control flow owns the spec; Blocks keeps only the block-specific wrinkles (return unwinding, expired blocks).

Rendering

  • The sidebar groups chapters under part headers (which link to the part stubs); non-split top-level entries like Getting started render as a bare header link.
  • The landing TOC's two levels now mean parts + chapters — six rows, with Getting started's sections as its row's run.
  • All Meta notes preserved through the moves; part stubs got their own.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Deploying dang with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7e6fca0
Status: ✅  Deploy successful!
Preview URL: https://dfae0651.dang-3kk.pages.dev
Branch Preview URL: https://docs-content-restructure.dang-3kk.pages.dev

View logs

vito added 7 commits June 11, 2026 17:18
The guide was 26 flat top-level chapters mixing three altitudes —
mental-model pages, topic pages, and pure reference — which made a
small language look sprawling. Nest the chapters under six parts that
teach the shape of the language by themselves: Start, The language,
Types, GraphQL, Data, and Reference. Each part is a stub page with a
framing sentence and a contents block; lit/ directories mirror the
parts.

The part slugs take #types and #graphql, so those chapters are renamed
to #nullability and #interop (refs updated). The landing TOC already
renders two levels, which now means parts and chapters; the sidebar
gains part group headers that link to the stub pages.

Signed-off-by: Alex Suraci <[email protected]>
Backtick template behavior was documented twice — once as lexer-mode
notes in Syntax, once as a literal kind in Literals — and the two
pages were each too small to stand alone. Fold the literal kinds into
Syntax as a "Literals" section (keeping the #literals anchor), with
the three string flavors presented side by side and the backtick
details stated once.

Signed-off-by: Alex Suraci <[email protected]>
Flow-sensitive narrowing is the second half of the nullability story:
the type system tracks null in the types, and narrowing is how code
discharges it without casts. Fold the flow-typing chapter into Types
and nullability as a "Flow-sensitive narrowing" section, placed right
after null propagation so the null story reads start to finish. The
#flow-typing anchor moves to the section, so existing references keep
resolving.

Signed-off-by: Alex Suraci <[email protected]>
The two chapters were already entangled: a zero-arity function is a
field with a body, the declaration-by-shape rule defines both, and
each page deferred to the other for half its story. Merge them into
"Fields and functions" — the field concept and shape rule first, then
the function-specific material (zero-arity, arguments and defaults,
&fn references). The #fields and #functions anchors move to sections,
so existing references keep resolving. Docstrings and forward
references, which applied to both, are now stated once.

Signed-off-by: Alex Suraci <[email protected]>
Inline fragments had two substantial near-duplicate treatments, one in
Interfaces and unions and one in GraphQL interop. They are selection
syntax, so GraphQL interop now owns the full coverage — the unique
details from the interfaces chapter (unselected-field compile error,
type conditions resolving against the schema, nesting, the lazy-form
specifics) move there — and Interfaces and unions keeps a one-example
pointer.

Signed-off-by: Alex Suraci <[email protected]>
The full break/continue semantics were specified twice, in Blocks and
in Control flow. Control flow already owned the canonical version
(targets, yielded values, .map/.each behavior, typecheck errors), so
trim the Blocks "control-flow handoff" section to the block-specific
wrinkles — return unwinding the enclosing function, nested functions
not inheriting the target, and expired-block errors — with a pointer
for the rest.

Signed-off-by: Alex Suraci <[email protected]>
The playground page sat at the top level even though it exists to demo
GraphQL interop. Move it under the GraphQL part as its own chapter,
retitled from "GraphQL + Dang playground" to "GitHub playground" now
that the part name carries the GraphQL context, and mention the live
playground in the part's framing.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the docs-content-restructure branch from 11e9df5 to 887b140 Compare June 11, 2026 17:19
vito added 3 commits June 11, 2026 17:37
A two-chapter part was structural overhead: Getting started is the
front door and reads better as the first top-level entry, and the
mental-model overview is a natural opener for The language rather
than a chapter of its own. Getting started moves back to the top
level; the overview content becomes the body of The language part
page (as bold lead-ins, since headings on a split-sections page would
split into their own pages). The sidebar now renders non-split
top-level entries as a bare header link, and the [#overview] ref in
Getting started points at [#language].

Signed-off-by: Alex Suraci <[email protected]>
The overview content sat on The language part page as bold lead-ins —
an awkward middle ground between prose and structure. Promote it to
two proper leading chapters: "Design philosophy" (which also absorbs
the deliberate omissions — what the language refuses to have is
philosophy too) and "What's distinctive" (which gains the built-in
assert bullet and the runtime-model Meta). The "how a program is
shaped" bullets near-duplicated Syntax's file-layout section, so they
fold in there. The sections are include files rather than body
headings because an include-section call after a markdown heading
nests under that heading.

Signed-off-by: Alex Suraci <[email protected]>
"What's distinctive" was weird as a standalone chapter — the
distinctives are downstream of the philosophy, not a separate topic.
Fold it into Design philosophy so the page reads as one arc:
principles, then "Deliberately missing" (what they rule out), then
"The philosophy, applied" (what they produce — the distinctives list,
each bullet linking to the chapter that owns it).

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito merged commit f5b8b23 into main Jun 11, 2026
8 checks passed
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