feat: implement comprehensive asset shipping for md-render command
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
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>
This commit is contained in:
16
examples/image-assets/README.txt
Normal file
16
examples/image-assets/README.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Image Asset Management Examples
|
||||
|
||||
This directory contains examples demonstrating MarkiTect's image asset management
|
||||
capabilities:
|
||||
|
||||
- project_documentation.md: Sample project documentation with embedded images
|
||||
showing how MarkiTect handles image assets in markdown documents
|
||||
- images/: Directory containing sample images used in the documentation examples
|
||||
|
||||
These examples showcase:
|
||||
- Image embedding in markdown documents
|
||||
- Asset deduplication and content-addressable storage
|
||||
- Relative path handling for images in MarkiTect projects
|
||||
- Best practices for organizing image assets in documentation
|
||||
|
||||
--worsch, 25-10-29
|
||||
BIN
examples/image-assets/images/architecture_diagram.png
Normal file
BIN
examples/image-assets/images/architecture_diagram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
examples/image-assets/images/company_logo.png
Normal file
BIN
examples/image-assets/images/company_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
examples/image-assets/images/dashboard_screenshot.png
Normal file
BIN
examples/image-assets/images/dashboard_screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
examples/image-assets/images/performance_chart.png
Normal file
BIN
examples/image-assets/images/performance_chart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
examples/image-assets/images/project_icon.png
Normal file
BIN
examples/image-assets/images/project_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 458 B |
BIN
examples/image-assets/images/settings_panel.png
Normal file
BIN
examples/image-assets/images/settings_panel.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
71
examples/image-assets/project_documentation.md
Normal file
71
examples/image-assets/project_documentation.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Project Documentation Example
|
||||
|
||||
## Overview
|
||||
|
||||
This document demonstrates MarkiTect's image asset management capabilities by embedding various types of images commonly used in technical documentation.
|
||||
|
||||
## Architecture Diagram
|
||||
|
||||
The following diagram shows the overall system architecture:
|
||||
|
||||

|
||||
|
||||
*Figure 1: High-level system architecture showing component interactions*
|
||||
|
||||
## User Interface Screenshots
|
||||
|
||||
### Dashboard View
|
||||
|
||||
The main dashboard provides an overview of system status:
|
||||
|
||||

|
||||
|
||||
*Figure 2: Main dashboard interface with key metrics and navigation*
|
||||
|
||||
### Settings Panel
|
||||
|
||||
Users can configure system behavior through the settings panel:
|
||||
|
||||

|
||||
|
||||
*Figure 3: Configuration interface for system preferences*
|
||||
|
||||
## Logo and Branding
|
||||
|
||||
### Company Logo
|
||||
|
||||

|
||||
|
||||
### Project Icon
|
||||
|
||||
The project uses this icon throughout the interface:
|
||||
|
||||

|
||||
|
||||
## Asset Management Features
|
||||
|
||||
MarkiTect provides several key features for managing image assets:
|
||||
|
||||
1. **Content-Addressable Storage**: Images are stored using SHA-256 hashes to prevent duplication
|
||||
2. **Automatic Deduplication**: Identical images are only stored once, regardless of filename
|
||||
3. **Relative Path Resolution**: Images can be referenced using relative paths from the markdown file
|
||||
4. **Asset Tracking**: All referenced assets are tracked and validated during document processing
|
||||
|
||||
## Performance Metrics
|
||||
|
||||
The following chart shows system performance over time:
|
||||
|
||||

|
||||
|
||||
*Figure 4: System performance metrics showing response time and throughput*
|
||||
|
||||
## Conclusion
|
||||
|
||||
This example demonstrates how MarkiTect seamlessly handles multiple image assets within a single document, providing:
|
||||
|
||||
- Efficient storage through deduplication
|
||||
- Reliable asset resolution
|
||||
- Clean integration with markdown syntax
|
||||
- Support for various image formats (PNG, JPG, SVG, etc.)
|
||||
|
||||
All images in this document will be processed through MarkiTect's asset management system when the document is rendered or packaged.
|
||||
Reference in New Issue
Block a user