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

Implement anchors for jumping to code #76

Open
xfbs opened this issue Oct 30, 2024 · 1 comment
Open

Implement anchors for jumping to code #76

xfbs opened this issue Oct 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@xfbs
Copy link
Owner

xfbs commented Oct 30, 2024

Something like:

  • https://diff.rs/view/serde/1.0.100/files/src/main.rs#L66
  • https://diff.rs/view/serde/1.0.100/files/src/main.rs#fn:main

Allows for creating permalink to functions/lines for viewing crates.

@xfbs xfbs added the enhancement New feature or request label Oct 30, 2024
@xfbs
Copy link
Owner Author

xfbs commented Oct 30, 2024

I pushed a commit that implements the first step in making this possible.

Still need to do more things:

  • Make this work with single column view
  • Automatically expand if anchor line is hidden
  • Implement smooth scrolling (CSS scroll-behaviour: smooth)
  • Implement scroll margin (CSS scroll-margin-top: 100px)
  • Highlight anchor line
  • Make line numbers clickable (link to anchor)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant