Seneca-ICTOER / Intro2C

Seneca College IPC144 Course Notes
https://ipc144.sdds.ca
Other
7 stars 52 forks source link

PDF file generation INCOMPLETE #178

Closed CameronGray1210 closed 1 year ago

CameronGray1210 commented 1 year ago

The PDF file generation is creating only the TOC (table of contents) with links to localhost on port 3000 :(

Could this be due to #174?

humphd commented 1 year ago

cc @Genne23v, @denke8.

We also updated a bunch of dependencies. Can you two do some investigation? We need to unbreak this soon, or roll back whatever broke it.

Genne23v commented 1 year ago

I tested both old and updated script. Both creates the same pdf content which is empty. I remember created pdf had contents when I was working on #174 last week.

ghost commented 1 year ago

@CameronGray1210, @humphd Do we have a specific version (i.e., git commit hash) that is known to be working?

edit: I can confirm that d58820163b2249635b3cf45a52dd9c2d40fddf62 does work

humphd commented 1 year ago

@dadolhay this is what git bisect is for, see https://blog.humphd.org/learning-to-git-bisect/

ghost commented 1 year ago

I can also confirm that upgrading the following libraries:

    "@docusaurus/core": "2.2.0",
    "@docusaurus/plugin-ideal-image": "^2.2.0",
    "@docusaurus/plugin-pwa": "^2.2.0",
    "@docusaurus/preset-classic": "2.2.0",

from 2.0.0-beta9 to 2.2.0 do indeed cause the issue, actually 2 of them:

However, as a workaround, if we do a build and serve (causing static site to be built and served instead) mr-pdf seems to start working again correctly.

@CameronGray1210, @humphd, @Genne23v Do you agree with this change?

humphd commented 1 year ago

I wonder if we should explore other options. For example, https://github.com/signcl/docusaurus-prince-pdf seems to be updated more recently. If we can get mr-pdf to work with your 2.2.0 setup, great. If not, let's try something new.

@dadolhay are you willing to work on this?

ghost commented 1 year ago

@humphd

I did make mr-pdf work with the static served content locally, I should be able to integrate it into the build script I'd expect. On the other hand, if you prefer, I could also explore prince-pdf too. (It may or may not work, I have no experience with it).

Which direction would you prefer?

humphd commented 1 year ago

I would say if you can get what we have now working again, start there. If we want to try switching to a new approach later, that should be a follow-up.

ghost commented 1 year ago

@humphd

Upon further inspection I can see that the generation script already runs against the static site, so the development changes of docusaurus should not make any difference.

I created a small PR, that updates the selector mentioned above. The changes did work on local testing.