Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨Export pdf / docx front side #537

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Jan 6, 2025

Purpose

We have added the export to pdf and docx feature to the front side.
Thanks to that, the images are now correctly exported even when the doc is private.
To be able to export the doc, the data must be in Blocknote format, for legacy purpose, we have to convert the template to Blocknote format before exporting it.

close #202

Proposal

  • ✨(frontend) export pdf docx front side
  • 🔥(backend) remove code related to export pdf docx

Demo

scrnli_072OH9VH48IDJQ.webm

@AntoLC AntoLC self-assigned this Jan 6, 2025
@AntoLC AntoLC force-pushed the feature/export-front-side branch 2 times, most recently from a5a72eb to 7dad46f Compare January 6, 2025 16:01
@AntoLC AntoLC linked an issue Jan 6, 2025 that may be closed by this pull request
@AntoLC AntoLC force-pushed the feature/export-front-side branch from 7dad46f to c3db0f5 Compare January 6, 2025 16:14
@AntoLC AntoLC marked this pull request as ready for review January 6, 2025 16:15
Copy link
Collaborator

@PanchoutNathan PanchoutNathan left a comment

Choose a reason for hiding this comment

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

It is absolutely necessary to add a loader to the button when exporting because on a large document with the demo template and a PDF export it takes a few seconds and we wonder if it doesn't bug

@@ -72,7 +72,6 @@ RUN apk add \
gettext \
gdk-pixbuf \
libffi-dev \
pandoc \
Copy link
Member

Choose a reason for hiding this comment

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

Look at the initial commit, I think more dependencies can be removed that are linked to exports.

@@ -50,13 +50,11 @@ dependencies = [
"openai==1.58.1",
"psycopg[binary]==3.2.3",
"PyJWT==2.10.1",
"pypandoc==1.14",
Copy link
Member

Choose a reason for hiding this comment

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

looking at git history you can remove more dependencies like for example python-frontmatter and probably nested-multipart-parser

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • python-frontmatter is used for the translations
  • nested-multipart-parser for the swagger

We have added the export to pdf and docx feature
to the front side. Thanks to that, the images are now
correctly exported even when the doc is private.
To be able to export the doc, the data must be
in blocknote format, for legacy purpose, we have
to convert the template to blocknote format before
exporting it.
The export is managed by the frontend, so we
don't need the code related to the export
in the backend side anymore.
Add some changelog entries that can be useful to
display in the release notes.
All the uploaded files had the content-type set
to `application/octet-stream`. It create issues
when the file is downloaded from the frontend
because the browser doesn't know how to handle
the file.
We improved the mimetype database and we
now determine the content-type of the file
and set it to the file object.
@AntoLC AntoLC force-pushed the feature/export-front-side branch from c3db0f5 to 06660c7 Compare January 14, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adapt export to new BlockNote.js version 🐛🛂 Image uploaded not accessible from export resources
3 participants