mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: add report export capabilities with Pandoc and WeasyPrint support
- Updated Dockerfiles to include Pandoc and WeasyPrint runtime libraries for report generation. - Enhanced report retrieval functionality to include version siblings in the response. - Modified report export process to utilize WeasyPrint for PDF generation, improving output quality.
This commit is contained in:
parent
5c9dd0b787
commit
e7a73d0570
4 changed files with 13 additions and 1 deletions
|
|
@ -121,6 +121,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
libgbm1 \
|
||||
libcairo2 \
|
||||
libpango-1.0-0 \
|
||||
# ============================
|
||||
# Report export (Pandoc + WeasyPrint runtime libs)
|
||||
# ============================
|
||||
pandoc \
|
||||
libpangoft2-1.0-0 \
|
||||
libharfbuzz0b \
|
||||
libharfbuzz-subset0 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Node.js 20.x (for running frontend)
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
libxrender1 \
|
||||
dos2unix \
|
||||
git \
|
||||
pandoc \
|
||||
libpango-1.0-0 \
|
||||
libpangoft2-1.0-0 \
|
||||
libharfbuzz-subset0 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Update certificates and install SSL tools
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ async def export_report(
|
|||
# thread executor to avoid blocking the async event loop.
|
||||
extra_args = ["--standalone"]
|
||||
if format == ExportFormat.PDF:
|
||||
extra_args.append("--pdf-engine=wkhtmltopdf")
|
||||
extra_args.append("--pdf-engine=weasyprint")
|
||||
|
||||
loop = asyncio.get_running_loop()
|
||||
output = await loop.run_in_executor(
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ dependencies = [
|
|||
"langchain-unstructured>=1.0.1",
|
||||
"slowapi>=0.1.9",
|
||||
"pypandoc>=1.16.2",
|
||||
"weasyprint>=68.1",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue