# Docster A self-contained CLI tool that converts Markdown with Mermaid diagrams into PDF or HTML using Pandoc and Mermaid CLI. ## Usage docster -pdf path/to/file.md docster -html path/to/file.md docster -docx path/to/file.md Mermaid code blocks (```mermaid) will be rendered to SVG (HTML) or PNG (PDF/DOCX) and embedded. ## Installation ### Prerequisites Install the required system dependencies (Ubuntu/Debian): ```bash ./install-deps.sh ``` This installs build-essential, libgmp-dev, libffi-dev, zlib1g-dev, pkg-config, and TeX Live packages for PDF generation. ### Install Haskell toolchain Install ghcup (Haskell toolchain installer): ```bash curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh source ~/.ghcup/env ``` #### Option A: Build with Stack (recommended) Stack manages its own GHC installation automatically. ```bash ghcup install stack stack build stack install ``` This uses the resolver defined in `stack.yaml` (currently lts-24.34 / GHC 9.10.3). #### Option B: Build with Cabal ```bash ghcup install ghc 9.10.3 ghcup install cabal 3.16.0.0 ghcup set ghc 9.10.3 ghcup set cabal 3.16.0.0 cabal install --installdir=$HOME/.local/bin ``` ### Install Mermaid CLI ```bash npm install -g @mermaid-js/mermaid-cli ``` ### PATH setup Make sure the install location is in your PATH. Add to your shell config if needed: ```bash # For Stack export PATH="$HOME/.local/bin:$PATH" # For Cabal export PATH="$HOME/.local/bin:$PATH" ``` ## Development ```bash stack build # compile stack test # run tests stack repl # interactive REPL ``` See [agents.md](agents.md) for information about the Claude Code agents used for Haskell refactoring in this project.