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

Make #id URLs work by setting the location.hash again after all cells are rendered #2789

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Jan 23, 2024

Now you will be able to share a URL like:

https://plutojl.org/en/docs/abstractplutodingetjes/#c3e83475-6ab0-4aa8-9a57-c2f25772cc75

Before this PR, this does not work because cells are rendered with a delay, and the UA tries to scroll to the element quickly after the page got loaded.


This PR also makes this URL work:

https://plutojl.org/en/docs/abstractplutodingetjes/#possible_values

By giving all Docs.binding displays the id of the variable name.

Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="restore-location.hash-after-load")
julia> using Pluto

@fonsp fonsp added frontend Concerning the HTML editor publishing Notebooks as static documents on the web labels Jan 23, 2024
@fonsp
Copy link
Owner Author

fonsp commented Jan 23, 2024

Unfortunately this does not work with Chrome's "Copy link to this selection" feature, because the special chrome hash (#:~:text=.-,Add%20a%20comment,-Comment) is hidden from the window.location.hash, so there's nothing we can do about that.

@fonsp fonsp merged commit 2307d84 into main Jan 23, 2024
16 of 17 checks passed
@fonsp fonsp deleted the restore-location.hash-after-load branch January 23, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Concerning the HTML editor publishing Notebooks as static documents on the web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant