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

Added Saffron and PDF export format #1211

Merged
merged 7 commits into from
Jan 7, 2022

Conversation

TiagoRascazzi
Copy link
Contributor

Exporting to Saffron was added.

Exporting to a PDF uses pyppeteer to generate a PDF of the recipe page using print css.
This essentially allows to print multiple recipe to PDF.

Also in the recipe page the css was modified to avoid page break in the ingredient list and each individual steps

@vabene1111
Copy link
Collaborator

this is very cool, thank you. We could also add a "print this recipe book" function using the pypeteer library. I need to take some time to properly review this but i like it very much, thanks !

@vabene1111 vabene1111 self-requested a review January 4, 2022 07:29
@vabene1111
Copy link
Collaborator

ok merging this, will need to test how this impacts performance if a browser is rendering every single recipe and someone (like me) who has hundres of recipes exports all of the at the same time but other than that this looks really cool

@vabene1111 vabene1111 merged commit 0a6abf9 into TandoorRecipes:develop Jan 7, 2022
@vabene1111
Copy link
Collaborator

Ok so i just merged and tested the changes, i have the following notes

  • for puppeteer to work it needs to download a chromium bundle which is quite large (for some peoples VPS's). I could not really test performance yet (see below) but i suspect it might be meaningful on some servers. For that reason i think i will disable the PDF export by default (for now) and add an environment setting to allow it for server owners to decide if they want to enable it or not.
  • Exporting multiple recipes at the same time does not work due to a async issue. I honestly have not looked much into how djangos async works, i would have thought that if one recipe works exporting multiple works as well but it does not. Can you take a look at that ? If not i will just add to the docs that for now only one is possible (i only tested with manage.py runserver so far, is there any change in the setup required to get async to work properly) ?

@TiagoRascazzi
Copy link
Contributor Author

Ok I ll see If I can find something for exporting multiple

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.

None yet

2 participants