Skip to content

docs: make the mermaid diagrams readable (#1103) - #1819

Merged
JarryShaw merged 1 commit into
mainfrom
docs/mermaid-readability
Oct 16, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
docs/mermaid-readability

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Description

Refs #1103 (rendered-docs proofread). The user saw tangled, unreadable Mermaid graphs on the docs site.

  • Cause: the sphinxcontrib-mermaid defaults fit every SVG into a fixed 500px box. On the page the protocol hierarchy rendered at 0.14x and the field hierarchy at 0.19x, so text and edges ran together. conf.py now renders each diagram at its natural size, shrunk only to the page width; _static/mermaid.css centres narrow ones.
  • Per graph: protocols, workflows (split into triggers and workflow-to-workflow chain), engines, releasing, registry-protocol and mint-criterion are reordered or restacked to remove crossings. No node is dropped and every edge condition is kept (registry-protocol merges parallel edges into one labelled edge). Mermaid reads labels as Markdown, so _missing_, _member_map_ and __version__ are escaped.
  • Links: click targets were root-absolute and 404 under the site's /PyPCAPKit/ prefix. They are now page-relative, and every local target resolves to a 200 with its anchor present (headless Chrome, served under the prefix).
  • Prose: workflows.rst now states which triggers run each gate-only call. The old "only on the Saturday schedule path" was wrong for Create Release, which runs on a v* tag push. documentation.rst gains the escape and click-target rules.

Rejected on measurement: ELK layout (wider, reorders siblings) and tighter spacing (only 10–15% narrower). Not fixed: a few edges still run under labels in the two workflows graphs (far fewer than before); no variant tried cleared the chain graph's without adding crossings.

Checks: clean -E builds of main and this head give the same warnings by (page, message). tests/project: 950 passed, 1 skipped. test_workflows_at_a_glance_1732.py also passes merged with #1817, which edits that test.

- conf.py: render each diagram at its natural size, shrunk only to the
  page width, and centre one narrower than the page; the plugin default
  fitted every SVG into a fixed 500px box, so tall graphs shrank until
  text and edges ran together
- click targets: page-relative, since the site is served under
  /PyPCAPKit/ and a root-absolute target 404s there
- workflows: split direct triggers from the workflow-to-workflow edges,
  one schedule node per day; say which triggers run each gate-only call
- protocols: declare the layers so ARP --> RARP and Raw --> FTP_DATA no
  longer run through other layers' nodes
- engines, releasing, registry-protocol: stack the subgraphs, and order
  or merge edges so none cross; mint-criterion: LR, monotoneX curves
- escape _missing_, _member_map_ and __version__, which Mermaid read as
  Markdown emphasis
- documentation.rst: direction, escape and click-target rules match

Full clean build: no new warnings; tests/project pass.

Refs #1103
@JarryShaw JarryShaw added docs Pull requests that change documentation only (docs: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 16, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 7b2c6fa77. A Sonnet cross-review (author: Opus) rebuilt the head and served it under /PyPCAPKit/. It then clicked every diagram link in headless Chrome: all land on a 200 or 304 with the anchor present, and the live site confirms the prefix. The rewritten trigger paragraph matches every on: block and gate if: on main. The added CSS only adds mermaid.css, and narrow diagrams are centred. The warning sets are identical and tests/project passes. Non-blocking, deferred to #1103's next round: "runs on both of its triggers" should say "can run", because version_check must pass; adding curve: monotoneX to the trigger graph would clear most of its remaining overlaps.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 16, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 16, 2026
@JarryShaw
JarryShaw merged commit 5bb0819 into main Oct 16, 2026
39 checks passed
@JarryShaw
JarryShaw deleted the docs/mermaid-readability branch October 16, 2026 13:17
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 16, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Pull requests that change documentation only (docs: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant