<div align="center">
<img src="./assets/logo.svg" alt="md2pdf logo" width="350">
<p align="center">
  <a href="https://www.npmjs.com/package/@amitdevx/md2pdf"><img src="https://img.shields.io/npm/v/@amitdevx/md2pdf.svg?style=flat-square" alt="npm version"></a>
  <a href="https://www.npmjs.com/package/@amitdevx/md2pdf"><img src="https://img.shields.io/npm/dt/@amitdevx/md2pdf.svg?style=flat-square" alt="npm downloads"></a>
  <a href="https://github.com/amitdevx/md2pdf/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@amitdevx/md2pdf.svg?style=flat-square" alt="License: MIT"></a>
</p>
<p align="center">
  <b><a href="https://amitdevx.tech/projects/amitdevx-md2pdf">Project Page</a></b> &nbsp;&middot;&nbsp;
  <b><a href="https://www.npmjs.com/package/@amitdevx/md2pdf">npm</a></b> &nbsp;&middot;&nbsp;
  <b><a href="https://github.com/amitdevx/md2pdf">GitHub</a></b>
</p>
</div>

Convert Markdown to PDF with Mermaid diagrams, KaTeX math, Obsidian syntax, syntax highlighting, batch processing, file merging, watch mode, and Table of Contents generation. Available as a CLI and Node.js API.

## Installation

```bash
# Install globally (for CLI usage)
npm install -g @amitdevx/md2pdf
md2pdf init

# Or use locally within a project (for programmatic usage)
npm install @amitdevx/md2pdf
npx md2pdf init
```

*For more details on installation and setup, see the [Getting Started guide](docs/getting-started.md).*

## CLI Usage

The most common way to use `md2pdf` is via the command line.

### Basic Conversion
```bash
md2pdf document.md
```
This will automatically generate `document.pdf` in the same directory.

> **Note:** All documentation for `md2pdf` has been moved to the `docs/` directory.

## Documentation Directory

*   **[Getting Started](docs/getting-started.md)** : Installation and quick start guide.
*   **[CLI Reference](docs/cli-reference.md)** : Command-line flags, options, and usage examples.
*   **[API Reference](docs/api.md)** : Node.js programmatic API documentation.
*   **[Configuration](docs/configuration.md)** : Persistent config files and profiles.
*   **[Themes](docs/themes.md)** : Using and customizing built-in themes.
*   **[Plugins](docs/plugins.md)** : Extending md2pdf via the plugin API.
*   **[Obsidian Support](docs/obsidian.md)** : Guide to Obsidian features (callouts, embeds, wiki-links).
*   **[Mermaid & Math](docs/mermaid.md)** : Using Mermaid diagrams and KaTeX math blocks.
*   **[Architecture](docs/architecture.md)** : Internal design, caching, and pipeline details.
*   **[Contributing](docs/contributing.md)** : Guidelines for contributing to md2pdf.

## License

MIT License. See `LICENSE` for details.
