Skip to content

README: show Mermaid and composition across formats; bring the canvasnet help up to date - #136

Merged
Malcolmnixon merged 4 commits into
mainfrom
docs/readme-showcase-help
Nov 12, 2026
Merged

Malcolmnixon merged 4 commits into
mainfrom
docs/readme-showcase-help

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Pull Request

Description

This refreshes the README images to show the newer features, Mermaid and composition across formats, and corrects the canvasnet help, which had fallen behind several features.

README images (all drawn and CI-checked by docs/images/render-images.ps1 -Check)

  • showcase.png is now a 4x2 grid. It adds a Mermaid panel (a flowchart with a subgraph) and a Composition panel to SVG, OpenSCAD, Vega-Lite, PDF, PowerPoint and Visio.

  • composition.png (new), a "System overview" page drawn from one SVG (docs/images/showcase/composition.svg):

    • a Mermaid flowchart on the page whose nodes show an OpenSCAD model and a Vega-Lite chart (CAD inside Mermaid inside SVG);
    • one OpenSCAD model linked twice with #def.explode=0 and #def.explode=1, with a fixed camera so both share a scale;
    • a Mermaid sequence diagram linked with #theme=dark.

    Each panel prints the link that draws it.

  • mermaid-gallery.png (new): sequence, class, state, gantt, mindmap and git graph in one montage, like the Vega-Lite gallery.

  • README text: a short Composition section (nesting, fragments, a small SVG snippet, and canvasnet flatten for self-contained SVGs). Mermaid is now in the format list.

composition

showcase

mermaid gallery

Help review: every topic, every command's usage text and every example was checked against current behavior, and every example was run with the built tool. Fifteen findings are fixed, each in the help and the matching user-guide text (drift tests enforce that they stay identical):

  • Broken examples: two examples failed because an unquoted # color is read as a shell comment (montage --background #333333, pad --pad-color #336699); both are now quoted.
  • SVG topic:
    • the summary, image size, fragment overrides (--theme), unsupported options, --strict, diagnostics and the folder rule now include Mermaid diagrams;
    • images are read from the SVG's folder and below it.
  • Mermaid and limits topics: pictures can also be <img> tags in labels, and those count toward the picture limit.
  • Vega-Lite topic: an image mark can show a Mermaid diagram.
  • Usage text of render, info and montage: fragments and embedding mention Mermaid and #theme=, and info describes every diagram type's counts.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Requested in review: show composition in the README and keep the tool help up to date. There is no issue to close.

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully and all tests pass: pwsh ./build.ps1. It ran, but 1-3 Scad timing tests failed while another build was running on the same machine. This PR has no Scad changes, and those tests pass when run alone. These ran:
    • dotnet build src/DemaConsulting.CanvasNet.Tool -c Release: 0 warnings, 0 errors
    • dotnet test test/DemaConsulting.CanvasNet.Tool.Tests -c Release: passed (3,660 on net8, net9 and net10, including the help drift tests)
    • pwsh docs/images/render-images.ps1 -Check with the local tool: passed
  • Code produces zero warnings

Code Quality

  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: pwsh ./lint.ps1 passed (exit 0)

Testing

  • Added unit tests for new functionality. Not applicable.
  • Updated existing tests if behavior changed: one example in InputFragmentTests.
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated docs/ documentation (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable). Not applicable: traceability is unchanged.

Additional Notes

The images grow by about 140 KB in total (showcase 270→232 KB, plus composition 166 KB and the Mermaid gallery 111 KB).

Malcolm Nixon and others added 2 commits November 12, 2026 13:09
- Quote the # colors of the montage and pad usage examples, which a shell read as a comment.
- svg topic: Mermaid diagrams and document pages embed, links are read from the folder of the SVG file and
  below it, an input fragment overrides --theme too, and the notes, strict mode, and broken-file errors cover
  embedded diagrams.
- mermaid topic: <img src> in labels, the fragments of a picture link, and the w/h advice; limits topic counts
  <img> tags; vega-lite topic: the image mark can show a Mermaid diagram.
- render, info, and montage usages: Mermaid diagrams and theme fragments, the info fragment rules, and that a
  fragment is the only way to set a chart parameter or a Mermaid theme in a montage.
