Repository navigation
docs: rewrite /collections in literate style - #129
Merged
Merged
Conversation
The collections page was the strongest candidate for the literate treatment already applied to /blocks, /control-flow, and /errors: it was the largest page with zero runnable examples, yet every list and map operation produces a concrete result that the live-environment format is built to show. It is also cross-referenced as [#collections] from all three literate pages, so it now reads like its neighbors. Adds \literate-fences and converts the flat API bullet lists into prose alternating with runnable dang blocks that share one environment — fruits, nums, and roles are bound once and reused notebook-style. Each result is baked in and build-verified, including three dang-failure blocks that pin the constraints worth showing: a non-Int list index, a map's homogeneous value type, and elements with no common type. Both Meta notes are preserved verbatim. Signed-off-by: Alex Suraci <[email protected]>
Deploying dang with
|
| Latest commit: |
11d13ac
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://70e89e61.dang-3kk.pages.dev |
| Branch Preview URL: | https://literate-page-rewrite.dang-3kk.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs feedback
A reader asked: "What page would benefit most from being rewritten in literate programming style like blocks, control flow and errors? Do that one."
The pick:
/collectionsSurveying the docs,
/collectionswas the standout candidate. It was the largest page with zero runnable examples, yet it's entirely about operations that produce concrete results — exactly what the live, shared-environment literate format (already on/blocks,/control-flow,/errors) is built to show. It's also cross-referenced as[#collections]from all three literate pages, so it now reads like its neighbors instead of a flat API dump./strings's Meta note explicitly says not to be exhaustive, and/nullability's flow-narrowing is a compile-time property that runtime results don't illustrate well — so neither fit as cleanly.The change
\literate-fencesand converts the bullet-list API reference into prose alternating with runnabledangblocks.fruits,nums, androlesare bound once and reused notebook-style down the page.dang-failureblocks pin the constraints worth showing: a non-Intlist index, a map's homogeneous value type, and a list with no common element type.> Meta:notes are preserved verbatim.Verified by replaying the exact block sequence through the docs build's own
literateEval/literateFailEvalpath, and by a full./docs/build.shbooklit render (collections.htmlbuilds clean with all values baked in). Snippets aredang fmt-clean.🤖 Generated with Claude Code