markitect-main/markitect/assets
tegwick 3a353b4d4f feat: implement comprehensive asset shipping for md-render command
Add automatic asset copying when rendering markdown to different output
directories with intelligent defaults and full user control.

Key Features:
- Environment variable support: MARKITECT_OUTPUT_DIR sets default output directory
- Smart defaults: auto-ship assets for directory output, disabled for file output
- CLI control flags: --ship-assets and --no-ship-assets for explicit control
- Timestamp-based copying: only copies when source newer than destination
- Path preservation: maintains relative directory structure in output
- Graceful error handling: missing assets logged as warnings, not failures

Technical Implementation:
- Enhanced asset discovery in markitect/assets/discovery.py with discover_assets_from_markdown()
- Added environment variable priority: CLI --output > MARKITECT_OUTPUT_DIR > input directory
- Comprehensive asset shipping logic with _ship_assets() function
- Directory vs file output detection for intelligent default behavior

Examples and Testing:
- Added image-assets example directory with 6 sample images and comprehensive README
- Created comprehensive TDD test suite with 10 tests covering all functionality
- Tests validate environment variables, CLI flags, asset discovery, shipping logic,
  timestamp handling, missing assets, path preservation, and default behaviors

Usage:
  markitect md-render file.md -o /output/dir/     # Auto-ships assets
  markitect md-render file.md --no-ship-assets   # Suppresses shipping
  MARKITECT_OUTPUT_DIR=/docs markitect md-render file.md  # Uses env var

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 23:12:44 +01:00
..
__init__.py feat: complete Issue #144 - Phase 3: Advanced Features and Performance 2025-10-14 17:53:47 +02:00
analytics.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
analyzer.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
batch_processor.py refactor: refine asset object interfaces and fix integration tests 2025-10-14 23:49:18 +02:00
cache.py feat: complete Issue #144 - Phase 3: Advanced Features and Performance 2025-10-14 17:53:47 +02:00
cli_commands.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
constants.py fix: move test artifacts to tmp directory and update gitignore 2025-10-19 21:39:40 +02:00
database.py feat: complete Issue #144 - Phase 3: Advanced Features and Performance 2025-10-14 17:53:47 +02:00
deduplicator.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
discovery.py feat: implement comprehensive asset shipping for md-render command 2025-10-29 23:12:44 +01:00
exceptions.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
manager.py fix: make AssetManager registry path relative to storage_path by default 2025-10-24 20:08:48 +02:00
manager_v2.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
models.py feat: complete core asset management system with database integration 2025-10-14 23:42:42 +02:00
optimizer.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
packager.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
performance.py feat: complete Issue #144 - Phase 3: Advanced Features and Performance 2025-10-14 17:53:47 +02:00
registry.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
repository.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
transformer.py feat: complete Issue #146 - Asset Management Implementation Milestone 2025-10-14 18:29:37 +02:00
utils.py feat: complete Issue #144 - Phase 3: Advanced Features and Performance 2025-10-14 17:53:47 +02:00