Tags: whizzes/nyomda
Tags
feat: prints pdf via chromium (#1) This pull request introduces a new HTML-to-PDF printing feature using a headless Chromium browser. It adds a new `/print` API endpoint, updates dependencies and Docker configuration to support Chromium, and implements the backend logic for converting HTML to PDF. The most important changes are: **New HTML-to-PDF Printing Feature:** * Added a new `chromium` module with a `html_to_pdf` function that uses the `headless_chrome` crate to convert HTML to PDF. [[1]](diffhunk://#diff-5e3c8ceb56d3b75033f57da51769b953a177ef225cadb0ad6e74f19f386d66adR1-R23) [[2]](diffhunk://#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fcR1) * Introduced a new `/api/v0/print` endpoint with request/response types and error handling, including input validation and PDF generation logic. [[1]](diffhunk://#diff-5f158809f4dda75f953e3be8d839087188b80ed45420a82081c69a36163f7bf9R1-R40) [[2]](diffhunk://#diff-262244ea1412e65cfdc9a43c7ce12735842f8442152c168227b6588bd373be7fR1-R94) [[3]](diffhunk://#diff-e71a2fba1d8da9e99f81fd67c590a14a556dba5301ccc7d8a63935b35c663ec9R3-R8) [[4]](diffhunk://#diff-e71a2fba1d8da9e99f81fd67c590a14a556dba5301ccc7d8a63935b35c663ec9R68) **Dependency and Docker Updates:** * Added `headless_chrome` and `urlencoding` to dependencies in `Cargo.toml` to enable browser automation and HTML encoding. * Updated the `Dockerfile` to use `alpine:latest` as the base image, install Chromium and necessary fonts, and set up the environment for headless browser operation. These changes collectively enable the backend to accept HTML input via an API call and return a generated PDF file.
chore: reintroduce latex (#2) This pull request significantly expands the capabilities of the `docker/Dockerfile` by installing a broad set of tools and dependencies commonly used for document processing, scientific computing, and development workflows. The changes enable support for LaTeX compilation, diagram generation, and various scripting languages, as well as improved font and locale handling. The most important changes are: **Document and Diagram Tooling:** * Added installation of full LaTeX toolchain (`texlive` and related packages), Pandoc (for document conversion), and PlantUML (for diagram generation), enabling robust document processing and diagram rendering workflows. **Development and System Utilities:** * Added a wide range of system and development tools including `git`, `ruby`, `python3`, `openjdk11-jre`, `curl`, and `wget`, making the container suitable for a variety of scripting and build tasks. **Font and Locale Configuration:** * Installed additional fonts (`ttf-freefont`, `font-inconsolata`) and updated font caches and LuaTeX font database, and set locale-related environment variables (`LANG`, `LC_ALL`, `TERM`) to ensure proper font rendering and consistent environment behavior. **Browser and PDF Utilities:** * Ensured installation of Chromium and PDF utilities (`poppler-utils`) for browser-based and PDF processing tasks. (