Skip to content

[repo-assist] docs: describe Literate scripts as a lightweight doc-testing mechanism - #1267

Merged
dsyme merged 4 commits into
mainfrom
repo-assist/docs-literate-doctest-07fcd4fc46b002aa
Sep 8, 2026
Merged

dsyme merged 4 commits into
mainfrom
repo-assist/docs-literate-doctest-07fcd4fc46b002aa

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

What

Adds a short "Using Literate scripts as doc tests" section to docs/literate.fsx, explaining that Literate's --eval execution of embedded F# code (via FSI), combined with (*** include-output ***) / (*** include-value ***), already provides a low-effort form of doc-testing: sample code is executed for real when docs are built, and failures surface immediately rather than silently drifting out of sync with the API.

Why

Issue #1221 asks for the Literate library's doc-testing capability to be given more visibility, since users are often unaware F# has any doc-test-like tool. Documenting this existing behaviour directly in the main literate-scripts reference page is a low-risk, immediately useful first step (as suggested in Repo Assist's earlier comment on that issue), without requiring a new repo/package split, which is a bigger decision for maintainers.

Trade-offs

  • This documents existing behaviour only; no code changes.
  • Does not create a full assertion-based doc-test framework — just clarifies what's already possible.

Test Status

  • dotnet fantomas docs/literate.fsx --check — passes (no formatting issues).
  • dotnet build FSharp.Formatting.sln --configuration Release — succeeded.
  • fsdocs build --clean — succeeded; verified the new section renders correctly in generated literate.html.

Related: #1221

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

Addresses feedback in #1221 by explicitly documenting that Literate's
--eval execution of embedded F# code, combined with (*** include-output ***)
and (*** include-value ***), functions as a low-effort doc-test workflow:
code samples are executed for real and failures surface at build time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
nojaf and others added 3 commits September 8, 2026 16:14
Migrate the fsdocs watch server to Suave 3's Task-based socket API:
the websocket handler and reload broadcast now use ValueTask/Result,
the removed Suave.Logging module is dropped, and the server task from
startWebServerAsync is already hot so it no longer needs Async.Start.

While migrating, fix a crash in watch mode: clients that disconnect
without a close handshake stayed registered, and broadcasting to such
a dead socket throws ObjectDisposedException in Suave 3, killing the
whole watch process. Clients are now deregistered whenever their
connection ends, and the broadcast tolerates stale sockets.

Also in watch mode, the logo now links to the locally hosted site
root instead of the production URL (even when <FsDocsLogoLink> is
set), and the console no longer logs websocket connection chatter on
every page reload. Release builds are unaffected.

Bump Fun.Build from 1.0.4 to 1.1.18 and make build.fsx directly
executable via a dotnet fsi shebang.

Release notes: 22.2.0.
* Move the Mermaid example from docs/sidebyside/sidemermaid.md to
docs/mermaid.md and rewrite it around plain ```mermaid fenced blocks
promoted by a docs/_body.html script, the pattern used by the fantomas
docs. The source now renders on GitHub and the recipe page actually
renders its own diagrams.

* Add Docs pipeline to easily launch documentation locally.
@dsyme
dsyme marked this pull request as ready for review September 8, 2026 09:33
@dsyme
dsyme merged commit a6c3af0 into main Sep 8, 2026
4 checks passed
@dsyme
dsyme deleted the repo-assist/docs-literate-doctest-07fcd4fc46b002aa branch September 8, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants