add readme
This commit is contained in:
parent
5848b471ec
commit
0a6fb0e954
4 changed files with 67 additions and 7 deletions
58
README.md
58
README.md
|
|
@ -1,15 +1,65 @@
|
|||
# mermaid-diagram-creator
|
||||
|
||||
To install dependencies:
|
||||
A CLI tool to convert Mermaid diagram files (.mmd) to SVG format.
|
||||
|
||||
## Features
|
||||
|
||||
- Convert Mermaid diagram text files to SVG
|
||||
- Easy command-line interface
|
||||
- Fast rendering with `beautiful-mermaid`
|
||||
- Input validation with Zod
|
||||
|
||||
## Installation
|
||||
|
||||
### 1. Set up the project
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
To run:
|
||||
### 2. Create symlink to your user bin directory
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
ln -s /Users/my_user_name/project_dir/mermaid-diagram-creator/bin/mmd-to-svg ~/.local/bin/mmd-to-svg
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.2.21. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
mmd-to-svg <input.mmd> <output.svg>
|
||||
```
|
||||
|
||||
### Hot Reloading
|
||||
|
||||
Using [entr](https://github.com/eradman/entr)
|
||||
|
||||
```bash
|
||||
echo docs/diagrams/create_thing.mmd | entr mmd-to-svg ./docs/diagrams/create_thing.mmd ./docs/diagrams/create.svg
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
```bash
|
||||
mmd-to-svg example.mmd diagram.svg
|
||||
```
|
||||
|
||||
This will read the Mermaid diagram from `example.mmd` and output the rendered SVG to `diagram.svg`.
|
||||
|
||||
### Example diagram file (example.mmd)
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
A[Start] --> B{Decision}
|
||||
B -->|Yes| C[Action]
|
||||
B -->|No| D[End]
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
Run directly:
|
||||
|
||||
```bash
|
||||
bun index.ts example.mmd output.svg
|
||||
```
|
||||
|
||||
Built with [Bun](https://bun.com) - a fast all-in-one JavaScript runtime.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue