-
Notifications
You must be signed in to change notification settings - Fork 2
Feature render mermaid diagrams in sphinx docs as GFM does #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Changes in file docs/conf.py: * enabled mermaid zoom by default * possible improvement for mermaid theme * added some docstrings to linkcode_resolve * other minor changes
…(- WIP #413 -) Changes in file docs/CI.md: * updated theme for diagrams for darkmode Changes in file docs/Testing.md: * updated theme for diagrams for darkmode Changes in file docs/conf.py: * fix for regression caused by last set of changes to docstrings
Changes in file .github/workflows/Tests.yml: * minor hotfix for coverage testing to use bash shell
Changes in file README.md: * fixed an overlooked typo Changes in file docs/CI.md: * fixed an overlooked typo Changes in file docs/conf.py: * minor debugging of new doctests
Changes in file docs/conf.py: * fixed so linkcode_resolve doctests now pass
WalkthroughThis change updates documentation and CI configuration to improve Mermaid diagram rendering in Sphinx-generated docs, corrects a typo in the README, and specifies the shell for a test coverage step in the GitHub Actions workflow. It also adds the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Sphinx
participant MermaidPlugin
User->>Sphinx: Build documentation
Sphinx->>MermaidPlugin: Render mermaid code-blocks
MermaidPlugin-->>Sphinx: Return diagrams with dark theme
Sphinx-->>User: Serve rendered documentation
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Suggested labels
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (4)`README.md`: 1. Consider the file 'README.md' the overview/introduction of the project. Also consider the 'README.md' file the first place to look for project documentation. 2. ...
`tests/*`: When reviewing **test** code: 1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do ...
`**/*.py`: When reviewing **Python** code for this project: 1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the pr...
`docs/*`: When a project contains a `docs/` directory: 1. Consider the files in the `docs/` directory tree the core/main/in-depth documentation of the project. Also consider the...
🧠 Learnings (2)📓 Common learnings
docs/conf.py (14)
🪛 Pylint (3.3.7)docs/conf.py[convention] 301-301: Constant name "mermaid_d3_zoom" doesn't conform to UPPER_CASE naming style (C0103) [warning] 458-458: Bad indentation. Found 1 spaces, expected 4 (W0311) 🪛 ast-grep (0.38.1)docs/conf.py[hint] 497-497: Consider adding a trailing comma. (python-rule-add-trailing-comma) ⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Here's the code health analysis summary for commits Analysis Summary
Code Coverage Report
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #426 +/- ##
=========================================
Coverage 95.056% 95.056%
=========================================
Files 26 26
Lines 2144 2144
Branches 131 131
=========================================
Hits 2038 2038
Misses 66 66
Partials 40 40
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/Tests.yml
(1 hunks)README.md
(1 hunks)docs/CI.md
(6 hunks)docs/Testing.md
(3 hunks)docs/conf.py
(5 hunks)docs/requirements.txt
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
`docs/*`: When a project contains a `docs/` directory: 1. Consider the files in the `docs/` directory tree the core/main/in-depth documentation of the project. Also consider the...
docs/*
: When a project contains adocs/
directory: 1. Consider the files in thedocs/
directory tree the core/main/in-depth documentation
of the project. Also consider the 'docs/**.md' files the second place to look for
project documentation after the 'README.md' file.
2. When reviewing the documentation files (e.g.,docs/**.md
), they should additionally
be linted with help from the toolmarkdownlint
, pointing out any issues.
3. When reviewing the documentation files indocs/
directory, they should additionally
be linted with help from the toollanguagetool
, pointing out any issues.
docs/requirements.txt
docs/Testing.md
docs/CI.md
docs/conf.py
`README.md`: 1. Consider the file 'README.md' the overview/introduction of the project. Also consider the 'README.md' file the first place to look for project documentation. 2. ...
README.md
: 1. Consider the file 'README.md' the overview/introduction of the project.
Also consider the 'README.md' file the first place to look for project documentation.
2. When reviewing the file 'README.md' it should be linted with help
from the toolsmarkdownlint
andlanguagetool
, pointing out any issues.
3. You may assume the file 'README.md' will contain GitHub flavor Markdown. 4. The fileREADME.md
contains many links to additional valuable project documentation. 5. Ensure the README is kept current.
README.md
`**/*.py`: When reviewing **Python** code for this project: 1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the pr...
**/*.py
: When reviewing Python code for this project: 1. Prioritize portability over clarity, especially when dealing with cross-Python
compatibility. However, with the priority in mind, do still consider improvements to
clarity when relevant.
2. As a general guideline, consider the code style advocated in the PEP 8 standard
(excluding the use of spaces for indentation) and evaluate suggested changes for code
style compliance.
3. As a style convention, consider the code style advocated in
CEP-8
and evaluate suggested changes for code style compliance.
4. As a general guideline, try to provide any relevant, official, and supporting
documentation links to any tool's suggestions in review comments. This guideline is
important for posterity.
5. As a general rule, undocumented function definitions and class definitions in the
project's Python code are assumed incomplete. Please consider suggesting a short
summary of the code for any of these incomplete definitions as docstrings when
reviewing. All documentation including docstrings in the project are to align with
the guidelines set by
CEP-7.
6. Verify Flake8's configuration file is located at ".flake8.ini". Flake8 is run
automaticly by theflake8-cq
GHA used by the.github/workflows/flake8.yml
workflow.
7. Verify alignment of any new changes, with the code style advocated in
CEP-8,
pointing out any introduced deviations.
docs/conf.py
`.github/**`: * When the project is hosted on GitHub: All GitHub-specific configurations, templates, and tools should be found in the '.github' directory tree. * 'actionlint' err...
.github/**
: * When the project is hosted on GitHub: All GitHub-specific configurations, templates,
and tools should be found in the '.github' directory tree.
- 'actionlint' erroneously generates false positives when dealing with
GitHub's${{ ... }}
syntax in conditionals.- 'actionlint' erroneously generates incorrect solutions when suggesting the removal of
valid${{ ... }}
syntax.
.github/workflows/Tests.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#424
File: docs/Testing.md:308-312
Timestamp: 2025-05-27T22:39:32.660Z
Learning: Reactive-firewall prefers to maintain documentation formatting that preserves paragraph structure and readability over strict style rules, particularly when line length constraints and the intent of content organization (like maintaining single paragraph flow) are factors, indicating a preference for practical readability over cosmetic formatting adjustments.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#115
File: multicast/hear.py:180-180
Timestamp: 2024-09-19T03:43:24.037Z
Learning: Reactive-firewall prefers to re-use already loaded modules to keep memory overhead low when possible.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#115
File: multicast/hear.py:180-180
Timestamp: 2024-10-08T21:59:30.537Z
Learning: Reactive-firewall prefers to re-use already loaded modules to keep memory overhead low when possible.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#415
File: .github/AI_USAGE_POLICY.md:32-34
Timestamp: 2025-05-25T21:33:32.345Z
Learning: Reactive-firewall prefers to maintain existing documentation style and wording in policy documents, declining stylistic refinements when the current text is functional, indicating a preference for stability over cosmetic improvements in documentation.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#379
File: .ast-grep/utils/python/structure/multicast-mtool-subclass-definitions/undecorated_function_definition.yml:8-12
Timestamp: 2025-04-23T04:07:24.393Z
Learning: Reactive-firewall follows the "Avoid Hasty Abstraction" principle, being cautious about changes that might introduce unnecessary abstractions or alter existing behavior, particularly in configuration files like ast-grep rule definitions.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#139
File: tests/test_fuzz.py:73-73
Timestamp: 2024-10-08T21:59:27.171Z
Learning: Reactive-firewall prefers not to introduce new dependencies into the codebase when writing test functions.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#402
File: .github/actions/setup-py-reqs/action.yml:79-85
Timestamp: 2025-05-17T02:33:33.421Z
Learning: Reactive-firewall prefers to maintain the original structure of conditional statements when fixing logic errors in GitHub Action YAML files, and relies on environment variables with proper defaults rather than dynamic fallbacks when handling input parameters.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#420
File: docs/CI.md:445-447
Timestamp: 2025-05-27T04:12:39.228Z
Learning: Reactive-firewall prefers to maintain intentional wording choices in documentation even when automated grammar tools suggest changes, indicating a preference for preserving deliberate stylistic decisions over automated corrections.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#235
File: .github/workflows/makefile-lint.yml:41-52
Timestamp: 2024-12-06T08:21:21.876Z
Learning: Reactive-firewall prefers to suppress errors in `apt-get install` commands when individual checks of the installed packages are performed afterwards, to allow for more granular error handling.
Learnt from: reactive-firewall
PR: reactive-firewall/multicast#118
File: tests/check_pip:92-197
Timestamp: 2024-10-08T21:59:30.537Z
Learning: Reactive-firewall prefers defining functions before they are called in Bash scripts to avoid errors due to Bash's sequential interpretation.
🪛 LanguageTool
README.md
[uncategorized] ~151-~151: A comma might be missing here.
Context: ... on what needs to be done with received data each case will be a bit different. ```...
(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)
🪛 Pylint (3.3.7)
docs/conf.py
[convention] 301-301: Constant name "mermaid_d3_zoom" doesn't conform to UPPER_CASE naming style
(C0103)
[warning] 458-458: Bad indentation. Found 1 spaces, expected 4
(W0311)
🪛 ast-grep (0.38.1)
docs/conf.py
[hint] 497-497: Consider adding a trailing comma.
Context: str
Suggested replacement: str,
(python-rule-add-trailing-comma)
🔇 Additional comments (10)
docs/requirements.txt (1)
53-54
: Addedsphinxcontrib-mermaid
for Mermaid support
The new dependency aligns with the updated Sphinx configuration indocs/conf.py
and enables Mermaid diagram rendering in the documentation.docs/Testing.md (3)
201-201
: Verify Mermaid init block consistency
Confirm that the%%{ init: { … } }%%
directive before thesequenceDiagram
is identical to the other Mermaid init blocks to avoid styling drift.
325-325
: Verify Mermaid init block consistency
Double-check that the init directive preceding the coverage sequence diagram is the same as in other sections so all diagrams share the same dark-theme settings.
107-107
:✅ Verification successful
Verify Mermaid init block consistency
Ensure the initialization directive (%%{ init: { … } }%%
) for the dark-themed graph matches the one indocs/CI.md
(braces, spacing, themeVariables) to maintain uniform styling across all Mermaid diagrams.Run this to diff the init blocks:
🏁 Script executed:
#!/bin/bash rg "%%\{[[:space:]]*init:" -n docs/CI.md docs/Testing.mdLength of output: 2261
No inconsistencies found in Mermaid init blocks
The dark-theme%%{ init: … }%%
directives in docs/Testing.md (line 107) and docs/CI.md (line 75) are identical. No changes needed..github/workflows/Tests.yml (1)
216-221
: Explicitly set shell to bash for coverage step
Specifyingshell: bash
and switching to a multi-linerun
block improves readability and ensures consistent execution across different runner environments.docs/CI.md (2)
75-75
: Excellent consistency in Mermaid theme configuration.The dark theme initialization directives are consistently applied across all Mermaid diagrams, ensuring uniform visual styling that aligns with the project's documentation theme. The configuration properly sets up dark mode with transparent background and orange accent colors.
Also applies to: 152-152, 198-198, 375-375, 477-477
350-350
: Good catch on the typo fix.Correcting "GitHub Anotated Messages" to "GitHub Annotated Messages" improves the documentation accuracy.
docs/conf.py (3)
80-80
: Good addition of Mermaid extension support.Adding
sphinxcontrib.mermaid
extension properly enables Mermaid diagram rendering in Sphinx documentation, aligning with the PR objectives.
106-106
: Appropriate file format extension.Adding TOML file support enhances the documentation's ability to include configuration files.
201-201
: Sensible syntax highlighting configuration.Applying YAML-style highlighting to INI files provides consistent formatting for configuration file types.
Changes in file README.md: * added missing comma Changes in file docs/conf.py: * "selectively" fixed a typo * Preserved the existing tab indentation as required by [CEP-8](https://gist.github.com/reactive-firewall/b7ee98df9e636a51806e62ef9c4ab161) for consistancy Changes in file tests/check_spelling: * updated regressions list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
Patch Notes
Impacted GHI
Included and Superseded PR/MRs
Summary by CodeRabbit
Documentation
Chores