Files
md_reader/README.md

90 lines
1.3 KiB
Markdown

# md_reader
A simple Markdown reader with Mermaid diagram support.
## Features
- Render Markdown to HTML
- Batch convert Markdown files
- HTTP server for serving files
- **Mermaid diagram support** with SVG export
- Preview in browser
- Export to PDF via browser print
## Installation
```bash
cargo build --release
```
## Usage
### Render a single file
```bash
md_reader render document.md -o output.html
```
### Batch convert
```bash
md_reader batch ./docs/ -o ./html/
```
### Start HTTP server
```bash
md_reader server -p 8080 -d ./docs/
```
### Preview in browser
```bash
md_reader preview document.md
```
### Export to PDF
```bash
# Method 1: Using export command
md_reader export document.md -o output.html
# Method 2: Using render with -p flag
md_reader render document.md -p
```
Open the exported HTML file in browser, then use **File > Print > Save as PDF**.
## Mermaid Support
md_reader supports rendering Mermaid diagrams in Markdown files.
### Usage
Use `mermaid` code blocks:
```markdown
```mermaid
graph TD
A[Start] --> B[End]
```
```
### Supported Diagram Types
- Flowchart
- Sequence Diagram
- Class Diagram
- State Diagram
- Gantt Chart
- Pie Chart
- Entity Relationship Diagram
### SVG Export
Hover over any Mermaid diagram and click "Download SVG" to download the vector graphic.
## License
MIT