Skip to content

Add generated PDF editions for 2021 and 2025 - #962

Open
sainadh777 wants to merge 1 commit into
OWASP:masterfrom
sainadh777:docs/issue-934-pdf-downloads
Open

Add generated PDF editions for 2021 and 2025#962
sainadh777 wants to merge 1 commit into
OWASP:masterfrom
sainadh777:docs/issue-934-pdf-downloads

Conversation

@sainadh777

Copy link
Copy Markdown

Summary

  • generate downloadable English PDF editions for the 2021 and 2025 MkDocs sites
  • publish the PDFs with the existing combined site and link them from both homepages and the repository README
  • document the optional PDF dependencies and build targets

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-pdf tooling, adds an explicit Python 3.10 preflight, and preserves the normal HTML-only build-all and 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.pdf
  • build/2025/downloads/OWASP-Top-10-2025-en.pdf

Validation

  • PATH=<clean Python 3.12 venv>/bin:$PATH make build-pdfs — passed from a clean build/; HTML builds completed in 10.50s (2021) and 6.65s (2025), then PDF conversion completed for 17 and 16 source articles respectively
  • PDF structure/content checks with pypdf — 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 schemes
  • rendered every PDF page with Poppler — 128/128 pages rendered and visually inspected; the final clean-build renders were pixel-identical to the inspected set
  • local rendered-site browser smoke test — both homepage links were visible and navigated to their PDF endpoints with HTTP 200
  • shellcheck scripts/build-pdfs.sh, bash -n scripts/build-pdfs.sh, and git diff --check — passed
  • Python boundary check — Python 3.9 exits with the documented requirement; Python 3.12 passes

The 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

@sainadh777

Copy link
Copy Markdown
Author

@sslHello could you help to review this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No PDF versions of Top 10 2021 and Top 10 2025

1 participant