Skip to content

Conversation

@akonan
Copy link
Owner

@akonan akonan commented Nov 24, 2025

Summary

Features Added

PDF Export (Issue #38)

  • Generate PDF from HTML renderer output using Puppeteer
  • Support for custom page sizes (A4, A3, Letter, Legal, Tabloid)
  • Landscape/portrait orientation options
  • All visual styles fully supported

Image Export (Issue #39)

  • PNG export with configurable dimensions
  • SVG scalable vector graphics output
  • JPEG export with quality control
  • WebP modern format support
  • High-DPI support with device scale factor (2x, 3x)
  • Optional transparent backgrounds for PNG

CLI Enhancements

# PDF export
wiremd design.md --format pdf -o design.pdf --page-size A3 --landscape

# Image exports
wiremd design.md --format png --width 1920 --height 1080 --scale 2
wiremd design.md --format svg -o design.svg
wiremd design.md --format jpeg -o design.jpg
wiremd design.md --format webp -o design.webp

Technical Details

  • Added src/renderer/pdf-renderer.ts for PDF generation
  • Added src/renderer/image-renderer.ts for image exports
  • Updated CLI to support new format options and parameters
  • Configured Vite to exclude Puppeteer from bundling
  • Puppeteer is installed as an optional dependency

Testing

All export formats have been tested with:

  • Different visual styles (sketch, clean, wireframe, material, etc.)
  • Various page sizes and orientations for PDF
  • Different resolutions and scale factors for images
  • Complex wireframe layouts

Documentation

  • Updated README with comprehensive export documentation
  • Added usage examples for all new export formats
  • Documented Puppeteer requirement for export features

Closes

🤖 Generated with Claude Code

akonan and others added 4 commits November 24, 2025 17:01
- Implement PDF export renderer with customizable page sizes and orientation
- Add PNG, SVG, JPEG, and WebP image export support
- Include high-DPI support for image exports (2x, 3x scaling)
- Add CLI options for all export formats and their configurations
- Use Puppeteer as optional dependency for rendering
- Update Vite config to exclude Puppeteer from bundling
- Update README with comprehensive export documentation

Closes #38
Closes #39

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Make all generateOutput test functions async
- Add await before generateOutput calls
- Fix error throwing test to use rejects.toThrow for async functions
- All 471 tests now pass successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Run npm install to update lock file after adding puppeteer
- Fixes CI build failures due to package-lock.json being out of sync
- Adds devtools-protocol dependencies required by puppeteer

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Perform clean install to resolve all dependency versions
- Updates various @algolia and other dependencies to latest versions
- Ensures puppeteer and devtools-protocol are properly resolved
- Fixes CI npm ci synchronization errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PNG/SVG image export Add PDF export renderer

2 participants