Skip to content

Improve Mermaid setup - #1274

Merged
nojaf merged 2 commits into
fsprojects:mainfrom
nojaf:better-mermaid
Aug 31, 2026
Merged

nojaf merged 2 commits into
fsprojects:mainfrom
nojaf:better-mermaid

Conversation

@nojaf

@nojaf nojaf commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

List advice guidance to support 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.

nojaf added 2 commits August 31, 2026 14:51
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.
@nojaf

nojaf commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

/repo-assist review

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

✓ Repo Assist completed successfully, see workflow run.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated response from Repo Assist.

Reviewed this PR as requested. The approach is solid:

  • docs/_body.html correctly targets code[lang="mermaid"] (matching how Transformations.fs emits <code lang=""> for fenced code blocks), replaces the closest table.pre/pre wrapper, and uses textContent (not innerHTML) to un-escape the HTML-encoded arrows before mermaid parses them — this is the key detail that makes the pattern work.
  • Plain ```mermaid fences now render natively on GitHub and via fsdocs, which is a nice portability win over the old raw <div class="mermaid"> approach.
  • CSS addition centers SVG output cleanly; RELEASE_NOTES.md is updated under [Unreleased]; the old docs/sidebyside/sidemermaid.md is removed and its .sln folder entry replaced correctly.
  • CI (build ubuntu/windows, Ionide analyzers) is green.

No issues found. One minor, non-blocking thought for follow-up: the CDN import in _body.html has no integrity/fallback if jsdelivr is unreachable, but that mirrors the previous setup and is out of scope here.

Looks good to merge from an automated review perspective — final call left to human maintainers as always.

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

@nojaf
nojaf merged commit dc03e8d into fsprojects:main Aug 31, 2026
11 checks passed
dsyme pushed a commit that referenced this pull request Sep 8, 2026
* 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 pushed a commit that referenced this pull request Sep 8, 2026
* 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 pushed a commit that referenced this pull request Sep 8, 2026
* 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 added a commit that referenced this pull request Sep 8, 2026
…in HtmlFormatting (#1271)

* perf: avoid sprintf overhead for no-arg format strings in HtmlFormatting

Replace sprintf "<pre><code>" with a plain string literal in three
call sites within the hot code/output block rendering path. sprintf
with zero format specifiers still incurs printf-format parsing
overhead on every call; a plain literal avoids that with no behavior
change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Bump Suave from 2.6.2 to 3.4.6 (#1272)

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.

* Improve Mermaid setup (#1274)

* 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.

* perf: avoid sprintf overhead for no-arg format strings in HtmlFormatting

Replace sprintf "<pre><code>" with a plain string literal in three
call sites within the hot code/output block rendering path. sprintf
with zero format specifiers still incurs printf-format parsing
overhead on every call; a plain literal avoids that with no behavior
change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Don Syme <dsyme@github.com>
dsyme added a commit that referenced this pull request Sep 8, 2026
…sting mechanism (#1267)

* docs: describe Literate scripts as a lightweight doc-testing mechanism

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>

* Bump Suave from 2.6.2 to 3.4.6 (#1272)

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.

* Improve Mermaid setup (#1274)

* 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.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Don Syme <dsyme@github.com>
dsyme added a commit that referenced this pull request Sep 8, 2026
…1264)

* Add support for top-level <seealso> XML doc tags in API docs

Renders a 'See also' section (list of links) for members and entities
that have top-level <seealso cref="..."/> XML doc tags, per the
xmldoc recommended-tags convention. Previously these tags were
silently ignored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Document agentic contribution workflow (#1266)

* Bump Suave from 2.6.2 to 3.4.6 (#1272)

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.

* Improve Mermaid setup (#1274)

* 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.

* Add support for top-level <seealso> XML doc tags in API docs

Renders a 'See also' section (list of links) for members and entities
that have top-level <seealso cref="..."/> XML doc tags, per the
xmldoc recommended-tags convention. Previously these tags were
silently ignored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
Co-authored-by: Don Syme <dsyme@github.com>
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