feat: Add configurable blank line detection and content splitting control#2
Open
uho-33 wants to merge 4 commits intoosteele:mainfrom
Open
feat: Add configurable blank line detection and content splitting control#2uho-33 wants to merge 4 commits intoosteele:mainfrom
uho-33 wants to merge 4 commits intoosteele:mainfrom
Conversation
Use `--no-split-content` to enable this mode. When enabled content blocks are never split, even creating slices with more blank space if necessary. But if context exceeds page height, it will exit with some suggestions.
Add --blank-ratio argument to control strictness of blank line detection. Default value 0.0 maintains original strict behavior (all pixels > 250). Higher values allow percentage of non-blank pixels in 'blank' lines
There was a problem hiding this comment.
Pull Request Overview
This PR introduces two key features to enhance page break control in scrollshot2pdf: configurable blank line detection and content splitting prevention.
- Adds
--blank-ratioparameter to allow tolerance for noisy pixels in blank line detection - Adds
--no-split-contentflag to prevent splitting content blocks across pages - Includes comprehensive error handling and documentation for the new features
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scrollshot2pdf.py | Implements the core functionality for both new features with parameter validation and error handling |
| README.md | Documents the new options with usage examples and detailed explanations |
| CHANGELOG.md | Records the feature additions for version 0.1.2 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- simplify the gap detection logic - fix error in the `blank_ratio` argument description
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
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.
Summary
This PR adds two new features to improve page break control:
--blank-ratio: Makes blank line detection configurable, allowing for noisy images--no-split-content: Prevents content blocks from being split across pagesDetails
Blank Line Detection (
--blank-ratio)Content Splitting Control (
--no-split-content)Usage Examples