https://github.com/even-wei/chartdown
A blazingly fast markdown-to-PDF converter that transforms CSV data into beautiful charts, written in Zig. Create data-rich documents with simple syntax.
https://github.com/even-wei/chartdown
charts cli-tool csv data-visualization markdown pdf zig
Last synced: about 1 year ago
JSON representation
A blazingly fast markdown-to-PDF converter that transforms CSV data into beautiful charts, written in Zig. Create data-rich documents with simple syntax.
- Host: GitHub
- URL: https://github.com/even-wei/chartdown
- Owner: even-wei
- License: mit
- Created: 2025-01-07T14:31:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-08T01:11:19.000Z (about 1 year ago)
- Last Synced: 2025-01-08T02:21:11.690Z (about 1 year ago)
- Topics: charts, cli-tool, csv, data-visualization, markdown, pdf, zig
- Language: Zig
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chartdown
A markdown to PDF converter with embedded charts, written in Zig.
## Features
- 📈 Convert markdown files containing chart definitions to beautiful PDFs
- 📊 Generate line and bar charts from CSV data
- 🚀 Single binary with no runtime dependencies
- âš¡ Fast and efficient Zig implementation
## Installation
Requires Zig 0.11.0 or later.
```bash
git clone git@github.com:even-wei/Chartdown.git
cd Chartdown
zig build
```
## Usage
```bash
chartdown input.md output.pdf
```
## Syntax
Charts are embedded in markdown using code blocks with the `chart` identifier:
```
# Sales Report
Our quarterly sales:
chart
{
type: "line",
data: "sales.csv",
x: "date",
y: "revenue",
title: "Quarterly Revenue"
}
```
### Chart Configuration
Basic options:
- `type`: Chart type ("line", "bar")
- `data`: Path to CSV file (relative to markdown file)
- `x`: Column name for X axis
- `y`: Column name for Y axis
- `title`: Chart title (optional)
Additional options:
- `width`: Chart width in pixels (default: 800)
- `height`: Chart height in pixels (default: 400)
- `color`: Line/bar color (default: "#2E86C1")
## Development
### Project Structure
```
src/
├── main.zig # Entry point
├── parser/ # Markdown and chart parsing
├── chart/ # Chart generation
├── pdf/ # PDF generation
└── utils/ # Common utilities
```
### Building from source
```bash
# Build the project
zig build
# Run tests
zig build test
# Install locally
zig build install
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
MIT License - see [LICENSE](LICENSE) for details