Compare commits

..

No commits in common. "dda2fc15b24688b0bb52d166f9b4a9f818a01c9d" and "3398dd2baead90fd965c782eca4bbea38f1be307" have entirely different histories.

5 changed files with 32 additions and 52 deletions

View File

@ -10,36 +10,31 @@ Docster is a Haskell CLI tool that converts Markdown files with embedded Mermaid
### Build ### Build
```bash ```bash
stack build cabal build
``` ```
### Run ### Run
```bash ```bash
# Convert to PDF # Convert to PDF
stack exec docster -- -pdf path/to/file.md cabal run docster -- -pdf path/to/file.md
# Convert to HTML # Convert to HTML
stack exec docster -- -html path/to/file.md cabal run docster -- -html path/to/file.md
```
### Test
```bash
stack test
``` ```
### Test a single file ### Test a single file
```bash ```bash
stack exec docster -- -pdf mermaid-to-svg/sample.md cabal run docster -- -pdf mermaid-to-svg/sample.md
``` ```
### Clean build artifacts ### Clean build artifacts
```bash ```bash
stack clean cabal clean
``` ```
### Interactive development ### Interactive development
```bash ```bash
stack repl cabal repl
``` ```
## Architecture ## Architecture
@ -62,11 +57,17 @@ The tool uses Pandoc's AST transformation capabilities to:
## Dependencies ## Dependencies
External requirements: External requirements:
- Stack (install via ghcup) — manages GHC 9.10.3 automatically via lts-24.34 - GHC 9.12.2 and Cabal 3.16 (install via ghcup)
- Pandoc library (Haskell dependency, pulled by Stack) - Pandoc library
- TeX Live (for PDF generation via XeLaTeX) - TeX Live (for PDF generation via XeLaTeX)
- Mermaid CLI (`npm install -g @mermaid-js/mermaid-cli`) - Mermaid CLI (`npm install -g @mermaid-js/mermaid-cli`)
- pkg-config, libgmp-dev, libffi-dev, zlib1g-dev (see `install-deps.sh`)
To install GHC and Cabal:
```bash
source ~/.ghcup/env && ghcup install ghc 9.12.2
source ~/.ghcup/env && ghcup install cabal 3.16.0.0
source ~/.ghcup/env && ghcup set ghc 9.12.2
```
## Common Issues ## Common Issues

View File

@ -13,14 +13,12 @@ Mermaid code blocks (```mermaid) will be rendered to SVG and embedded.
### Prerequisites ### Prerequisites
Install the required system dependencies (Ubuntu/Debian): First install the required system dependencies:
```bash ```bash
./install-deps.sh ./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 Haskell toolchain
Install ghcup (Haskell toolchain installer): Install ghcup (Haskell toolchain installer):
@ -30,26 +28,13 @@ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
source ~/.ghcup/env source ~/.ghcup/env
``` ```
#### Option A: Build with Stack (recommended) Install specific GHC and Cabal versions:
Stack manages its own GHC installation automatically.
```bash ```bash
ghcup install stack ghcup install ghc 9.12.2
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 install cabal 3.16.0.0
ghcup set ghc 9.10.3 ghcup set ghc 9.12.2
ghcup set cabal 3.16.0.0 ghcup set cabal 3.16.0.0
cabal install --installdir=$HOME/.local/bin
``` ```
### Install Mermaid CLI ### Install Mermaid CLI
@ -58,24 +43,18 @@ cabal install --installdir=$HOME/.local/bin
npm install -g @mermaid-js/mermaid-cli npm install -g @mermaid-js/mermaid-cli
``` ```
### PATH setup ### Build and install docster
Make sure the install location is in your PATH. Add to your shell config if needed:
```bash ```bash
# For Stack cabal install --installdir=$HOME/.local/bin
export PATH="$HOME/.local/bin:$PATH" ```
# For Cabal Make sure `~/.local/bin` is in your PATH. Add to your shell config if needed:
```bash
export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.local/bin:$PATH"
``` ```
## Development ## 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. See [agents.md](agents.md) for information about the Claude Code agents used for Haskell refactoring in this project.

View File

@ -1,2 +1,2 @@
sudo apt update sudo apt update
sudo apt install -y build-essential pkg-config libgmp-dev libffi-dev zlib1g-dev texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-xetex sudo apt install -y build-essential libgmp-dev libffi-dev zlib1g-dev texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-xetex

View File

@ -1,4 +1,4 @@
resolver: lts-24.34 # GHC 9.10.3 resolver: lts-22.39 # GHC 9.12.2 compatible
packages: packages:
- . - .

View File

@ -6,7 +6,7 @@
packages: [] packages: []
snapshots: snapshots:
- completed: - completed:
sha256: 45b164eaf5c16bd220d2c5d7ab9a66ca0cfbcde7753703a5cb3549172adde813 sha256: 6c5aeace2ca5ecde793a9e0acfaa730ec8f384aa2f6183a2a252f5f9ec55d623
size: 728959 size: 720039
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/24/34.yaml url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/39.yaml
original: lts-24.34 original: lts-22.39