Skip to content

docs: convert ASCII diagrams to Mermaid with dark-theme colors#138

Merged
unclesp1d3r merged 2 commits into
mainfrom
docs_tweaks
Mar 2, 2026
Merged

docs: convert ASCII diagrams to Mermaid with dark-theme colors#138
unclesp1d3r merged 2 commits into
mainfrom
docs_tweaks

Conversation

@unclesp1d3r
Copy link
Copy Markdown
Member

Summary

  • Convert ASCII art trust boundary diagram in security-assurance.md to Mermaid with proper untrusted/trusted zone styling
  • Convert ASCII art conversion pipeline diagrams in output.md to Mermaid flowcharts
  • Fix Mermaid syntax error in architecture.md hierarchical rule processing diagram (> in node labels broke rendering)
  • Replace all light pastel fill colors across 5 diagrams in architecture.md and 1 in security-assurance.md with dark-theme-compatible fills and light text
  • Update output.md references from evaluator::MatchResult to evaluator::RuleMatch

Test plan

  • mdbook build completes without errors
  • All Mermaid diagrams render correctly in the navy (dark) theme
  • No broken > characters in node labels
  • Text is readable against dark background fills

🤖 Generated with Claude Code

Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Signed-off-by: UncleSp1d3r <unclesp1d3r@evilbitlabs.io>
Copilot AI review requested due to automatic review settings March 2, 2026 06:19
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 2, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8a8f6a1 and 0c581ec.

📒 Files selected for processing (3)
  • docs/src/architecture.md
  • docs/src/output.md
  • docs/src/security-assurance.md

Summary by CodeRabbit

  • Documentation
    • Enhanced architecture diagrams with improved visual styling and clearer formatting for better readability.
    • Updated documentation to reflect consistent API terminology across output documentation.
    • Improved security documentation with modern visualization for trust boundary representation.

Walkthrough

Documentation updates across three markdown files: enriched Mermaid diagram styling in architecture.md, corrected type naming from MatchResult to RuleMatch in output.md, and replaced ASCII Trust Boundaries diagram with Mermaid flowchart in security-assurance.md.

Changes

Cohort / File(s) Summary
Diagram Styling & Visualization
docs/src/architecture.md, docs/src/security-assurance.md
Enhanced Mermaid diagram styling with richer colors (fill, stroke, text) and updated node label representations; replaced ASCII diagram with Mermaid flowchart for Trust Boundaries visualization.
Type Naming Corrections
docs/src/output.md
Updated documentation terminology from MatchResult to RuleMatch across descriptions, diagrams, and example blocks to reflect evaluator-level type naming.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • libmagic-rs#33: Modifies the same documentation files and addresses related type naming changes (MatchResult vs. RuleMatch terminology).

Suggested labels

documentation, lgtm

Poem

🐰 Diagrams dance in colors bright,
Types renamed to fit just right,
Mermaid flows where ASCII stood,
Docs refined as they should!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs_tweaks

Comment @coderabbitai help to get the list of available commands and usage tips.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 2, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟠 CI must pass

Waiting checks: coverage, test, test-cross-platform (macos-latest, macOS), test-cross-platform (ubuntu-22.04, Linux), test-cross-platform (ubuntu-latest, Linux), test-cross-platform (windows-latest, Windows).

All CI checks must pass. Release-plz PRs are exempt because they only bump versions and changelogs (code was already tested on main), and GITHUB_TOKEN-triggered force-pushes suppress CI.

  • check-success = coverage
  • check-success = test
  • check-success = test-cross-platform (macos-latest, macOS)
  • check-success = test-cross-platform (ubuntu-22.04, Linux)
  • check-success = test-cross-platform (ubuntu-latest, Linux)
  • check-success = test-cross-platform (windows-latest, Windows)
  • check-success = quality

🟢 Do not merge outdated PRs

Wonderful, this rule succeeded.

Make sure PRs are within 10 commits of the base branch before merging

  • #commits-behind <= 3

