Skip to content

[WIP] Add PDF generation for ipynb files#4

Merged
hifly81 merged 5 commits intofeature/pdf-genfrom
copilot/add-pdf-generation-script
Nov 1, 2025
Merged

[WIP] Add PDF generation for ipynb files#4
hifly81 merged 5 commits intofeature/pdf-genfrom
copilot/add-pdf-generation-script

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

Summary

Successfully implemented a GitHub Actions workflow that automatically generates PDFs from all Jupyter notebooks when a new release is created or published.

Completed Tasks

  • Create .github/workflows directory
  • Create GitHub Actions workflow for PDF generation on release draft
  • Configure workflow to install dependencies (nbconvert, jupyter, pandoc, texlive)
  • Convert all .ipynb files to PDFs
  • Upload PDFs as release assets
  • Update .gitignore to exclude PDF files from repository
  • Make workflow resilient to handle conversion errors gracefully
  • Test PDF conversion locally (13 of 14 notebooks convert successfully)
  • Pin package versions for reproducible builds
  • Add safety checks for glob expansion
  • Address all code review feedback
  • Add explicit permissions to workflow
  • Pass security scan with 0 alerts

Key Features

  1. Automated PDF Generation: Workflow triggers on release creation/publishing events
  2. Complete Dependency Installation: Installs pandoc, texlive, jupyter, and nbconvert
  3. Error Resilience: Continues processing even if individual notebook conversions fail
  4. Security Compliant: Explicit permissions set, passes CodeQL security scan
  5. Reproducible Builds: Pinned package versions (jupyter==1.1.1, nbconvert==7.16.6)
  6. Safe Glob Handling: Proper checks to prevent issues with empty file sets
  7. Clean Repository: No PDF files or generation scripts committed to the repository

Testing

  • Tested PDF conversion locally: 13 out of 14 notebooks convert successfully
  • One notebook (10_testunit.ipynb) has a pandoc parsing issue, but the workflow handles it gracefully
  • YAML syntax validated
  • Security scan passed with 0 alerts

Files Changed

  • .github/workflows/generate-pdfs-on-release.yml (new): GitHub Actions workflow
  • .gitignore (modified): Added exclusions for PDF files and pdfs/ directory
Original prompt

This section details on the original issue you should resolve

<issue_title>Add PDF for all ipynb files</issue_title>
<issue_description>Script to generate a single PDF should be not pushed into the repo. PDF generation must be loaded when drafting a new release</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: hifly81 <640061+hifly81@users.noreply.github.com>
@hifly81
Copy link
Contributor

hifly81 commented Nov 1, 2025

@copilot

@hifly81 hifly81 self-requested a review November 1, 2025 09:18
Copy link
Contributor

@hifly81 hifly81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @copilot

@hifly81 hifly81 self-requested a review November 1, 2025 09:21
Copilot AI and others added 3 commits November 1, 2025 09:22
Co-authored-by: hifly81 <640061+hifly81@users.noreply.github.com>
…ty checks

Co-authored-by: hifly81 <640061+hifly81@users.noreply.github.com>
Co-authored-by: hifly81 <640061+hifly81@users.noreply.github.com>
@hifly81 hifly81 marked this pull request as ready for review November 1, 2025 09:25
@hifly81 hifly81 merged commit d127d4d into feature/pdf-gen Nov 1, 2025
Copilot AI requested a review from hifly81 November 1, 2025 09:26
@hifly81 hifly81 deleted the copilot/add-pdf-generation-script branch November 5, 2025 14:44
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.

2 participants