feat: implement professional Export to PDF with optimized print media styles#202
Closed
Dev1822 wants to merge 1 commit into
Closed
feat: implement professional Export to PDF with optimized print media styles#202Dev1822 wants to merge 1 commit into
Dev1822 wants to merge 1 commit into
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
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.
Closes #197
Overview
This PR implements a robust, high-fidelity "Export to PDF" feature. It upgrades the simple "Print Preview" functionality to a polished, professional PDF export system. Using native browser print capabilities coupled with highly optimized print media stylesheets, it renders beautiful vector-scaled README documents without requiring heavy external dependencies.
Key Enhancements
1. Theme-Lock & High Contrast Contrast
:rootmarkdown-rendering variables (--gh-preview-*) to light-mode values inside the print media query.2. Auto-Zoom Resolution
--preview-zoomvariable to1 !importantfor printing.3. Full-length Printing (Preventing Viewport Cutoffs)
html,body,#root,#app-builder,.main,.preview,.preview-body) toheight: auto !importantandoverflow: visible !important.4. Page Break Optimizations
break-inside: avoid/page-break-inside: avoidfor code block wrappers (pre), blockquotes, tables, table rows (tr), list items (li), and images to prevent ugly horizontal splits.break-after: avoidfor headings (h1-h6) so headers stay anchored to the paragraphs below them.5. Interface De-cluttering (Chrome Removal)
UI Changes
ReadmeMaker.jsxwith a clean SVG document icon.PreviewPanel.jsxfrom "Print Preview" to "Export to PDF" with matching icon, styles, and notification toasts.Verification & Tests Done
npm run build) to ensure zero esbuild or linting errors.