cesko-digital / movapp

Naučte se základy češtiny a ukrajinštiny pro běžné životní situace. / Вивчіть основи чеської та української мови для повсякденного життя. / Learn the basics of Czech and Ukrainian for everyday life situations.
https://www.movapp.cz
MIT License
20 stars 20 forks source link

pdf-tales #256

Closed KlYana closed 1 year ago

KlYana commented 1 year ago

-- create pdf for tales

met commented 1 year ago

@KlYana Thank you, I am trying to discuss it more with our UX people here: https://cesko-digital.slack.com/archives/C03C9M0QPA9/p1679252244602969

jejdacz commented 1 year ago

@met @KlYana I think it would be good to have a tale title included in pdf.

KlYana commented 1 year ago

@met change accordingly to slack channel (except info text regarding audio version, could not positioned it as in slack example)

KlYana commented 1 year ago

as well @met @jejdacz please check if it is possible to import images for stories that way?? when I was trying to import like this: src={/kids/${story.slug}.jpg}, pdf could not find the image

jejdacz commented 1 year ago

It worked on my local. But I don't know if it's going to work on remote vercel server. Where you need to do this?

met commented 1 year ago

@KlYana Please change color or the inicial line number to some gray

text-gray-300 or text-gray-400 could be fine:

https://tailwindcss.com/docs/text-color image

And in the ending sentence "Zvuk k téhle pohádce a také další pohádky můžete najdete na webu❤www.movapp.cz" make some "space" in the ❤ location, no there is no space.

KlYana commented 1 year ago

@jejdacz please check in [storyId].tsx, when trying to export pdf with image src={/kids/${story.slug}.jpg} I've got no image found. So for now I'm using it like src={https://www.movapp.cz/_next/image?url=%2Fkids%2F${story.slug}.jpg&w=640&q=75} which does not seem correctly for me but it works. I need some confirmation if it can be like this, or if not, how can I add src correctly

jejdacz commented 1 year ago

@jejdacz please check in [storyId].tsx, when trying to export pdf with image src={/kids/${story.slug}.jpg} I've got no image found. So for now I'm using it like src={https://www.movapp.cz/_next/image?url=%2Fkids%2F${story.slug}.jpg&w=640&q=75} which does not seem correctly for me but it works. I need some confirmation if it can be like this, or if not, how can I add src correctly

@KlYana I have it same. I didn't find any other solution than src={https://www.movapp.cz/_next/image?url=%2Fkids%2F${story.slug}.jpg&w=640&q=75}.

I did it wrong before. I forgot to rebuild. Sorry for wrong info.

jejdacz commented 1 year ago

Another approach could be to provide content styled with css for print and let the user print it to pdf file. Then we need no pdf generation.

KlYana commented 1 year ago

@met I've corrected text color and space. @jejdacz please approve if it's ok, I then can merge changes

met commented 1 year ago

Since the stories section code was and is UK/CS version only it's ok to merge. There's lot of conditions made on "cs" "uk". Not good.

I agree with finishing this soon in this way.

During next weeks there will be Slovak fairytales ready soon (but not Polish yet). There will be time to think about language conditions (or improve them).

And there is also this (stories of fairytales will be in central data repostitory in similar way like the data for dictionary is), see https://trello.com/c/dn0tMBGd

So some things will need to be rewritten. But that could take time. Better finish this one now so PDF can work now and there is not such press for rewrite.

jejdacz commented 1 year ago

@KlYana So I think it's ready to merge.