- Add OutputFormat ADT for explicit format handling vs file extension checking
- Replace crash-prone runIOorExplode with proper Either error handling
- Extract processMermaidBlock into focused functions for better maintainability
- Convert String constants to Text for type consistency
- Add DiagramConfig type for better configuration management
- Enhance haskell-refactoring-expert agent to handle module organization
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace manual size constraints with LaTeX's built-in image scaling mechanism.
- Remove artificial width/height constraints that caused diagram truncation
- Add adjustbox package and auto-scaling macros to LaTeX template
- Images now scale intelligently: natural size if they fit, auto-scaled if oversized
- Maintains aspect ratio and prevents page rotation issues
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Problem: SVG diagrams had missing text in PDFs due to Inkscape conversion
issues with foreignObject elements used by Mermaid for HTML text rendering.
Solution: Implement format-specific optimal generation:
- HTML: SVG files for perfect vector scaling and text rendering
- PDF: High-resolution PNG files (3x scale) for sharp images with readable text
Changes:
- Generate SVG for HTML output using standard mmdc command
- Generate PNG for PDF output using mmdc with --scale 3 for high resolution
- Remove SVG LaTeX package dependency and Inkscape requirement
- Update documentation to reflect the dual-format approach
Results:
- HTML: Crisp, scalable vector diagrams with perfect text
- PDF: Sharp, high-resolution raster diagrams with clear text
- No external dependencies beyond mermaid-cli
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Problem: HTML output contained broken image links because all formats
used the same full path (e.g., living-documentation/diagram-536389.png).
This worked for PDFs but failed for HTML since both files are in the
same directory and need relative paths.
Solution:
- Add output format detection with isHTMLOutput function
- Update processMermaidBlock to take OutputPath parameter
- Generate context-appropriate paths:
* HTML: relative path (diagram-536389.png)
* PDF: full path (living-documentation/diagram-536389.png)
- Update transformDocument and compilation functions to pass output path
Both HTML and PDF generation now work correctly with proper image embedding.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major improvements:
- Add custom DocsterError type with proper exception handling
- Introduce type-safe newtypes (SourceDir, OutputPath, DiagramId)
- Consistent Text usage throughout, eliminating String/Text mixing
- Extract LaTeX template generation into separate functions
- Add resource cleanup with bracket pattern for temporary files
- Improve function naming and comprehensive documentation
- Extract constants for better maintainability
- Remove all unused imports and fix compiler warnings
The refactored code maintains identical functionality while being
much more maintainable, type-safe, and following Haskell best practices.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add fancyvrb package and Shaded environment for syntax highlighting
- Include amsmath and amssymb packages for mathematical symbols
- Switch from pdflatex to xelatex with fontspec for Unicode support
- Add complete set of syntax highlighting commands for code blocks
- Fix directory-relative Mermaid file generation
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update docster.cabal to modern format with GHC 9.12.2 compatibility
- Fix Mermaid code block detection using getDefaultExtensions
- Switch from SVG to PNG output for PDF compatibility
- Add CLAUDE.md with development instructions
- Update tooling from mise to ghcup for Haskell management
Known issues:
- Generated diagram files are created in root directory instead of alongside source files
- PDF generation fails with LaTeX errors for complex documents (missing \tightlist support)
- HTML output lacks proper DOCTYPE (quirks mode)
- Debug output still present in code
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>