Contributing¶
Thank you for considering contributing to Engrapha! This page explains how to set up a development environment, run tests, and submit changes.
Development Setup¶
git clone https://github.com/Bharat940/engrapha
cd engrapha
pip install -e ./packages/engrapha -e ./packages/engrapha_diagrams -e ./packages/engrapha_notes[dev]
Documentation Build¶
To preview the docs site locally:
Running Tests¶
Both packages use pytest:
# Diagrams package
pytest packages/engrapha_diagrams/tests/
# Notes package
pytest packages/engrapha_notes/tests/
# Combined
pytest
Linting & Type-checking¶
Adding a New Diagram¶
- Create
/packages/engrapha_diagrams/src/engrapha_diagrams/<diagram_name>.py - Define a
DiagramBasesubclass with: _add_node(...)/ similar methodsbuild()to render shapes viaself.themeas_flowable()to return the platform Flowable list- Register the public class in
packages/engrapha_diagrams/src/engrapha_diagrams/__init__.py - Add usage docs to
docs/diagrams/<diagram_name>.md - Reference the diagram in the gallery's
docs/diagrams/overview.md - Add a screenshot placeholder under
docs/assets/screenshots/<diagram>.png - Add a smoke test under
tests/
Adding a New Theme¶
- Add the
NotesThemeinstance topackages/engrapha_notes/src/engrapha_notes/theme.py(mention it inALL_THEMES) - Add the matching
DiagramThememapping inpackages/engrapha_diagrams/src/engrapha_diagrams/theme.py'sfrom_notes_theme()if accent colors diverge - Document the theme in
themes.md
Submitting a PR¶
- Fork the repo
- Create a feature branch:
git checkout -b feat/my-change - Make your changes with appropriate tests
- Run
pytest,ruff,mypylocally and ensure all green - Open a PR with a clear description and screenshots if visual
Documentation fixes / additions¶
Pull requests to fix typos or improve examples are welcome! Author the change under docs/ directly.
For new concepts or significant changes, please open an issue first.
Release process¶
Engrapha follows semantic versioning. Maintainers will handle release tagging.
For announcements, follow the GitHub releases page.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.