Metadata-Version: 2.4
Name: mermaid-ascii-diagrams
Version: 0.1.0
Summary: Render Mermaid diagrams to ASCII/Unicode art
Author: Th3S3cr3tAg3nt
License: MIT
Project-URL: Homepage, https://github.com/Th3S3cr3tAg3nt/mermaid-ascii-diagrams
Project-URL: Issues, https://github.com/Th3S3cr3tAg3nt/mermaid-ascii-diagrams/issues
Keywords: mermaid,ascii,unicode,diagram,markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: ruff>=0.5; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"

# mermaid-ascii-diagrams

Render **Mermaid diagrams** as **ASCII art** for terminals, plain-text documentation, emails, and environments where graphical rendering is not available.

This tool extracts Mermaid blocks from Markdown and converts them into readable ASCII diagrams.

---

## Features

- Converts Mermaid diagrams to plain ASCII
- Works in terminals and text-only environments
- CLI-first design
- Safe to use in CI, docs pipelines, and code reviews
- No JavaScript, no browser required

---

## Installation

```bash
pip install mermaid-ascii-diagrams
```

Requires **Python 3.9+**.

---

## Command-line usage

### Basic usage

```bash
mermaid-ascii diagram.md
```

This will:
- Read `diagram.md`
- Find all fenced ```mermaid blocks
- Render each diagram as ASCII
- Print the result to stdout

### Redirect output

```bash
mermaid-ascii diagram.md > diagram.txt
```

---

## Example

### Input (Markdown)

````markdown
```mermaid
flowchart TD
    A[Start] --> B{Decision}
    B -->|Yes| C[Continue]
    B -->|No| D[Stop]
```
````

### Output (ASCII)

```
+--------+     +------------+
| Start  | --> | Decision ? |
+--------+     +------------+
                   |    |
                 Yes    No
                   |    |
          +---------+  +------+
          | Continue|  | Stop |
          +---------+  +------+
```

(Exact output depends on terminal width and diagram complexity.)

---

## Supported diagram types

Currently supported or in progress:

- Flowcharts
- Sequence diagrams
- Class diagrams
- State diagrams

Unsupported constructs are ignored gracefully.

---

## Python usage

You can also use the renderer programmatically:

```python
from mermaid_ascii import render

ascii_diagram = render("""
flowchart LR
  A --> B
""")

print(ascii_diagram)
```

---

## Project status

This project is **actively developed** and focused on:
- Correct ASCII layout
- Predictable rendering
- Minimal dependencies
- Mermaid syntax compatibility

Expect improvements rather than breaking changes.

---

## License

MIT License  
Copyright © 2025

---

## Contributing

Issues and pull requests are welcome.

If you’re adding:
- New diagram types
- Layout improvements
- CLI features

please include before/after ASCII output examples.

---

## Why this exists

Mermaid is excellent — but not every environment can render SVGs or HTML.

`mermaid-ascii-diagrams` exists so diagrams remain **readable everywhere**.
