Repository navigation
docs: move the manual to an mdBook site - #157
Merged
Merged
Conversation
The manual moves to a documentation site on GitHub Pages (https://jonasz-lasut.github.io/function-wasm/), built with mdBook 0.5.4 from docs/ itself: book.toml at the root with src = "docs", so docs/abi-v2.md (named by the runtime's refusal sentence and the conformance goldens) and the one-pagers stay at their paths and are listed from where they are. docs/SUMMARY.md is the table of contents: an introduction group, a Guest authors part, an Operators part, the Contract (ABI v2, Compatibility) and the Project part, whose Design records page lists every one-pager with its status and whose Security policy page includes SECURITY.md in place. docs/theme/wasm.css lays WebAssembly's purple over the built-in light and navy themes through their CSS variables (#654FF0, #8B74FF on dark backgrounds): links, the sidebar's active entry, inline code, blockquote borders, the search highlight and the theme menu's selection; body text and backgrounds stay the themes' own. Colours only, no logo. .github/workflows/docs.yml builds the book on every pull request that touches docs/, book.toml, README.md or SECURITY.md (mdBook from its release tarball, pinned by sha256 like xprin and wkg) and checks every internal link and anchor of the rendered site with lychee in offline mode; a push to main uploads it and deploys with configure-pages, upload-pages-artifact and deploy-pages, all pinned by commit.
Every section of the README is cut into its page verbatim: only the heading levels (a section becomes its page's title), the links the move breaks (README anchors, docs/ and examples/ paths) and a title or lead sentence where a page needs one change. Introduction (the README's top), Use cases and How a request runs; Write a module, Other languages, Module manifests, Render locally and Validate a Composition for guest authors; Install, Input reference, Runtime flags, Operator grant policy, HTTP egress, Readiness and warm-up (the readiness paragraphs that sat under the grant policy), Sizing, Metrics with the gRPC server series, Trust model, Signatures (the cosign half of the trust model) and Troubleshooting (AGENTS.md's list, verbatim) for operators; Compatibility with the deprecation policy under Contract; Development under Project. A rewrite pass comes later; nothing is reworded here.
The README keeps the caution, what function-wasm is and why, the Install snippet, a ten-line Write a module quick start, the scaffold table in its short form, a Documentation section listing the site's pages by absolute URL (so the landing page works from GitHub, mirrors and the Marketplace alike) and three lines of Development. Everything else now lives on the site; the README's own anchors are gone, so its one remaining section link (Compatibility, in the caution) points at the site.
Every pointer into a README section moves to the page that holds it now: AGENTS.md's Key Reference Documents, its Input reference and Compatibility pointers and the Adding-an-Input-Field step name the docs/ pages, its Troubleshooting list (moved verbatim to the operators' page) becomes a two-line pointer, and a Documentation site paragraph says where the book lives, how it is built and that user-facing behaviour is documented in docs/ with the README as the landing page only. The one-pagers' "the README's ..." mentions, input.rs's doc comment on the deprecation policy, the cut-release skill's install snippet list, dashboard-bundle's README and the package's readme annotation follow. docs/abi-v2.md's link to the WIT file and the use-case one-pager's example links become repository URLs, since the rendered site cannot reach files outside docs/.
A reference page for both policy layers, docs/operators/cedar-policy.md, listed after the operator grant policy and linked from that page, the Input reference's compositionPolicy row, the module manifests page and the dialAddress paragraph of HTTP egress: the two layers and how they combine with the manifest, the principal and its attributes, the entity types with their hierarchies, the seven actions with the layer, resource and context each takes, the evaluation rules (the operator layer default-deny with forbid winning, the composition layer default-deny for the module.from fences and scoped default-permit for the sandbox actions), one worked rule per action in the shape authz.rs's tests hold it to, the refusal sentences per layer as admission.rs and from.rs print them, the load-time errors of a dialAddress rule, the startup checks and how function validate exercises a policy. Every claim is from the code; the README never had this page.
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.
The README had become the manual (1,350 lines, about 12,500 words), with every new capability landing as one more paragraph. This moves it to a documentation site on GitHub Pages, built with mdBook from
docs/, and cuts the README down to a landing page. The sections move verbatim; a rewrite pass comes later.Site: https://jonasz-lasut.github.io/function-wasm/ (live after the first push to
mainruns the deploy job).Layout
book.tomlat the root withsrc = "docs", sodocs/abi-v2.md(named by the runtime's refusal sentence, the conformance goldens and code comments) and the one-pagers stay exactly where they are and are listed from there.docs/SUMMARY.md:What moved where
docs/introduction.mddocs/use-cases.mddocs/how-a-request-runs.mddocs/guests/write-a-module.mddocs/guests/other-languages.mddocs/guests/module-manifests.mddocs/guests/render-locally.mddocs/guests/validate.mddocs/operators/install.mddocs/operators/input-reference.mddocs/operators/runtime-flags.mddocs/operators/grant-policy.mddocs/operators/readiness.mddocs/operators/http-egress.mddocs/operators/sizing.mddocs/operators/metrics.mddocs/operators/trust-model.mddocs/operators/signatures.mddocs/operators/troubleshooting.mddocs/contract/compatibility.mddocs/project/development.mdOnly heading levels, the links the move broke (README anchors,
docs/andexamples/paths) and a title or lead sentence where a page needed one changed; each page was diffed against its README range to prove it. Two cuts are at paragraph rather than subsection boundaries, because the paragraphs were misfiled under their headings: the readiness paragraphs out of "Operator grant policy", and the cosign paragraphs out of "Trust model" (the README's own links to them were named "signing"). "HTTP egress" stays whole under Operators: its three numbered parties are one narrative and splitting them would be a rewrite.The README now
162 lines: the caution, three paragraphs on what function-wasm is and why with the Composition example, the Install snippet, a ten-line Write a module quick start, the scaffold table in its short form, a Documentation section listing every page of the site by absolute URL (so the landing page works from GitHub, mirrors and the Marketplace alike), and three lines of Development. Its one remaining section link (Compatibility, in the caution) points at the site.
Workflow and Pages
.github/workflows/docs.yml: on a pull request touchingdocs/**,book.toml,README.mdorSECURITY.md, it builds the book with mdBook 0.5.4 (the release tarball, pinned by sha256 the way xprin and wkg are) and checks every internal link and anchor of the rendered site plus the README's relative links with lychee (lycheeverse/lychee-actionv2.9.0, pinned by commit,--offline --include-fragments); on a push tomainit also uploads the site and deploys it withactions/configure-pages,actions/upload-pages-artifactandactions/deploy-pages, all pinned by commit with the# vX.Y.Zcomment Renovate reads. The job runs read-only; only the deploy job takespages: writeandid-token: write.lychee over mdbook-linkcheck: mdbook-linkcheck has had no release since 2023 and targets mdBook 0.4's renderer API, which 0.5 replaced; lychee is maintained, checks fragments (
--include-fragments, which is what catches a broken anchor after a move), and offline mode keeps the check deterministic. The 404 page is left out: it links by site-url-absolute paths that only exist once deployed.Pages is enabled on the repository for the Actions source (
gh api -X POST .../pages -f build_type=workflowreturnedbuild_type: workflow,html_url: https://jonasz-lasut.github.io/function-wasm/).mdBook: the brief said the latest 0.4.x; 0.4's last release is from 2025 and 0.5 (November 2025) is the current line, so the book is built with 0.5.4 (June 2026). What 0.5 brought that the book uses: GitHub-style admonitions, so the README's
[!CAUTION]block renders as one on the introduction page, and strict config checking, so a typo inbook.tomlfails the build.cargo install mdbook --locked --version 0.5.4locally; the workflow uses the same version from the release tarball.Theme
docs/theme/wasm.css, loaded throughbook.toml'sadditional-css, overrides the CSS variables of the built-in themes with WebAssembly's purple:#654FF0on light backgrounds (default-theme = "light"),#8B74FFon dark ones (preferred-dark-theme = "navy"; coal and ayu take the same accent so switching themes keeps the colour). It colours links, the sidebar's active and hovered entries, the "on this page" border, inline code, blockquote borders, the search highlight, the search bar's focus ring and the theme menu's selection; body text and backgrounds stay the themes' own. Colours only, no logo: the WebAssembly logo is a trademark.Re-pointed references
README.mdentry replaced by thedocs/pages), the Input reference pointer under Key Concepts, the Compatibility pointer under Conformance goldens, step 3 of Adding an Input Field, the Troubleshooting list (now a two-line pointer atdocs/operators/troubleshooting.md), a new "Documentation site" subsection under Development Guide, and abook.toml, docs/SUMMARY.mdentry in the Key Components tree.resource-governance(the sizing table),sandbox(the flags table),language-support(the Other languages page, twice),module-source-schema(the first use case, twice),local-loop(the sizing table),nix-devenv(the "Building" section, five mentions, now the Development page),use-case-examples(the five../examples/links, now repository URLs).docs/abi-v2.md: its link towit/wasmfn-function.witis a repository URL now (the rendered site cannot reach files outsidedocs/); the file's path and the refusal sentence are untouched.crates/function/src/input.rs: the doc comment onAPI_VERSION_V1BETA1namesdocs/contract/compatibility.md..claude/skills/cut-release/SKILL.md: the install snippet to bump is inREADME.mdanddocs/operators/install.md.examples/dashboard-bundle/README.md: "as the function-wasm README shows" links the runtime flags page.package/crossplane.yaml: the package readme annotation links the site and the repository.Verified
mdbook buildclean (no warnings); lychee offline overbook/**/*.htmlandREADME.mdwith fragments: 1,562 links, 0 errors (303 excluded: the remote ones).cargo fmt --all --check,cargo test -p guestfn(scaffold goldens untouched),cargo test -p function-wasm --test conformance(the refusal sentence still namesdocs/abi-v2.mdat its path).Follow-up: the rewrite pass
guestfnreference page (init, build, push, inspect, manifest, scaffold composition): today those paragraphs sit inside "Write a module", which has no subsections to split along.wasmfn.HTTPClient()) and the operator-side page (enablement, the block list, budgets, the audit line).one-pager-nix-devenv.mdandone-pager-language-support.mdrefer to a README "Building" section and adocs/abi.mdthat were already gone; the pointers now name the Development and Other languages pages, the prose around them is as it was.## Licenseline on the README, if wanted: the README never had one, so none was added.Cedar policy reference (fifth commit)
Jonasz's preview found no Cedar policy documentation, so
docs/operators/cedar-policy.mdis new prose (the one page in this PR that is not a verbatim move), listed right after "Operator grant policy" and linked from the grant-policy page, thecompositionPolicyrow of the Input reference, the module manifests page and thedialAddressparagraph of HTTP egress. Every claim is taken fromcrates/function/src/authz.rs(the shared schema, the seven actions,COMPOSITION_ACTIONS,scopes_action, thedialAddresscompiler and its load errors, the unit tests' example set),admission.rsandfrom.rs(the refusal sentences, quoted as printed and cross-checked against the conformance goldens),main.rs(the startupTMPDIRprobe and the--cosign-keywithoutrequireSignaturewarning) andvalidate.rs(exit codes, warnings, the principal from--xr).Headings: The two layers; The principal; Entity types; Actions; How each layer decides (the operator layer, the composition layer); Worked examples (one per action:
pullModule,spendCredential,usePrivateTmp,setEnv,grantEgress,requireSignature,dialAddress); What a refusal says; Load-time errors; Testing a policy; Further reading.One thing the code review turned up in the moved text: the HTTP egress page's
dialAddressexample ("Block an internal range, then open one service inside it": aforbidon10.0.0.0/8and apermiton10.96.0.0/12) does not do what its comment says.Egress::blocked_byjudges an operatorforbidbefore thepermitholes, so the service range stays blocked; thepermitalone would open it, since the default block list already refuses10.0.0.0/8. The Cedar page documents the real precedence with that shape as its worked example; the moved paragraph is left as it was, for the rewrite pass (or a one-line fix here if you prefer).