- User guide: the same statements in the tool, Vega-Lite, and Mermaid guides.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- showcase.png is a 4x2 grid with a Mermaid flowchart panel and a composition panel.
- New composition.png: an SVG page that embeds a Mermaid flowchart whose nodes show an OpenSCAD model and a
  Vega-Lite chart, one OpenSCAD model twice through def. fragments, and a sequence diagram with #theme=dark.
- New mermaid-gallery.png: six Mermaid diagram types from the user guide examples.
- README: new Composition section (nesting, fragments, flatten), Mermaid gallery, and updated captions.
- render-images.ps1 draws and checks the new images; docs/images/README.md describes their sources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 12, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation inaccurately describes MaxImages as a picture count even though the implementation limits resolver calls, so both new explanations need correction.

2 open issues
What changed in this PR

This documentation-focused pull request updates the README and user-facing CanvasNet help to showcase Mermaid rendering and composition across formats, while synchronizing related guides, examples, source fixtures, and image-generation checks.

Changes:

  • Added Mermaid and nested composition examples, source fixtures, and image-generation support.
  • Updated README, CLI help, and user guides for Mermaid embedding, fragments, SVG resolution, limits, diagnostics, and Vega-Lite image marks.
  • Corrected shell-quoting examples and updated help-drift test expectations.
File Description
test/​DemaConsulting.CanvasNet.Tool.Tests/​Commands/​InputFragmentTests.cs Updates help-drift assertions for the revised input-fragment and theme wording.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​RenderCommand.Verbs.cs Quotes the hash-prefixed color in the pad usage example.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​RenderCommand.cs Updates render usage documentation for Mermaid embedding and theme fragments.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​MontageCommand.cs Documents Mermaid fragments and quotes the montage background-color example.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​Help/​vega-lite.json Documents Mermaid diagrams as supported Vega-Lite image marks.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​Help/​svg.json Expands SVG documentation for Mermaid embedding, fragments, folders, diagnostics, and strict mode.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​Help/​mermaid.json Documents Mermaid label images, image fragments, embedded formats, and image limits.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​Help/​limits.json Updates Mermaid picture-limit documentation to include images in labels.
src/​DemaConsulting.CanvasNet.Tool/​Commands/​DiscoveryCommands.cs Updates info usage text for diagram counts and fragment validation.
README.md Adds Mermaid and composition showcases, linked-picture guidance, and flattening documentation.
docs/​user_guide/​canvas-net-vega-lite.md Documents Mermaid diagrams as Vega-Lite image sources.
docs/​user_guide/​canvas-net-tool.md Synchronizes info, Vega-Lite, and montage guidance with current behavior.
docs/​user_guide/​canvas-net-mermaid.md Documents fragments and image-link behavior for Mermaid diagrams.
docs/​images/​showcase/​release.mmd Adds the themed Mermaid sequence diagram used by the composition example.
docs/​images/​showcase/​pipeline.mmd Adds a Mermaid flowchart containing OpenSCAD and Vega-Lite pictures.
docs/​images/​showcase/​output.vl.json Adds the Vega-Lite chart embedded in the Mermaid composition.
docs/​images/​showcase/​flowchart.mmd Adds the Mermaid flowchart used in the showcase.
docs/​images/​showcase/​explode.scad Updates provenance comments for reuse in the composition example.
docs/​images/​showcase/​composition.svg Defines the nested SVG composition of Mermaid, OpenSCAD, Vega-Lite, and other panels.
docs/​images/​render-images.ps1 Generates and checks the expanded showcase, composition image, and Mermaid gallery.
docs/​images/​README.md Documents image sources, dimensions, provenance, and regeneration procedures.

Review effort: Lite

Malcolm Nixon and others added 2 commits November 12, 2026 14:44
…when measured and again when drawn

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 12, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review found no active issues, with the documentation, help text, fixtures, and related expectations updated consistently for the described Mermaid and composition changes.

No open issues 🎉

2 resolved since last review

Review effort: Lite

@Malcolmnixon
Malcolmnixon merged commit 9032d2e into main Nov 12, 2026
16 checks passed
@Malcolmnixon
Malcolmnixon deleted the docs/readme-showcase-help branch November 12, 2026 20:58
This was referenced Nov 16, 2026
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.

2 participants