MostlyAdequate / mostly-adequate-guide

Mostly adequate guide to FP (in javascript)
Other
23.43k stars 1.87k forks source link

Links to gitbooks broken #586

Closed frazjp65 closed 3 years ago

frazjp65 commented 4 years ago

The links to gitbooks all go to https://www.gitbook.com/?utm_source=legacy&utm_medium=redirect&utm_campaign=close_legacy.

This is probably because the transition to from the legacy site to their new site.

Did you run through the Migrating your content process?

cjgmj commented 4 years ago

I'm trying to download the PDF file but the link is broken. Also, I'm trying do it myself but I'm getting many errors. Can you put a link to the PDF file?

Thank you in advance.

prescottbreeden commented 4 years ago

You can get the link directly from here: https://mostly-adequate.gitbooks.io/mostly-adequate-guide/content/ I am not able to download a PDF from it but at least the content is all still there. Looks like gitbook has moved their focus away from serving PDFs, even their documentation on generating PDFs is a broken link: http://toolchain.gitbook.com/ebook.html

If you need a PDF for offline purposes you could use other npm packages like markdown-pdf and build a script something like this (this is for linux): https://gist.github.com/prescottbreeden/04d46af42944fce22c2fce5c88bd9fd4

keep in mind links will not behave as expected and some of the styling will be weird since it won't transform gitbook syntax

jamesstoneco commented 3 years ago

I am coming across these broken links as well, in the book listed and linked above in the readme as well as in the repo readme. I think the links should be removed if they are not working.

achimcc commented 3 years ago

Same for me! Can't download the pdf's, and npm run generate-pdf is ending with errors :(

cjgmj commented 3 years ago

Finally, I was be able to run npm run generate-pdf following the next steps (in Windows):

  1. In package.json I changed the script setup for ./node_modules/.bin/gitbook install.
  2. In book.json I changed exercises@git+https://github.com/MostlyAdequate/plugin-exercises.git for exercises.
  3. Run npm run setup.
  4. Uninstall gitbook-cli inside the project and install it globally.
  5. Inside the global installition of gitbook-cli in C:\Users\YOUR_USER\AppData\Roaming\npm\node_modules\gitbook-cli\node_modules\npm\node_modules you have to run npm install graceful-fs@4.2.0 --save
  6. Install Calibre.

Once you follow this steps you are ready to run npm run generate-pdf (I think I don't forget anything).

KtorZ commented 3 years ago

The PDF & EPUB are now built automatically via Github Actions with build artefacts uploaded as a result: https://github.com/MostlyAdequate/mostly-adequate-guide/actions/runs/802457659

Note that the script for doing locally still kinda works but they require an old version of node.js; I've been able to run them using an old LTS (v10.22.1) which I pinned down using dotfiles for those using nvm.

There's also a bug in Calibre 4.9.x (which is apparently the one shipping on recent versions of Aptitude), which is fixed in more recent version; so updating Calibre manually is necessary to work around that.

If anything, I'll invite those who want to build locally to have a look at the github workflow now running on each push to master: https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/.github/workflows/build.yml

Or simply, enjoy the build artefacts :ok_hand:

hukka commented 3 years ago

The links are still broken, though

KtorZ commented 3 years ago

What link?

https://mostly-adequate.gitbook.io/mostly-adequate-guide/

This one works fine.

hukka commented 3 years ago

On that gitbook page, the link to pdf still points to https://www.gitbook.com/download/pdf/book/mostly-adequate/mostly-adequate-guide (epub and mobi similarly too)

KtorZ commented 3 years ago

Ah! That is weird, this gitbook page should have been rebuilt with the latest push. Seems like something is off with gitbook and the synchronization with Github.