-
Notifications
You must be signed in to change notification settings - Fork 0
Add project overview and usage in README #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,81 @@ | ||
| # nixie | ||
|
|
||
| `nixie` is a simple command-line tool that validates Mermaid diagrams embedded in Markdown files. | ||
| `nixie` validates Mermaid diagrams embedded in Markdown files. | ||
|
|
||
| The CLI scans each provided file (or directory) for `mermaid` code blocks and | ||
| invokes `mermaid-cli` to verify that the diagrams can be rendered without | ||
| errors. | ||
| ## Features | ||
|
|
||
| ## Usage | ||
| - Recursively searches directories for Markdown files | ||
| - Parses `mermaid` code blocks and uses `@mermaid-js/mermaid-cli` to validate | ||
| - Runs checks concurrently for faster feedback | ||
| - Prints clear error messages for failing diagrams | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Python 3.11+ | ||
| - Node.js with `npx` and `@mermaid-js/mermaid-cli` | ||
|
|
||
| ## Installation | ||
|
|
||
| ### From PyPI | ||
|
|
||
| End users can install the latest release directly from PyPI: | ||
|
|
||
| ```bash | ||
| nixie path/to/file.md | ||
| pip install nixie | ||
| ``` | ||
|
|
||
| Use `--concurrency` to control how many diagrams are processed in parallel. The tool relies on | ||
| Node.js and `@mermaid-js/mermaid-cli` being available on your system. | ||
| This provides the `nixie` command without any development extras. | ||
|
|
||
| ## Development | ||
| ### Development Setup | ||
|
|
||
| Development dependencies are managed via `pyproject.toml`. After installing | ||
| [uv](https://github.com/astral-sh/uv), run: | ||
| To contribute to nixie, install the package in editable mode and set up | ||
| development tools using [uv](https://docs.astral.sh/uv/), Astral's fast Python | ||
| package manager: | ||
|
|
||
| ```bash | ||
| pip install -e . | ||
| uv sync --include dev | ||
| ``` | ||
|
|
||
| This installs linters and test tools such as Ruff, Pyright, pytest and | ||
| pytest-asyncio. | ||
| ## Usage | ||
|
|
||
| ```bash | ||
| nixie [--concurrency N] FILE [FILE...] | ||
| ``` | ||
|
|
||
| `--concurrency` controls how many diagrams are processed in parallel (defaults | ||
| to the number of CPU cores or `4` if this cannot be determined). Paths can be | ||
| files or directories. | ||
|
|
||
| Before running the test suite, install the project in editable mode so the | ||
| package can be imported: | ||
| Example: | ||
|
|
||
| ```bash | ||
| pip install -e . | ||
| $ nixie bad.md | ||
| Parse error on line 1: | ||
| invalid diagram | ||
| ^ | ||
| Unexpected token: syntax error | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| Run formatting, linting, type checking and tests before committing: | ||
|
|
||
| ```bash | ||
| ruff format | ||
| ruff check | ||
| pyright | ||
| pytest | ||
| ``` | ||
|
|
||
| The integration tests mock the CLI so Node.js is not needed during testing. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| - `nixie/cli.py` – command-line interface and validation logic | ||
| - `nixie/unittests/` – unit tests for helper functions | ||
| - `tests/integration/` – behavioural tests covering the CLI | ||
|
|
||
| ## License | ||
|
|
||
| See `LICENSE` for license details. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
suggestion: Consider adding installation instructions for end-users.
If
nixieis meant for non-developers, please include standard installation steps (e.g.,pip install nixie) in addition to development setup.