Add Document-Level Modifiers #45
Merged
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.
This PR introduces the ability to define modifiers at the document level that apply to all compatible sources within that document.
Problem
Previously, modifiers could only be defined at the source level, requiring repetition when the same modifier needed to be applied to multiple sources within a document.
Solution
Implemented an immutable
ModifiersAppliersystem that:Example Usage
{ "documents": [ { "description": "API Documentation", "outputPath": "docs/api.md", "modifiers": ["php-signature"], "sources": [ { "type": "file", "sourcePaths": ["src/Api"], "filePattern": "*.php" } ] } ] }Add support for modifier aliases in configuration
This PR adds support for defining and using modifier aliases in the configuration. This feature allows users to define common modifier configurations once and reference them by name, reducing duplication in the configuration.
Problem
Currently, users need to repeat the same modifier configurations across multiple documents or sources, leading to duplication and maintenance challenges.n
Example Usage
Users can now define modifier aliases in their configuration:
{ "settings": { "modifiers": { "api-docs": { "name": "php-content-filter", "options": { "keep_doc_comments": false, "keep_method_bodies": false } } } }, "documents": [ { "description": "API Documentation", "outputPath": "docs/api.md", "sources": [ { "type": "file", "sourcePaths": ["src/Api"], "modifiers": ["api-docs"] } ] } ] }