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

PDFs: support PDFs for the website #3204

Open
a0m0rajab opened this issue Aug 17, 2024 · 7 comments
Open

PDFs: support PDFs for the website #3204

a0m0rajab opened this issue Aug 17, 2024 · 7 comments

Comments

@a0m0rajab
Copy link

I did not find a better place to share this (would appreciate to point me to where should I publish it if it's not the correct place)

I was trying to find the PDF of the handbook for couple of reasons:

  • Offline reading
  • Reading from ereader
  • Focus reading (by using ereader to not get distracted)

Yet I found that it was removed from the website for simplicity reasons. Is there any new decision about this?

Related issue: #2619 (comment)

@a0m0rajab
Copy link
Author

Note in the comment it's suggested that the print function would be a good usage, yet it does not show the full text (which was the same issue with playwright)

Here is the related page: https://www.typescriptlang.org/docs/handbook/2/modules.html

The print generated from the CTRL + P (on chrome browser, Version 127.0.6533.120 (Official Build) (64-bit), windows)

image

The missing text: The JavaScript specification declares that any JavaScript files without an import declaration, export, or top-level await should be considered a script and not a module.

The docs:

image

I think that search docs and some other tags should not be visible on the print document.

@a0m0rajab
Copy link
Author

Related issue: #620

@a0m0rajab
Copy link
Author

Workaround: I did remove the navbar, and extra information from the page which helped to have a better look for the printing and get the text here is the result:

After:
image
image

Before:
image
image

@a0m0rajab
Copy link
Author

Javascript code to remove the extra elements from the webpage:

document.querySelectorAll("header, #page-helpful-popup, #site-footer, .whitespace-tight.raised").forEach(e => {
    e.remove()
})

@a0m0rajab
Copy link
Author

Note: i tried to run the website and have a minimal working example as proof of concept but was not able to run the website locally, might visit this later.

@a0m0rajab
Copy link
Author

The website worked on ubuntu but did not work on windows.

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

No branches or pull requests

1 participant