-
Notifications
You must be signed in to change notification settings - Fork 0
Add multi-page asset-aware markdown-to-html storage implementation #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Arlodotexe
wants to merge
5
commits into
main
Choose a base branch
from
feature/blog-generator-multipage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ink detection and resolution
…ReferencedAsset tracking Changes to asset resolution architecture: - Modified IAssetResolver to accept markdown source per-call instead of storing it as state - Updated RelativePathAssetResolver to be stateless, receiving context file in ResolveAsync() - Enables shared resolver instance across multiple pages without coupling Introduced ReferencedAsset record: - Captures complete asset reference info: original path, rewritten path, and resolved file - Facilitates materialization in consumer code (PagesCommand) - Replaces IFile collection with structured ReferencedAsset collection AssetAwareHtmlTemplatedMarkdownFile improvements: - Tracks all referenced assets (both included and referenced) via ReferencedAsset - Unified asset processing for markdown source and template file detection - Extracted ProcessAssetLinkAsync() method for shared pipeline logic Virtual structure simplification: - Removed automatic asset yielding from AssetAwareHtmlTemplatedMarkdownPageFolder - Removed template asset yielding from HtmlTemplatedMarkdownPageFolder base class - Assets now tracked in ReferencedAsset collection for explicit consumer materialization Implemented PagesCommand: - CLI command for multi-page blog generation using AssetAwareHtmlTemplatedMarkdownPagesFolder - Materializes virtual structure by iterating page folders and copying files - Uses ReferencedAsset.RewrittenPath for correct asset output placement Added comprehensive test coverage: - AssetAwareHtmlTemplatedMarkdownPagesFolderTests with 7 test cases - Covers markdown discovery, hierarchy preservation, asset resolution, and link rewriting Minor cleanup: - Removed debug logging from PostPageAssetFolder - Fixed formatting/whitespace in PostPageFolder and HtmlTemplatedMarkdownPageFolder - Changed return types to IChildFolder for Pages-related classes
Simplifies asset resolver architecture: - Removed IFolder SourceFolder property from IAssetResolver interface - Removed SourceFolder property from RelativePathAssetResolver implementation - Asset resolution now fully stateless, relying only on markdown source context Updated PagesCommand implementation: - Simplified folder materialization logic with better variable naming - Changed --template-file option to --template-file-name for clarity - Removed debug logging statements - Used DepthFirstRecursiveFolder at pagesFolder level instead of per-page - Improved code formatting and inline documentation - Streamlined folder creation using CreateFoldersAlongRelativePathAsync pattern Restored HtmlTemplatedMarkdownPageFolder template asset yielding: - Re-added template folder enumeration and asset passthrough - Template HTML file exclusion logic restored - Enables PostPage scenario to continue working as expected Updated test setup: - Removed SourceFolder initialization from RelativePathAssetResolver instances - Tests now reflect stateless resolver design
…attern Major refactoring of the blog generation asset pipeline to improve flexibility and maintainability: **Core Interface Changes:** - Renamed `IAssetInclusionStrategy` → `IAssetStrategy` with nullable return type - Updated method signatures across asset interfaces for clarity and consistency - Renamed `ReferencedAsset` record → `PageAsset` to better reflect its purpose - Renamed `PostPageDataModel` → `HtmlMarkdownDataTemplateModel` for generic use **Asset Strategy System:** - Deleted `ReferenceOnlyInclusionStrategy.cs` (replaced with new architecture) - Added `KnownAssetStrategy.cs`: configurable strategy using known asset ID lists - Supports both included and referenced asset file ID sets - Includes fallback behavior options (Reference/Include/Drop) - Added `FaultStrategy.cs`: enum for unknown asset handling (None/LogWarn/LogError/Throw) **Asset Detection Improvements:** - Enhanced `RegexAssetLinkDetector` with improved path matching patterns - Added protocol scheme detection to filter out absolute URLs - Added standalone filename pattern detection - Fixed relative path resolution in `RelativePathAssetResolver` **Processing Pipeline Refactoring:** - Moved asset detection earlier in pipeline to include template file assets - Changed `AssetAwareHtmlTemplatedMarkdownFile` to scan both template and markdown - Updated post-processing to return nullable for dropped assets - Refactored `PagesCommand` to configure new asset strategy with separate ID sets **Command Structure:** - Deleted legacy `PostPageCommand.cs`, `PostPageFolder.cs`, `IndexHtmlFile.cs`, `PostPageAssetFolder.cs` - Added new `PageCommand.cs` for single-page generation - Updated `WacsdkBlogCommands` to use new command structure **Dependencies:** - Added `OwlCore.Extensions` package reference for enhanced functionality **Tests:** - Updated test references from `InclusionStrategy` → `AssetStrategy` - Created temporary `ReferenceOnlyAssetStrategy` for test compatibility This refactoring enables fine-grained control over asset handling, supporting scenarios like template-based asset inclusion vs markdown-based asset referencing, with configurable fallback behavior for unknown assets.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Major refactoring of the blog generation asset pipeline to improve flexibility and maintainability:
Core Interface Changes:
IAssetInclusionStrategy→IAssetStrategywith nullable return typeReferencedAssetrecord →PageAssetto better reflect its purposePostPageDataModel→HtmlMarkdownDataTemplateModelfor generic useAsset Strategy System:
ReferenceOnlyInclusionStrategy.cs(replaced with new architecture)KnownAssetStrategy.cs: configurable strategy using known asset ID listsFaultStrategy.cs: enum for unknown asset handling (None/LogWarn/LogError/Throw)Asset Detection Improvements:
RegexAssetLinkDetectorwith improved path matching patternsRelativePathAssetResolverProcessing Pipeline Refactoring:
AssetAwareHtmlTemplatedMarkdownFileto scan both template and markdownPagesCommandto configure new asset strategy with separate ID setsCommand Structure:
PostPageCommand.cs,PostPageFolder.cs,IndexHtmlFile.cs,PostPageAssetFolder.csPageCommand.csfor single-page generationWacsdkBlogCommandsto use new command structureDependencies:
OwlCore.Extensionspackage reference for enhanced functionalityTests:
InclusionStrategy→AssetStrategyReferenceOnlyAssetStrategyfor test compatibilityThis refactoring enables fine-grained control over asset handling, supporting scenarios like template-based asset inclusion vs markdown-based asset referencing, with configurable fallback behavior for unknown assets.