Compare commits

...

2 Commits

Author SHA1 Message Date
Your Name
dda2fc15b2 Update docs and install script for Stack/GHC 9.10.3
Switch README and CLAUDE.md from cabal to stack commands, update GHC
version references, add pkg-config to install-deps.sh, and add Stack
as the recommended build method.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 21:27:36 +00:00
Your Name
705d53b958 Update Stack resolver from lts-22.39 to lts-24.34 (GHC 9.10.3)
Fixes happy-1.20.1.1 build failure and updates to latest LTS snapshot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 21:19:08 +00:00
5 changed files with 52 additions and 32 deletions

View File

@ -10,31 +10,36 @@ Docster is a Haskell CLI tool that converts Markdown files with embedded Mermaid
### Build ### Build
```bash ```bash
cabal build stack build
``` ```
### Run ### Run
```bash ```bash
# Convert to PDF # Convert to PDF
cabal run docster -- -pdf path/to/file.md stack exec docster -- -pdf path/to/file.md
# Convert to HTML # Convert to HTML
cabal run docster -- -html path/to/file.md stack exec docster -- -html path/to/file.md
```
### Test
```bash
stack test
``` ```
### Test a single file ### Test a single file
```bash ```bash
cabal run docster -- -pdf mermaid-to-svg/sample.md stack exec docster -- -pdf mermaid-to-svg/sample.md
``` ```
### Clean build artifacts ### Clean build artifacts
```bash ```bash
cabal clean stack clean
``` ```
### Interactive development ### Interactive development
```bash ```bash
cabal repl stack repl
``` ```
## Architecture ## Architecture
@ -57,17 +62,11 @@ The tool uses Pandoc's AST transformation capabilities to:
## Dependencies ## Dependencies
External requirements: External requirements:
- GHC 9.12.2 and Cabal 3.16 (install via ghcup) - Stack (install via ghcup) — manages GHC 9.10.3 automatically via lts-24.34
- Pandoc library - Pandoc library (Haskell dependency, pulled by Stack)
- 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,12 +13,14 @@ Mermaid code blocks (```mermaid) will be rendered to SVG and embedded.
### Prerequisites ### Prerequisites
First install the required system dependencies: Install the required system dependencies (Ubuntu/Debian):
```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):
@ -28,13 +30,26 @@ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
source ~/.ghcup/env source ~/.ghcup/env
``` ```
Install specific GHC and Cabal versions: #### Option A: Build with Stack (recommended)
Stack manages its own GHC installation automatically.
```bash ```bash
ghcup install ghc 9.12.2 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 install cabal 3.16.0.0
ghcup set ghc 9.12.2 ghcup set ghc 9.10.3
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
@ -43,18 +58,24 @@ ghcup set cabal 3.16.0.0
npm install -g @mermaid-js/mermaid-cli npm install -g @mermaid-js/mermaid-cli
``` ```
### Build and install docster ### PATH setup
Make sure the install location is in your PATH. Add to your shell config if needed:
```bash ```bash
cabal install --installdir=$HOME/.local/bin # For Stack
``` export PATH="$HOME/.local/bin:$PATH"
Make sure `~/.local/bin` is in your PATH. Add to your shell config if needed: # For Cabal
```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 libgmp-dev libffi-dev zlib1g-dev texlive-latex-base texlive-fonts-recommended texlive-latex-extra texlive-xetex 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

View File

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

View File

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