Add generated PDF editions for 2021 and 2025 - #962
Open
sainadh777 wants to merge 1 commit into
Open
Conversation
Author
|
@sslHello could you help to review this ? |
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
Root cause
The project build generated only HTML. It had no reproducible PDF configuration, dependency set, build target, or deployment integration, so the 2021 and 2025 editions could not be downloaded as PDFs.
Implementation
The new PDF build stages only English content plus shared assets, avoiding overlap with the site's multilingual HTML build. It uses pinned
mkdocs-to-pdftooling, adds an explicit Python 3.10 preflight, and preserves the normal HTML-onlybuild-alland live-serve workflows. A PDF-only 2021 table style keeps the legacy nine-column factor tables within the A4 page boundary.The generated PDFs are placed at:
build/2021/downloads/OWASP-Top-10-2021-en.pdfbuild/2025/downloads/OWASP-Top-10-2025-en.pdfValidation
PATH=<clean Python 3.12 venv>/bin:$PATH make build-pdfs— passed from a cleanbuild/; HTML builds completed in 10.50s (2021) and 6.65s (2025), then PDF conversion completed for 17 and 16 source articles respectivelypypdf— passed: 2021 is 59 A4 pages and 2025 is 69 A4 pages; both include A01-A10, have 16 outline entries, no encryption, no low-text/blank pages, and no invalid link schemesshellcheck scripts/build-pdfs.sh,bash -n scripts/build-pdfs.sh, andgit diff --check— passedThe clean build retained 14 existing MkDocs i18n warnings and two existing LibreSSL notices. WeasyPrint also emitted 12 Fontconfig error/warning pairs and two font-metadata notices on this macOS environment; PDF generation completed successfully and the rendered output was verified page by page.
Fixes #934