@dosubot
Copy link
Copy Markdown
Contributor

dosubot Bot commented Mar 2, 2026

Related Documentation

Checked 29 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@unclesp1d3r unclesp1d3r self-assigned this Mar 2, 2026
@dosubot dosubot Bot added the documentation Improvements or additions to documentation label Mar 2, 2026
@unclesp1d3r unclesp1d3r enabled auto-merge (squash) March 2, 2026 06:21
@unclesp1d3r unclesp1d3r disabled auto-merge March 2, 2026 06:21
@unclesp1d3r unclesp1d3r merged commit 762fbc1 into main Mar 2, 2026
25 of 27 checks passed
@unclesp1d3r unclesp1d3r deleted the docs_tweaks branch March 2, 2026 06:21
@coderabbitai coderabbitai Bot added the lgtm Approved for the merge queue label Mar 2, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the project documentation to replace ASCII diagrams with Mermaid diagrams and adjusts Mermaid styling to be readable in dark themes, while also aligning some docs with updated evaluator type naming.

Changes:

  • Converted ASCII trust-boundary and output conversion pipeline diagrams to Mermaid flowcharts.
  • Updated Mermaid diagram styling (fills/strokes/text colors) to be dark-theme compatible.
  • Updated output.md references from evaluator::MatchResult to evaluator::RuleMatch.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/src/security-assurance.md Replaces the trust boundary ASCII diagram with a Mermaid diagram and adds dark-theme styling.
docs/src/output.md Updates evaluator type references and replaces ASCII pipeline diagrams with Mermaid flowcharts.
docs/src/architecture.md Updates Mermaid diagram styling to dark-theme colors and adjusts hierarchical processing diagram labels.

Comment thread docs/src/architecture.md
Comment on lines +242 to +243
R -->|match| C1["Child Rule 1<br/>e.g., #gt;4 ubyte 0x14"]
R -->|match| C2["Child Rule 2<br/>e.g., #gt;4 ubyte 0x06"]
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

#gt; is not a valid HTML escape for > and will render literally in the node labels. If the goal is to avoid Mermaid/Markdown parsing issues with >, use &gt; (or remove the > from the label text) so the diagram renders correctly and matches the PR’s intent of fixing the >-related syntax issue.

Suggested change
R -->|match| C1["Child Rule 1<br/>e.g., #gt;4 ubyte 0x14"]
R -->|match| C2["Child Rule 2<br/>e.g., #gt;4 ubyte 0x06"]
R -->|match| C1["Child Rule 1<br/>e.g., &gt;4 ubyte 0x14"]
R -->|match| C2["Child Rule 2<br/>e.g., &gt;4 ubyte 0x06"]

Copilot uses AI. Check for mistakes.
Comment on lines +56 to +73
subgraph libmagic-rs["libmagic-rs (Trusted Zone)"]
IO["I/O Layer<br/>mmap files, size limits"]
CLI["CLI<br/>clap args, validates paths"]
P["Parser<br/>validates magic syntax"]
E["Evaluator<br/>bounds-checks all access"]
O["Output<br/>formats results"]
end

IF -- "file bytes" --> IO
MF -- "magic syntax" --> P
CA -- "user paths" --> CLI
IO -- "mapped buffer" --> E
CLI -- "validated paths" --> IO
P -- "validated AST" --> E
E -- "match results" --> O

style Untrusted fill:#4a1a1a,stroke:#ef5350,color:#e0e0e0,stroke-width:2px
style libmagic-rs fill:#1b3d1b,stroke:#66bb6a,color:#e0e0e0,stroke-width:2px
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

In Mermaid flowcharts, subgraph identifiers should be simple IDs (typically alphanumeric/underscore). Using libmagic-rs as the subgraph ID risks being parsed incorrectly because of the -, and it’s also referenced in the style directive. Rename the subgraph ID to something like libmagic_rs (and update the corresponding style line) while keeping the displayed label as "libmagic-rs (Trusted Zone)".

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lgtm Approved for the merge queue size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants