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

support deep links to headers #43

Open
gregwebs opened this issue Jul 20, 2021 · 0 comments
Open

support deep links to headers #43

gregwebs opened this issue Jul 20, 2021 · 0 comments
Labels
component/document enhancement New feature or request

Comments

@gregwebs
Copy link
Contributor

gregwebs commented Jul 20, 2021

Google Docs works this way: one can send a link to a header. When the recipient browses to the link, the document will get scrolled to the header in the link. We should do the same. Note we do support giving headers for the preview and the edit views.

Browser extension integration: the extension adds a link to gdocwiki. That link could include the header in the current Google Doc if a header has been clicked in the current doc.

I think the way to do this is to wait for the anchor to be displayed in the page and then change the location hash to something else and back.

var hash = location.hash
// wait for hash anchor to exist
location.hash = '#';
location.hash = hash;

In #67 there are now some MutationObservers waiting for document changes but we can probably trigger this from DocPage directly.

@gregwebs gregwebs changed the title proper support for links to headers support external links to headers Jul 20, 2021
@gregwebs gregwebs added the enhancement New feature or request label Jul 27, 2021
@gregwebs gregwebs changed the title support external links to headers support deep links to headers Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/document enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant